Ionide-vscode-fsharp: Intellisense not working with VS Code and .NET Core

Created on 20 Mar 2017  路  11Comments  路  Source: ionide/ionide-vscode-fsharp

I can't seem to get ionide to work on Windows with VS Code and .NET Core.
I have the newest .NET Core SDK, VS Code and ionide.

The application in question is a plain dotnet new console -lang F#. I am able to run and debug it with VS Code, but I get no linting/intellisense.

Log from the F# Language Service output window:

[12:25:07 INFO ] REQ (001) -> {project}, File = "~\asd.fsproj"
Data={"FileName":"c:\\Projects\\asd\\asd.fsproj"}
[12:25:07 DEBUG] RES (001) <- {project} in 454 ms: Kind={"error"}
Data="errors"
[12:25:07 INFO ] REQ (002) -> {parse}, File = "~\Program.fs"
Data={"FileName":"c:\\Projects\\asd\\Program.fs","IsAsync":true,"Lines":["// Learn more about F# at http://fsharp.org","","open System","","[<EntryPoint>]","let main argv =","    printfn \"Hello World from F#!\"","    0 // return an integer exit code",""],"Version":1}
[12:25:08 DEBUG] RES (002) <- {parse} in 811 ms: Kind={"info"}
Data="Parse aborted"
[12:25:08 INFO ] REQ (003) -> {lint}, File = "~\Program.fs"
Data={"FileName":"c:\\Projects\\asd\\Program.fs"}
[12:25:08 INFO ] REQ (004) -> {project}, File = "~\asd.fsproj"
Data={"FileName":"c:\\Projects\\asd\\asd.fsproj"}
[12:25:08 DEBUG] RES (003) <- {lint} in 13 ms: Kind={"info"}
Data="Cached typecheck results not yet available"
[12:25:08 DEBUG] RES (004) <- {project} in 132 ms: Kind={"error"}
Data="errors"
[12:25:08 INFO ] REQ (005) -> {declarations}, File = "~\Program.fs"
Data={"FileName":"c:\\Projects\\asd\\Program.fs","Version":1}
[12:25:21 INFO ] REQ (006) -> {project}, File = "~\asd.fsproj"
Data={"FileName":"c:\\Projects\\asd\\asd.fsproj"}
[12:25:21 INFO ] REQ (007) -> {lint}, File = "~\Program.fs"
Data={"FileName":"c:\\Projects\\asd\\Program.fs"}
[12:25:21 DEBUG] RES (007) <- {lint} in 3 ms: Kind={"info"}
Data="Cached typecheck results not yet available"
[12:25:21 DEBUG] RES (006) <- {project} in 136 ms: Kind={"error"}
Data="errors"
[12:25:21 INFO ] REQ (008) -> {parse}, File = "~\Program.fs"
Data={"FileName":"c:\\Projects\\asd\\Program.fs","IsAsync":true,"Lines":["// Learn more about F# at http://fsharp.org","","open System","","[<EntryPoint>]","let main argv =","    printfn \"Hello World from F#!\"","    0 // return an integer exit code",""],"Version":1}
[12:25:21 DEBUG] RES (008) <- {parse} in 39 ms: Kind={"info"}
Data="Parse aborted"
[12:25:22 INFO ] REQ (009) -> {project}, File = "~\asd.fsproj"
Data={"FileName":"c:\\Projects\\asd\\asd.fsproj"}
[12:25:22 INFO ] REQ (010) -> {lint}, File = "~\Program.fs"
Data={"FileName":"c:\\Projects\\asd\\Program.fs"}
[12:25:22 DEBUG] RES (010) <- {lint} in 4 ms: Kind={"info"}
Data="Cached typecheck results not yet available"
[12:25:22 DEBUG] RES (009) <- {project} in 199 ms: Kind={"error"}
Data="errors"
[12:25:22 INFO ] REQ (011) -> {parse}, File = "~\Program.fs"
Data={"FileName":"c:\\Projects\\asd\\Program.fs","IsAsync":true,"Lines":["// Learn more about F# at http://fsharp.org","","open System","","[<EntryPoint>]","let main argv =","    printfn \"Hello World from F#!\"","    0 // return an integer exit code",""],"Version":1}
[12:25:22 DEBUG] RES (011) <- {parse} in 36 ms: Kind={"info"}
Data="Parse aborted"

ionide version: 2.25.2
VS Code version: 1.10.2

dotnet --info

.NET Command Line Tools (1.0.1)

Product Information:
 Version:            1.0.1
 Commit SHA-1 hash:  005db40cd1

Runtime Environment:
 OS Name:     Windows
 OS Version:  6.3.9600
 OS Platform: Windows
 RID:         win81-x64
 Base Path:   C:\Program Files\dotnet\sdk\1.0.1

Most helpful comment

i'll check this.

the parse fails:

[12:25:07 INFO ] REQ (001) -> {project}, File = "~\asd.fsproj"
Data={"FileName":"c:\\Projects\\asd\\asd.fsproj"}
[12:25:07 DEBUG] RES (001) <- {project} in 454 ms: Kind={"error"}
Data="errors"

as a note, the useless Data="errors" diagnostic message is mine 馃槃

@severisv i think is something environmental, so i need to write a guide/tool/checklist on how to diagnose more these issues (will be common in the future :D). give me a bit of time.

All 11 comments

CC: @enricosada

i'll check this.

the parse fails:

[12:25:07 INFO ] REQ (001) -> {project}, File = "~\asd.fsproj"
Data={"FileName":"c:\\Projects\\asd\\asd.fsproj"}
[12:25:07 DEBUG] RES (001) <- {project} in 454 ms: Kind={"error"}
Data="errors"

as a note, the useless Data="errors" diagnostic message is mine 馃槃

@severisv i think is something environmental, so i need to write a guide/tool/checklist on how to diagnose more these issues (will be common in the future :D). give me a bit of time.

I've tried setting the suggested environment variable and confirmed in the terminal inside VS Code that it is set, but the problem persists. The errors from the F# Language Service are the same.

@severisv i have a version with better diagnostics (not yet merged, PR https://github.com/ionide/FsAutoComplete/pull/57 ).

fsautocomplete.zip

  • copy as backup the C:\Users\%USERNAME%\.vscode\extensions\Ionide.Ionide-fsharp-2.25.2\bin directory
  • unzip and overwrite the files from zip into C:\Users\%USERNAME%\.vscode\extensions\Ionide.Ionide-fsharp-2.25.2\bin
  • now reopening code . should give a better log message, with the msbuild error like
[23:52:59 DEBUG] RES (001) <- {project} in 664 ms: Kind={"error"}
Data="MSBuild failed with exitCode 1 Working Directory: 'c:\\dev\\op-internal-integration-worker' Exe Path: 'dotnet' Args: 'msbuild c:\\dev\\op-internal-integration-worker\\op-internal-integration-worker.fsproj /p:SkipCompilerExecution=true /p:ProvideCommandLineArgs=true /p:CopyBuildOutputToOutputDirectory=false /t:_Inspect_FscArgs /p:_Inspect_FscArgs_OutFile=C:\\Users\\Per Arneng\\AppData\\Local\\Temp\\tmpA091.tmp /t:_Inspect_GetProjectReferences /p:_Inspect_GetProjectReferences_OutFile=C:\\Users\\Per Arneng\\AppData\\Local\\Temp\\tmpA092.tmp /t:_Inspect_GetProperties /p:_Inspect_GetProperties_OutFile=C:\\Users\\Per Arneng\\AppData\\Local\\Temp\\tmpA093.tmp /nologo /verbosity:quiet'"

please post that, and run from command line as path and args from workiing dir, like dotnet msbuild ...
should help see the real msbuild error

I'm now getting two errors from the F# language service. First one, as you predicted, is this one:

[09:18:54 DEBUG] RES (006) <- {project} in 186 ms: Kind={"error"}
Data="MSBuild failed with exitCode 1 Working Directory: 'c:\\Projects\\happybever' Exe Path: 'dotnet' Args: 'msbuild c:\\Projects\\happybever\\HappyBever.fsproj /p:SkipCompilerExecution=true /p:ProvideCommandLineArgs=true /p:CopyBuildOutputToOutputDirectory=false /t:_Inspect_FscArgs /p:_Inspect_FscArgs_OutFile=C:\\Users\\severin sverdvik\\AppData\\Local\\Temp\\tmpBF50.tmp /t:_Inspect_GetProjectReferences /p:_Inspect_GetProjectReferences_OutFile=C:\\Users\\severin sverdvik\\AppData\\Local\\Temp\\tmpBF51.tmp /t:_Inspect_GetProperties /p:_Inspect_GetProperties_OutFile=C:\\Users\\severin sverdvik\\AppData\\Local\\Temp\\tmpBF52.tmp /nologo /verbosity:quiet'"

Running that:

C:\Projects\happybever>dotnet msbuild c:\\Projects\\happybever\\HappyBever.fsproj /p:SkipCompilerExecution=true /p:ProvideCommandLineArgs=true /p:CopyBuildOutputToOutputDirectory=false /t:_Inspect_FscArgs /p:_Inspect_FscArgs_OutFile=C:
\\Users\\severin sverdvik\\AppData\\Local\\Temp\\tmpB47A.tmp /t:_Inspect_GetProjectReferences /p:_Inspect_GetProjectReferences_OutFile=C:\\Users\\severin sverdvik\\AppData\\Local\\Temp\\tmpB47B.tmp /t:_Inspect_GetProperties /p:_Inspect
_GetProperties_OutFile=C:\\Users\\severin sverdvik\\AppData\\Local\\Temp\\tmpB47C.tmp /nologo /verbosity:quiet
MSBUILD : error MSB1008: Only one project can be specified.
Switch: sverdvik\\AppData\\Local\\Temp\\tmpB47A.tmp

The second error I get from the F# language service is this one:

[09:24:42 DEBUG] RES (023) <- {parseProjects} in 2 ms: Kind={"errors"}
Data={"File":"c:\\Projects\\happybever\\Controllers\\HomeController.fs","Errors":[{"FileName":"startup","StartLine":1,"EndLine":1,"StartColumn":1,"EndColumn":1,"Severity":"Error","Message":"internal error: BuildFrameworkTcImports: no resolution of 'FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Subcategory":"typecheck"},{"FileName":"startup","StartLine":1,"EndLine":1,"StartColumn":1,"EndColumn":1,"Severity":"Error","Message":"Could not resolve this reference. Could not locate the assembly \"FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. (Code=MSB3245)","Subcategory":"parameter"},{"FileName":"startup","StartLine":1,"EndLine":1,"StartColumn":1,"EndColumn":1,"Severity":"Error","Message":"internal error: BuildFrameworkTcImports: no resolution of 'FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Subcategory":"typecheck"},{"FileName":"startup","StartLine":1,"EndLine":1,"StartColumn":1,"EndColumn":1,"Severity":"Error","Message":"Could not resolve this reference. Could not locate the assembly \"FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. (Code=MSB3245)","Subcategory":"parameter"}]}

@severisv ok it's because you have a blank in %USERNAME% (so C:\\Users\\severin sverdvik\ break things).
my bad, i didnt quote stuff correctly, will fix it later.

meanwhile you can workaround, changing the temp directory (just for that code):

close all code (no code process actives), and

cd c:\Projects\happybever\
mkdir temp
set TEMP=%CD%\temp
set TMP=%CD%\temp
code .

now things should work

That works, thanks!

As it will be fixed in F# SDK I'm closing it here.

@severisv the bug should be fixed, can you try latest ionide? 2.25.9

@enricosada I no longer have the Windows 7 installation with a whitespace in the username, but it works for me on my Windows 10 machine :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

isaacabraham picture isaacabraham  路  5Comments

yuhr picture yuhr  路  3Comments

dustinmoris picture dustinmoris  路  3Comments

sergey-tihon picture sergey-tihon  路  6Comments

bruno-cadorette picture bruno-cadorette  路  4Comments