dotnet-script: Intellisense not working for inline dependencies
Hi, I’ve been reloading visual studio code many times, I’m trying to do as in the doc (https://github.com/filipw/dotnet-script#nuget-packages) but intellisense would not work with the following piece of code :
#! "netcoreapp2.0"
#r "nuget: Newtonsoft.Json,11.0.1"
#load "simpleHttpRequest.csx"
using System.Linq;
using Newtonsoft.Json.Linq;
The script works at runtime but in Visual Studio code I have Newtonsoft underlined in red, and no intellisense. (the same as for all JObject uses etc.)
VS Code 1.20.1 ms-vscode.csharp : 1.14.0 dotnet.script : 0.18.0
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 58 (14 by maintainers)
There are few caveats:
Run
dotnet script initit generates omnisharp.json which adds optiononly with this option omnisharp can recognize nugets referenced by
#r "nuget: ..."Everytime you add new
#ryou have to restart omnisharp because it doesn’t automatically catch them.@filipw , @SlowLogicBoy , @vincentlabatut
Just wanted to take the opportunity to thank you all for taking the time to debug and investigate this. It would have been extremely difficult to hunt this one down without the information you’ve provided.
That being said, I’ve put together a “WorkOnMyMachine” build of OmniSharp if you are eager to test this immediately.
https://github.com/seesharper/omnisharp-roslyn/releases/download/v1.27.2/Omnisharp.zip
The zip ONLY contains the Omnisharp binaries and not the runtime such as Mono for running on Mac.
The easiest way to test this is simply to extract the files directly into the extensions folder for Vs Code. On the Mac it should be something like
.vscode/extensions/ms-vscode.csharp-1.14.0/.omnisharp/omnisharp/On Windows it’s
%USERPROFILE%\.vscode\extensions\ms-vscode.csharp-1.14.0\.omnisharpThe road ahead now is first to create a new
dotnet-scriptrelease and then we PR Omnisharp with the new package reference.This might be it https://github.com/OmniSharp/omnisharp-roslyn/blob/4936624c58cab44c9b299d0b8e8f6c3bd7bc6941/src/OmniSharp.Abstractions/Services/DotNetCliService.cs#L38