question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

C# Intellisense doesn't suggest anything unless namespace explicitly used

See original GitHub issue

Problem 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

image

Actual behavior

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
filipwcommented, Oct 26, 2020

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.

0reactions
dshabetiacommented, Oct 26, 2020

Awesome, thank you @filipw !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Visual Studio Autocomplete to list classes outside of ...
Is there a way to get the Visual Studio autocomplete to include the names of classes that are in my solution, but not...
Read more >
Visual Studio IntelliSense Not Working? What To Do.
Workaround #4: Verify Some Specific Visual Studio Configurations. If all of the above didn't work, it's time to verify some configurations in ...
Read more >
IntelliSense in Visual Studio - Microsoft Learn
A list of valid members from a type (or namespace) appears after you type a trigger character (for example, a period ( ....
Read more >
Intellisense autocomplete from all namespaces
You can turn this option on in Tools > Options > Text Editor > C# > Intellisense. If you select a suggested type...
Read more >
VSCode does not recognize Unity Namespaces [Unity Package]
My standard blurb: This may help you with intellisense and possibly other Visual Studio integration problems: Sometimes the fix is as simple as ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found