dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.85k stars 667 forks source link

Folding Strategy "auto" doesnt work with extension #4341

Open julikaiba opened 3 years ago

julikaiba commented 3 years ago

Issue Description

Steps to Reproduce

  1. Install C# extension
  2. have Folding Strategy setting set to "auto"
  3. write C# code
  4. (maybe restart VS Code)
  5. fold all and wait a bit
  6. notice that everything unfolds once all Extensions are loaded
  7. (disable the C# extension or change the folding strategy to indentation to see that it works again)

Expected Behavior

Code folding should be possible

Actual Behavior

no folding controls appearing, not possible to fold

Logs

OmniSharp log

Post the output from Output-->OmniSharp log here

C# log

Post the output from Output-->C# here

Environment information

VSCode version: 1.52.1 C# Extension: 1.23.8

Dotnet Information A valid dotnet installation could not be found.
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |auto-close-tag|formulahendry|0.5.10| |auto-rename-tag|formulahendry|0.1.6| |bracketeer|pustelto|1.3.1| |compare-folders|moshfeu|0.20.0| |compareit|in4margaret|0.0.2| |csharp|ms-dotnettools|1.23.8| |highlight-matching-tag|vincaslt|0.10.0| |indent-rainbow|oderwat|7.5.0| |LiveServer|ritwickdey|5.6.1| |partial-diff|ryu1kn|1.4.1| |php-debug|felixfbecker|1.14.5| |powershell|ms-vscode|2020.6.0| |project-manager|alefragnani|12.0.1| |rainbow-brackets|2gua|0.0.6| |todo-tree|Gruntfuggly|0.0.193| |vscode-csharp-snippets|jorgeserrano|1.1.0| |vscode-css-formatter|aeschli|1.0.1| |vscode-intelephense-client|bmewburn|1.6.1| |vscode-todo-highlight|wayou|1.0.4|;
JoeRobich commented 3 years ago

@julikaiba Sorry you are ran into this issue. Can you reopen your VS Code and the folder you were testing with and share the OmniSharp Log from the Output Pane? This will give us some information to troubleshoot your issue with.

julikaiba commented 3 years ago

The OmniSharp Log:

Click to expand! Starting OmniSharp server at 15.1.2021, 08:25:34 Target: c:\Users\name\Desktop\asdf OmniSharp server started. Path: c:\Users\name\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\OmniSharp.exe PID: 10452 [info]: OmniSharp.Stdio.Host Starting OmniSharp on Windows 6.2.9200.0 (x64) [info]: OmniSharp.Services.DotNetCliService DotNetPath set to dotnet [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Located 2 MSBuild instance(s) 1: Visual Studio Community 2017 15.9.28307.1321 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin" 2: StandAlone 16.8.0 - "c:\Users\name\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\.msbuild\Current\Bin" [warn]: OmniSharp.CompositionHostBuilder It looks like you have Visual Studio lower than VS 2019 16.3 installed. Try updating Visual Studio to the most recent release to enable better MSBuild support. [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator MSBUILD_EXE_PATH environment variable set to 'c:\Users\name\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\.msbuild\Current\Bin\MSBuild.exe' [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: StandAlone 16.8.0 - "c:\Users\name\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\.msbuild\Current\Bin" CscToolExe = csc.exe CscToolPath = c:\Users\name\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\.msbuild\Current\Bin\Roslyn MSBuildExtensionsPath = c:\Users\name\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\.msbuild MSBuildToolsPath = c:\Users\name\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\.msbuild\Current\Bin [info]: OmniSharp.Cake.CakeProjectSystem Detecting Cake files in 'c:\Users\name\Desktop\asdf'. [info]: OmniSharp.Cake.CakeProjectSystem Could not find any Cake files [info]: OmniSharp.MSBuild.ProjectSystem No solution files found in 'c:\Users\name\Desktop\asdf' [info]: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in 'c:\Users\name\Desktop\asdf'. [info]: OmniSharp.Script.ScriptProjectSystem Could not find any CSX files [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0 [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0 [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100 [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110 [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140 [info]: OmniSharp.WorkspaceInitializer Configuration finished. [info]: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location 'c:\Users\name\Desktop\asdf' on host 1088.
JoeRobich commented 3 years ago

@julikaiba I see that you aren't working from a project or soluition. Are the code files you are seeing this behavior in saved to disk?

julikaiba commented 3 years ago

Yes it is, I just created a file ending in .cs and work in that (still new to c# so starting small).

JoeRobich commented 3 years ago

@julikaiba Welcome to C#! Starting small is great. I just wanted to be sure I had the scenario correct. =)

julikaiba commented 3 years ago

after further search this might be the same issue as 4065 as code suggestions dont work either.