Skip to content
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

Namespace Renaming on File Does Not Update Usings #6987

Open
nscimerical opened this issue Mar 22, 2024 · 0 comments
Open

Namespace Renaming on File Does Not Update Usings #6987

nscimerical opened this issue Mar 22, 2024 · 0 comments

Comments

@nscimerical
Copy link

Type: Bug

Issue Description

Renaming the namespace of a file does not update using namespaces on other scripts that reference it.

Steps to Reproduce

  1. Create a script called Model.cs and have it in the namespace Sample.Controller. Create another script called Controller.cs and have it in the namespace Sample.Controller too.
  2. Create any arbitrary method in Model.cs and have Controller.cs use it to establish a reference.
  3. Move Model.cs to a new namespace Sample.Model through the F2 rename function.

Expected Behavior

Controller.cs should have a reference to Model.cs namespace in its using statements.

Actual Behavior

Controller.cs does not update its using statements.

Environment information

VSCode version: 1.87.2
C# Extension: 2.23.2
Using OmniSharp: false

Dotnet Information .NET SDK: Version: 8.0.202 Commit: 25674bb2f4 Workload version: 8.0.200-manifests.8cf8de6d

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.202\

.NET workloads installed:
There are no installed workloads to display.

Host:
Version: 8.0.3
Architecture: x64
Commit: 9f4b1f5d66

.NET SDKs installed:
8.0.103 [C:\Program Files\dotnet\sdk]
8.0.202 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.28 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Visual Studio Code Extensions
Extension Author Version Folder Name
colonize vmsynkov 2.2.2 vmsynkov.colonize-2.2.2
csdevkit ms-dotnettools 1.5.6 ms-dotnettools.csdevkit-1.5.6-win32-x64
csharp ms-dotnettools 2.23.2 ms-dotnettools.csharp-2.23.2-win32-x64
git-graph mhutchie 1.30.0 mhutchie.git-graph-1.30.0
material-icon-theme PKief 4.34.0 pkief.material-icon-theme-4.34.0
material-theme zhuangtongfa 3.17.0 zhuangtongfa.material-theme-3.17.0
scope-to-this rhalaly 0.2.1 rhalaly.scope-to-this-0.2.1
shaderlabvscodefree amlovey 1.3.6 amlovey.shaderlabvscodefree-1.3.6
todo-tree Gruntfuggly 0.0.226 gruntfuggly.todo-tree-0.0.226
unity-code-snippets kleber-swf 2.4.0 kleber-swf.unity-code-snippets-2.4.0
vscode-dotnet-runtime ms-dotnettools 2.0.2 ms-dotnettools.vscode-dotnet-runtime-2.0.2
vscodeintellicode-csharp ms-dotnettools 0.1.26 ms-dotnettools.vscodeintellicode-csharp-0.1.26-win32-x64
vstuc visualstudiotoolsforunity 1.0.0 visualstudiotoolsforunity.vstuc-1.0.0

Extension version: 2.23.2
VS Code version: Code 1.87.2 (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:20:17.278Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs AMD Ryzen 7 6800H with Radeon Graphics (16 x 3194)
Memory (System) 15.19GB (1.91GB free)
Process Argv
Screen Reader no
VM 0%
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

1 participant