dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.86k stars 672 forks source link

Doesn't do anything at all #5293

Open ygoe opened 2 years ago

ygoe commented 2 years ago

Issue Description

This extension doesn't do anything at all. That's all I can see. This extension advertises to understand C# and provide all sorts of features known from Visual Studio. And then it does zero, absolutely nothing at all. As if it didn't exist. A complete failure.

I get C# syntax highlighting, but that is still there after uninstalling the extension, so it's not related.

I understand that there is limited or initially disabled support for Desktop CLR and .NET Framework projects. I have a .NET Core project here, a simple class library. Should be easy. But apparently that was already too much.

Steps to Reproduce

  1. Install the extension, either 1.25.0 or 1.24.4
  2. Open a C# .NET Core 3.1 project and a C# file of a class library project
  3. Click on a symbol
  4. Hover a symbol or namespace
  5. Click on a symbol reference and press F12 to go to the definition
  6. Use command "inspect editor tokens and scopes" to get details about the symtax elements

Expected Behavior

  1. Highlights other occurrences of that symbol
  2. Tooltip gives information about the symbol
  3. Editor navigates to definition
  4. Large tooltip with syntax details appears

Actual Behavior

  1. Nothing is highlighted, not even when selecting text
  2. Tooltip says "Loading..." forever
  3. Little info says "Can't find the definition"
  4. "Loading..."

Logs

OmniSharp log

Starting OmniSharp server at 28.6.2022, 22:17:14 Target: c:\Source\Path1\MySolution\MySolution.sln OmniSharp server started. Path: c:\Users\Yves\.vscode\extensions\ms-dotnettools.csharp-1.24.4-win32-x64\.omnisharp\1.38.2\OmniSharp.exe PID: 77732 [info]: OmniSharp.Stdio.Host Starting OmniSharp on Windows 6.2.9200.0 (x64) [info]: OmniSharp.Services.DotNetCliService Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK [info]: OmniSharp.Services.DotNetCliService Using the 'dotnet' on the PATH. [info]: OmniSharp.Services.DotNetCliService DotNetPath set to dotnet [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Located 2 MSBuild instance(s) 1: Visual Studio Community 2022 17.2.32602.215 17.2.1 - "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin" 2: StandAlone 17.1.1 - "c:\Users\Yves\.vscode\extensions\ms-dotnettools.csharp-1.24.4-win32-x64\.omnisharp\1.38.2\.msbuild\Current\Bin" [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: Visual Studio Community 2022 17.2.32602.215 17.2.1 - "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin" [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0 [info]: OmniSharp.Cake.CakeProjectSystem Detecting Cake files in 'c:\Source\Path1\MySolution'. [info]: OmniSharp.Cake.CakeProjectSystem Did not find any Cake files [info]: OmniSharp.MSBuild.ProjectSystem Detecting projects in 'c:\Source\Path1\MySolution\MySolution.sln'. [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'c:\Source\Path1\MySolution\MySolution\MySolution.csproj' [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'c:\Source\Path1\MySolution\DemoServer\DemoServer.csproj' [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'c:\Source\Path1\MySolution\DemoClient\DemoClient.csproj' [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'c:\Source\Path1\MySolution\MySolution.Tests\MySolution.Tests.csproj' [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'c:\Source\Path1\MySolution\RmpShell\RmpShell.csproj' [info]: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in 'c:\Source\Path1\MySolution'. [info]: OmniSharp.Script.ScriptProjectSystem Did not find any CSX files [info]: OmniSharp.WorkspaceInitializer Configuration finished. [info]: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location 'c:\Source\Path1\MySolution' on host 86336. [info]: OmniSharp.MSBuild.ProjectManager Loading project: c:\Source\Path1\MySolution\MySolution\MySolution.csproj [warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService No document found. File: c:\Source\Path1\MySolution\MySolution\Router.cs. [warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService No document found. File: c:\Source\Path1\MySolution\MySolution\Router.cs. [warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService No document found. File: c:\Source\Path1\MySolution\MySolution\Router.cs. [warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService No document found. File: c:\Source\Path1\MySolution\MySolution\Router.cs. [warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService No document found. File: c:\Source\Path1\MySolution\MySolution\Router.cs. [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file 'c:\Source\Path1\MySolution\MySolution\MySolution.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Adding project 'c:\Source\Path1\MySolution\MySolution\MySolution.csproj' [info]: OmniSharp.MSBuild.ProjectManager Loading project: c:\Source\Path1\MySolution\DemoServer\DemoServer.csproj [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file 'c:\Source\Path1\MySolution\DemoServer\DemoServer.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Adding project 'c:\Source\Path1\MySolution\DemoServer\DemoServer.csproj' [info]: OmniSharp.MSBuild.ProjectManager Loading project: c:\Source\Path1\MySolution\DemoClient\DemoClient.csproj [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file 'c:\Source\Path1\MySolution\DemoClient\DemoClient.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Adding project 'c:\Source\Path1\MySolution\DemoClient\DemoClient.csproj' [info]: OmniSharp.MSBuild.ProjectManager Loading project: c:\Source\Path1\MySolution\MySolution.Tests\MySolution.Tests.csproj [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file 'c:\Source\Path1\MySolution\MySolution.Tests\MySolution.Tests.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Adding project 'c:\Source\Path1\MySolution\MySolution.Tests\MySolution.Tests.csproj' [info]: OmniSharp.MSBuild.ProjectManager Loading project: c:\Source\Path1\MySolution\RmpShell\RmpShell.csproj

C# log

(empty)

Environment information

VSCode version: 1.68.1 C# Extension: 1.24.4 or 1.25.0

Dotnet Information .NET SDK (gem�� "global.json"): Version: 6.0.301 Commit: 43f9b18481 Laufzeitumgebung: OS Name: Windows OS Version: 10.0.19044 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.301\ Host (useful for support): Version: 6.0.6 Commit: 7cca709db2 .NET SDKs installed: 7.0.301 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |better-pageup-pagedown|russelldavis|0.0.1| |cmake|twxs|0.0.17| |cmake-language-support-vscode|josetr|0.0.4| |cmake-tools|ms-vscode|1.11.26| |cpptools|ms-vscode|1.10.7| |csharp|ms-dotnettools|1.24.4| |esp-idf-extension|espressif|1.4.0| |jinjahtml|samuelcolvin|0.17.0| |jupyter|ms-toolsai|2022.5.1001601848| |jupyter-keymap|ms-toolsai|1.0.0| |jupyter-renderers|ms-toolsai|1.0.8| |python|ms-python|2022.8.0| |remote-containers|ms-vscode-remote|0.238.2| |remote-ssh|ms-vscode-remote|0.82.1| |remote-ssh-edit|ms-vscode-remote|0.80.0| |remote-wsl|ms-vscode-remote|0.66.3| |vscode-dotnet-runtime|ms-dotnettools|1.5.0| |vscode-language-pack-de|MS-CEINTL|1.68.6150931| |vscode-pylance|ms-python|2022.6.30| |vscode-remote-extensionpack|ms-vscode-remote|0.21.0| |vscode-todo-highlight|jgclark|2.0.4|;
JoeRobich commented 2 years ago

@ygoe Sorry you are running into issues with you solution.

To give us additional information to troubleshoot with, could you install the 1.25.0 version of the extension and set omnisharp.loglevel to trace in your vs code settings? It would be helpful to get the OmniSharp log from the VS Code Output pane with that configuration.

Also, it might be helpful to try against a new .NET Core 3.1 Console application project to get a baseline.

ygoe commented 2 years ago

I see. Reinstalled the current version and set the log level. Now I've created a new console app with dotnet new console and opened that directory. Should be .NET 6 I guess (I have VS 2022 installed). There I get the expected tooltip infos. But that project isn't really big, just one single line of code. Minimal API and so. Going to look for something a little more demanding.

ygoe commented 2 years ago

Doesn't seem to help. While very simple almost empty projects can be analysed, anything existing of a little more size fails. The log doesn't contain anything more detailed:

Starting OmniSharp server at 29.6.2022, 12:11:21
    Target: c:\Source\MyProject\MyProject.sln

OmniSharp server started with .NET 6.0.301
.
    Path: c:\Users\Yves\.vscode\extensions\ms-dotnettools.csharp-1.25.0-win32-x64\.omnisharp\1.39.0-net6.0\OmniSharp.dll
    PID: 93032

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 10.0.19044.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
[info]: OmniSharp.Services.DotNetCliService
        Using the 'dotnet' on the PATH.
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: .NET Core SDK 6.0.301 17.2.0 - "C:\Program Files\dotnet\sdk\6.0.301\"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: .NET Core SDK 6.0.301 17.2.0 - "C:\Program Files\dotnet\sdk\6.0.301\"
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in 'c:\Source\MyProject\MyProject.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\Source\MyProject\MyProject\MyProject.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\Source\MyProject\DemoServer\DemoServer.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\Source\MyProject\DemoClient\DemoClient.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\Source\MyProject\MyProject.Tests\MyProject.Tests.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\Source\MyProject\RmpShell\RmpShell.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'c:\Source\MyProject'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Did not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location 'c:\Source\MyProject' on host 15068.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\Source\MyProject\MyProject\MyProject.csproj
JoeRobich commented 2 years ago

@ygoe Thanks for trying the new project. That at least lets us know that in the best of circumstances the extension is working in your environment.

Is your project something that you can share with us, or can you give us steps to create a project that fails to load?

ygoe commented 2 years ago

It's not a public project but I could send it to you for private inspection. It'll take longer if I try to reduce it to what's breaking the extension.

astrohart commented 2 years ago

Me too. I installed the C# extension, version v1.25.0 and it says Powered by OmniSharp but I cannot find an OmniSharp instance anywhere on my computer.