vscode-csharp: Quick Fix (Ctrl + . ) Issue - Doesn't show required namespaces

Environment data

.NET Command Line Tools (2.0.0)

Product Information:
Version:            2.0.0
Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     Windows
 OS Version:  6.1.7601
 OS Platform: Windows
 RID:         win7-x64

Base Path:   C:\Program Files\dotnet\sdk\2.0.0\
Microsoft .NET Core Shared Framework Host
Version  : 2.0.0
Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

VS Code version: 1.9.1 C# Extension version: 1.7.0

Steps to reproduce

Install NET Core SDK 2.0 Create angular project using dotnet core cli ( dotnet new angular ) Open project in Visual Studio Code 1.9.1 Install C# and C# extensions Start Omni sharp if not already started

C# Intelligence works in Visual Studio Code. Quck Fix (Ctrl + .) doesn’t work, It doesn’t show required namespaces after hitting (Ctrl + .)

Expected behavior

Quck Fix (Ctrl + .) should show required/missing namespaces after hitting (Ctrl + .) For ex.

public ICollection<Project> Projects { get; set; }

When cursor is on ICollection keyword, if you will press Ctrl + .
Quick Fix should show “using System.Collections”

Actual behavior

After hitting (Ctrl + .), Quck Fix doesn’t show required namespace suggestion. Build is successful. OmniSharp is also running fine. C# Intelligence is working fine. No error in problem pane

Note

I am behind the proxy.

OmniSharp Output

Starting OmniSharp server at 9/21/2017, 1:32:56 PM
    Target: d:\Development_Avecto\OneR\OneR.sln

OmniSharp server started
    Path: C:\Users\379212\.vscode\extensions\ms-vscode.csharp-1.7.0\bin\omnisharp\OmniSharp.exe
    PID: 7428

OmniSharp: -s d:\Development_Avecto\OneR\OneR.sln --hostPID 7228 --stdio DotNet:enablePackageRestore=false --encoding utf-8 --loglevel information formattingOptions:useTabs=false formattingOptions:tabSize=4 formattingOptions:indentationSize=4
[info]: OmniSharp.Startup
        Omnisharp server running using Stdio at location 'd:\Development_Avecto\OneR' on host 7228.
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Initializing in d:\Development_Avecto\OneR
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Resolving projects references
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        MSBUILD_EXE_PATH environment variable set to C:\Users\379212\.vscode\extensions\ms-vscode.csharp-1.7.0\bin\omnisharp\msbuild\MSBuild.exe
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        MSBuildExtensionsPath environment variable set to C:\Users\379212\.vscode\extensions\ms-vscode.csharp-1.7.0\bin\omnisharp\msbuild
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        MSBuildSDKsPath environment variable set to C:\Users\379212\.vscode\extensions\ms-vscode.csharp-1.7.0\bin\omnisharp\msbuild\Sdks
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Detecting projects in 'd:\Development_Avecto\OneR\OneR.sln'.
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project from 'd:\Development_Avecto\OneR\OneR.csproj'.
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Add project: d:\Development_Avecto\OneR\OneR.csproj
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Update project: OneR
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'd:\Development_Avecto\OneR'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Startup
        Configuration finished.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (3 by maintainers)

Most upvoted comments

Update: I have now also tested this on Fedora 28 with .Net Core SDK 2.2.103. Same problem persists, i.e. no suggestions for adding namespaces for missing types.