-
Notifications
You must be signed in to change notification settings - Fork 687
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
Automatic Namespace Imports no longer function #6051
Comments
This makes v2+ unusable for me. Reverting back to v1.26.0 also worked for me. |
Ran into this on both 2.0.x Release versions. Rolled back to Prelease If I had to take a guess, might be related to this change: dotnet/roslyn#69265 |
How do you switch back to prerelease 2.0.312? I agree, I've been on 2.x for a while but I don't recall imports being broken until recently so you're probably right but I don't have the option to switch to pre-release on the C# extension (Only the C# Dev Kit). Edit: |
It should be in |
@genlu Thanks :) |
Type: Bug
Issue Description
After updating to 2.0.328, code-completion's automatic insertion of
using
namespaces no longer functions correctly. While the new subsystem does autocomplete symbols from namespaces that haven't been imported yet, it no longer automatically adds the imports to the top of the file, as 1.x was able to do when the "Enable Import Completion" option was enabled.Reverting back to the Omnisharp language server does not help either, as the "Enable Import Completion" option appears to have been removed.
Rolling back the extension to 1.26.0 and re-enabling "Omnisharp: Enable Import completion" does resolve the issue.
Steps to Reproduce
Expected Behavior
Selecting a typeahead suggestion that includes a namespace that has not yet been imported should automatically add the import to the top of the file.
If this is not a valid default behavior, then an option similar to "Enable Import completion" from 1.x should be reintroduced, perhaps named "Automatically add imports on symbol completion" or something.
Actual Behavior
Selecting a symbol from a namespace that has not yet been imported, simply inserts the symbol into the document, but does not up date the imports
Logs
C# log
C# LSP Trace Logs
Environment information
VSCode version: 1.81.0
C# Extension: 2.0.328
Using OmniSharp: false
Dotnet Information
Host:
Version: 7.0.9
Architecture: x64
Commit: 8e9a17b221
.NET SDKs installed:
No SDKs were found.
.NET runtimes installed:
Microsoft.NETCore.App 7.0.9 [c:\Users\ruiba\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime.dotnet\7.0.9\shared\Microsoft.NETCore.App]
Other architectures found:
arm64 [C:\Program Files\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation]
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 version: 2.0.328
VS Code version: Code 1.81.0 (6445d93c81ebe42c4cbd7a60712e0b17d9463e97, 2023-08-02T12:37:13.485Z)
OS version: Windows_NT x64 10.0.22621
Modes:
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: