Editor not updating reference when class file moved to new folder
See original GitHub issueEnvironment data
dotnet --info
output:
.NET Core SDK (reflecting any global.json):
Version: 2.1.402
Commit: 3599f217f4
Runtime Environment: OS Name: Mac OS X OS Version: 10.13 OS Platform: Darwin RID: osx.10.13-x64 Base Path: /usr/local/share/dotnet/sdk/2.1.402/
Host (useful for support): Version: 2.1.4 Commit: 85255dde3e
.NET Core SDKs installed: 1.0.1 [/usr/local/share/dotnet/sdk] 2.1.402 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
VS Code version: Version 1.29.1 (1.29.1) bc24f98b5f70467bc689abf41cc5550ca637088e
C# Extension version: 1.17.1
MacOS 10.13.6 (17G3025)
Steps to reproduce
See also animated GIF below
- dotnet new console
- Open VS Code
- Create root-level folders “Tests” and “Payroll”
- Move Program.cs to Tests folder
- Update Program.cs namespace to new folder
- Create declaration and instantiation to a variable of a new type
- Use CMD-. fix to generate new class in new file
- Move newly created file to Payroll folder
- Update namespace in new file
- Add using statement in Program.cs to reference Payroll namespace
- Save all files
- Hover over declaration statement in Program.cs. Note type can’t be found and is referred to as being in Tests namespace
Expected behavior
New type should be found in correct namespace
Actual behavior
New type is not found in correct namespace
Other info
Restarting OmniSharp via command palate corrects issue Related to Issue 2040?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
@delroh You can use the “Restart OmniSharp” command instead of restarting Code
@jimholmes I believe a simple version of this bug is:
dotnet new console
Program.cs
into the new directoryAddressing this with https://github.com/OmniSharp/omnisharp-roslyn/pull/1368