Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Language Server (LSP) #3

Open
6 of 10 tasks
bricelam opened this issue Oct 14, 2021 · 7 comments · Fixed by #14
Open
6 of 10 tasks

Add a Language Server (LSP) #3

bricelam opened this issue Oct 14, 2021 · 7 comments · Fixed by #14
Labels
enhancement New feature or request lsp Applies to the feature/lsp branch
Milestone

Comments

@bricelam
Copy link
Owner

bricelam commented Oct 14, 2021

I'll never have time for this, but it would be amazing if we could add a Language Server for T4 that delegates to the C# language server inside control blocks. (This is essentially how the Razor editor works.)

We'd map blocks of the T4 file to blocks of preprocessed C# class files to light up full C# support.

This would also enable full IntelliSense support for T4 Directive names and arguments.

Basic features

  • Diagnostics
    • Parser errors
    • Compiler errors
  • Completion
    • Directives
    • Text blocks (word-based)
      • Snippets
  • Hover (directives)
  • Document highlights (text blocks, word-based)

Advanced features

  • Delegate to the C# LSP
@bricelam bricelam added enhancement New feature or request help wanted Extra attention is needed labels Oct 14, 2021
This was referenced Oct 14, 2021
@AraHaan
Copy link

AraHaan commented Sep 7, 2022

I agree, I think it would be good to have.

@bricelam bricelam added this to the 1.2.0 milestone Sep 19, 2022
@bricelam
Copy link
Owner Author

bricelam commented Sep 19, 2022

So I'm actually gonna dig into this as part of the hackathon this week. You can watch my sanity slowly deteriorate using the feature/lsp branch. 😉

@AraHaan
Copy link

AraHaan commented Sep 20, 2022

You mean your sanity slowly become that on the level of roslyn dev?

@bricelam
Copy link
Owner Author

Hmm, it looks like by just having a language server, you lose some features: ☹️

  • Snippets
  • Word-based completion
  • Word-based references highlighting

I've re-implemented word-based completion inside the language server, but the other features will also need to be addressed before releasing anything from this branch.

@AraHaan
Copy link

AraHaan commented Sep 23, 2022

Wait why is that so? Seems like just adding a language server provides a downgrade. Let's complain to the roslyn repository about it.

@bricelam bricelam self-assigned this Sep 23, 2022
@bricelam
Copy link
Owner Author

bricelam commented Sep 23, 2022

It's due to the interaction between two (built-in) Visual Studio extensions. I was previously only using the TextMate one. It provides syntax highlighting, basic completion (snippets and word-based), and reference highlighting. When a language server is present, the LanguageServer extension takes over completion and reference highlighting (so it can call into the language server). Ideally, if a language server didn't declare these capabilities, it would fallback to the TextMate implementation, but it doesn't. (And I get why--it's hard to do.) It would also be nice if the TextMate snippets completion could coexist with the language server completion so it didn't have to re-implement it.

@bricelam bricelam removed the help wanted Extra attention is needed label Sep 23, 2022
@bricelam
Copy link
Owner Author

Reopening per PR #27

@bricelam bricelam reopened this Jul 15, 2023
@bricelam bricelam removed their assignment Jul 27, 2023
@bricelam bricelam added the lsp Applies to the feature/lsp branch label Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lsp Applies to the feature/lsp branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants