I am using Visual Studio Code to develop an ASP.NET 5 application on Mac. The issue I am having is that I don't get any IntelliSense support (e.g. available class methods) beyond simple autocomplete for methods and variables names that I previously typed.
The app targets DNX Core 5.0:
"frameworks": {
"dnxcore50": { }
},
And I have CoreCLR 1.0.0-rc1-update1 installed via DNVM:
$dnvm list
Active Version Runtime Architecture OperatingSystem Alias
------ ------- ------- ------------ --------------- -----
- 1.0.0-rc1-update1 coreclr x64 darwin default
I tried the following to resolve the issue, but with no luck:
- Made sure that a project is selected (fire icon in the bottom right corner)
Explicitly turned suggestions in
settings.json
{ "editor.quickSuggestions": true` }
Any suggestions will be much appreciated.
In short, the problem was that, while I had Mono installed on my machine, I didn't have DNX Mono. Installing it via DNVM locally (
dnvm upgrade -r mono
) resolved the issue and now I am having nice IntelliSense support in Visual Studio Code.Now the long story.
Visual Studio Code uses OmniSharp to provide IntelliSense support. OmniSharp is a set of tools that provides C# code analysis services through a Nancy-based web API that runs on your machine (great posts on it here and here).
I didn't not get any IntelliSense because OmniSharp ran with errors which I could have easily caught if I paid more attention to Visual Studio Code Output window (
Cmd+L
L
on Mac). OmniSharp Log (see below) shows that it tried to usednx-mono.1.0.0-rc1-update1
runtime and then threw an exception because it was not there.From what I understand, OmniSharp can't use DNX CoreCLR (because it doesn't support sockets?) and needs DNX Mono to run. There is some discussion on this topic in VS Code GitHub repo here.
Running
dnvm upgrade -r mono
and restarting Visual Studio Code fixed the issue. My DNVM set up now looks like this:Please note that you don't have to use DNX Mono for development in order to get IntelliSense to work. You just need to have it installed.
OmniSharp Log