C# Intellisense doesn't suggest anything unless namespace explicitly used
See original GitHub issueProblem is Intellisense doesn’t suggest anything unless it is included in the script with using keyword.
using RAPID.SerializationContracts;
namespace RAPID
{
class Program
{
static void Main(string[] args)
{
XMLFactory // <-- Intellisense suggests XMLFactoryContract
}
}
}
namespace RAPID
{
class Program
{
static void Main(string[] args)
{
XMLFactory // <-- Intellisense has no suggestions despite the fact the files in the same project, just different namespaces.
}
}
}
Environment data
dotnet --info
output:
.NET Core SDK (reflecting any global.json):
Version: 2.1.700
Commit: c2ef055a0f
Runtime Environment: OS Name: Windows OS Version: 10.0.17763 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.700\
Host (useful for support): Version: 3.1.3 Commit: 4a9f85e9f8
.NET Core SDKs installed: 2.1.700 [C:\Program Files\dotnet\sdk] 3.0.101 [C:\Program Files\dotnet\sdk] 3.1.201 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
VS Code version: latest C# Extension version: 1.21.17
Steps to reproduce
Unsure how. It just happened one day 🤔 🤔 Closest event was installation .NET Core 3.1 However, opening a project in Visual Studio doesn’t fix the issue. So might be something wrong on my end 🤔
Expected behaviour
Actual behavior
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
this has already shipped in OmniSharp - we forgot to close the issue here.
You can read more here https://www.strathweb.com/2020/09/support-for-unimported-types-in-omnisharp-and-c-extension-for-vs-code/
TL;DR - you need to set
"omnisharp.enableImportCompletion": true
as the feature is not switched on by default.Awesome, thank you @filipw !