Skip to content

syntax highlighting + intellisense not working for project created using dotnet script init #737

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

Closed
awa5114 opened this issue Sep 21, 2023 · 4 comments

Comments

@awa5114
Copy link

awa5114 commented Sep 21, 2023

I tried creating a scripting project using dotnet script init and then opened it on VS Code. When I open main.csx, syntax highlighting appears for a brief moment and then disappears as soon as the following line appears in the Output window:

[Info  - 4:50:53 PM] [Program]Language server initialized

Initially I thought this might be an Omnisharp issue, but the syntax highlighting + intellisense seem to work just fine on a conventional console application.

Should I expect syntax highlighting + intellisense to work with dotnet-script? If so what might be going on here?

@seesharper
Copy link
Collaborator

seesharper commented Oct 3, 2023

Hi. This is probably because you have the C# Dev Kit installed and hence OmniSharp is not used here.

Step 1. Make sure that the C# Dev Kit extension is uninstalled
Step 2. Make sure that "Use Omnisharp" is ticked in the settings.

image

Microsoft basically killed OmniSharp (and dotnet-script language services) when they decided to write their own backend.
It did not land well in the OSS community. Most of the discussion can be found here
dotnet/vscode-csharp#5276

@awa5114
Copy link
Author

awa5114 commented Oct 4, 2023

@seesharper Thanks for your response, I've gotten it to work.

I had already stumbled across that discussion while trying to find ways around Visual Studio to develop .NET applications.

As I understand it, Omnisharp is being phased out for a new mechanism called the LSP. It sounds like this new mechanism will not be open source, but will expose enough functionality to still be able to do the things we have been able to do so far in Omnisharp, and perhaps more. I wonder if my understanding is correct?

I guess people are ticked off because it won't be open source, but if it exposes enough functionality doesn't that make it good enough for creating a solid workflow outside of Visual Studio?

@seesharper
Copy link
Collaborator

I have not fully understood this myself. Although Microsoft is developing their own closed source LSP-based host to provide language services, there is still people from Microsoft working with OmniSharp-Roslyn which we now need to opt in to use.
There is also an effort to bring LSP to Omnisharp through this project https://github.com/OmniSharp/csharp-language-server-protocol. This is also mostly driven by Joey Robichaud which is employed at Microsoft.
So to me it seems that maybe they are keeping Omnisharp alive just in case this new thing goes south. I don't know 😃

@amis92
Copy link

amis92 commented Oct 25, 2023

It's supposedly on their table, let's see if they can get the integration in. I was interested as well and found the issue on their open-source repo for that: dotnet/vscode-csharp#5722

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants