dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.88k stars 676 forks source link

VS Code Intellisense reports unknown data type after rename operation #4298

Open webJose opened 3 years ago

webJose commented 3 years ago

Issue Description

Steps to Reproduce

  1. Create an enum in its own .cs file. Name it TheEnum.
  2. In a separate .cs file, declare a class and in it, declare a property of type TheEnum.
  3. Save all files.
  4. Go to the class, locate the property declaration and rename TheEnum to something else. Yes, rename from its usage, not its definition.
  5. Renaming seems to work flawlessly, but now Intellisense says the new name you gave to the enum is not known.

    Expected Behavior

After the enum is renamed, Intellisense should recognize the new name.

Actual Behavior

After renaming, Intellisense does not recognize the new name.

Logs

OmniSharp log

Post the output from Output-->OmniSharp log here

C# log

Starting OmniSharp server at 12/13/2020, 2:46:55 AM Target: c:\Users\webJo\source\repos\streiffmkt.api OmniSharp server started. Path: c:\Users\webJo\.vscode\extensions\ms-dotnettools.csharp-1.23.7\.omnisharp\1.37.4\OmniSharp.exe PID: 23536 [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 4 MSBuild instance(s) 1: Visual Studio Enterprise 2017 15.9.28307.586 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin" 2: Visual Studio Build Tools 2017 15.9.28307.1000 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin" 3: Visual Studio Community 2019 16.6.30225.117 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin" 4: StandAlone 16.8.0 - "c:\Users\webJo\.vscode\extensions\ms-dotnettools.csharp-1.23.7\.omnisharp\1.37.4\.msbuild\Current\Bin" [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: Visual Studio Community 2019 16.6.30225.117 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin" [info]: OmniSharp.Cake.CakeProjectSystem Detecting Cake files in 'c:\Users\webJo\source\repos\streiffmkt.api'. [info]: OmniSharp.Cake.CakeProjectSystem Could not find any Cake files [info]: OmniSharp.MSBuild.ProjectSystem No solution files found in 'c:\Users\webJo\source\repos\streiffmkt.api' [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'c:\Users\webJo\source\repos\streiffmkt.api\src\StreiffMkt.Api.csproj' [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'c:\Users\webJo\source\repos\streiffmkt.api\Tests\StreiffMkt.Api.Tests\StreiffMkt.Api.Tests.csproj' [info]: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in 'c:\Users\webJo\source\repos\streiffmkt.api'. [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.MSBuild.ProjectManager Loading project: c:\Users\webJo\source\repos\streiffmkt.api\src\StreiffMkt.Api.csproj [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\webJo\source\repos\streiffmkt.api' on host 21980. [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file 'c:\Users\webJo\source\repos\streiffmkt.api\src\StreiffMkt.Api.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Adding project 'c:\Users\webJo\source\repos\streiffmkt.api\src\StreiffMkt.Api.csproj' [info]: OmniSharp.MSBuild.ProjectManager Loading project: c:\Users\webJo\source\repos\streiffmkt.api\Tests\StreiffMkt.Api.Tests\StreiffMkt.Api.Tests.csproj [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file 'c:\Users\webJo\source\repos\streiffmkt.api\Tests\StreiffMkt.Api.Tests\StreiffMkt.Api.Tests.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Adding project 'c:\Users\webJo\source\repos\streiffmkt.api\Tests\StreiffMkt.Api.Tests\StreiffMkt.Api.Tests.csproj' [info]: OmniSharp.MSBuild.ProjectManager Update project: StreiffMkt.Api [info]: OmniSharp.MSBuild.ProjectManager Update project: StreiffMkt.Api.Tests [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: using System; [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: using System.Collections.Generic; [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Wrap every parameter -> Align wrapped parameters [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Wrap every parameter -> Indent all parameters [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Unwrap parameter list -> Unwrap and indent all parameters [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Wrap long parameter list -> Align wrapped parameters [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Wrap long parameter list -> Indent all parameters [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Wrap long parameter list -> Indent all parameters [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Wrap long parameter list -> Indent wrapped parameters [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Wrap every parameter -> Indent all parameters [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Wrap long parameter list -> Indent wrapped parameters [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Wrap every parameter -> Indent all parameters [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Remove Unnecessary Usings [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Generate constructor 'MethodTracer(scopeName, logger, scopeNameProperty, traceLevel, extraProps)' [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Wrap every parameter -> Indent all parameters [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: using System.Collections.Generic; [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: using System.Collections.Generic; [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: using StreiffMkt.Api.Logging; [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'c:\Users\webJo\source\repos\streiffmkt.api\src\StreiffMkt.Api.csproj' [info]: OmniSharp.MSBuild.ProjectManager Loading project: c:\Users\webJo\source\repos\streiffmkt.api\src\StreiffMkt.Api.csproj [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file 'c:\Users\webJo\source\repos\streiffmkt.api\src\StreiffMkt.Api.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Update project: StreiffMkt.Api [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'c:\Users\webJo\source\repos\streiffmkt.api\src\StreiffMkt.Api.csproj' [info]: OmniSharp.MSBuild.ProjectManager Loading project: c:\Users\webJo\source\repos\streiffmkt.api\src\StreiffMkt.Api.csproj [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file 'c:\Users\webJo\source\repos\streiffmkt.api\src\StreiffMkt.Api.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Update project: StreiffMkt.Api [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: using StreiffMkt.Api.Logging; [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Remove Unnecessary Usings [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'c:\Users\webJo\source\repos\streiffmkt.api\Tests\StreiffMkt.Api.Tests\StreiffMkt.Api.Tests.csproj' [info]: OmniSharp.MSBuild.ProjectManager Loading project: c:\Users\webJo\source\repos\streiffmkt.api\Tests\StreiffMkt.Api.Tests\StreiffMkt.Api.Tests.csproj [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file 'c:\Users\webJo\source\repos\streiffmkt.api\Tests\StreiffMkt.Api.Tests\StreiffMkt.Api.Tests.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Update project: StreiffMkt.Api.Tests [info]: OmniSharp.OmniSharpWorkspace Miscellaneous file: c:\Users\webJo\source\repos\streiffmkt.api\src\obj\Debug\netcoreapp3.1\StreiffMkt.Api.MvcApplicationPartsAssemblyInfo.cs added to workspace [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Remove Unnecessary Usings [info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService Applying code action: Remove Unnecessary Usings

Environment information

VSCode version: 1.51.1 C# Extension: 1.23.7

Dotnet Information .NET Core SDK (reflecting any global.json): Version: 3.1.301 Commit: 7feb845744 Runtime Environment: OS Name: Windows OS Version: 10.0.18363 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.301\ Host (useful for support): Version: 3.1.5 Commit: 65cd789777 .NET Core SDKs installed: 2.1.201 [C:\Program Files\dotnet\sdk] 2.1.202 [C:\Program Files\dotnet\sdk] 2.1.502 [C:\Program Files\dotnet\sdk] 2.1.503 [C:\Program Files\dotnet\sdk] 2.1.505 [C:\Program Files\dotnet\sdk] 3.1.301 [C:\Program Files\dotnet\sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |atlascode|atlassian|2.8.5| |cpptools|ms-vscode|1.1.3| |csharp|ms-dotnettools|1.23.7| |debugger-for-chrome|msjsdiag|4.12.11| |docomment|k--kato|0.1.19| |git-easy|bibhasdn|1.11.0| |git-graph|mhutchie|1.28.0| |gitlens|eamodio|11.0.6| |hexeditor|ms-vscode|1.3.0| |remote-wsl|ms-vscode-remote|0.51.4| |vscode-drawio|hediet|1.2.0| |vscode-eslint|dbaeumer|2.1.13| |vscode-language-pack-es|MS-CEINTL|1.51.2| |vscode-markdownlint|DavidAnson|0.38.0| |vscode-yaml|redhat|0.13.0|;
webJose commented 1 year ago

Hi. Any updates on this one? To this date, it still happens. Also, which might be related: Renaming a file that contains a class makes Intellisense thinks there are two declarations of the class, and you start getting a bunch of errors regarding ambiguity.