Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F# IntelliSense is completely broken in specific project (DocFX) #4446

Closed
vsfeedback opened this issue Mar 6, 2018 · 5 comments
Closed

F# IntelliSense is completely broken in specific project (DocFX) #4446

vsfeedback opened this issue Mar 6, 2018 · 5 comments
Labels
Area-LangService-API Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone

Comments

@vsfeedback
Copy link

Steps to reproduce:

  1. git clone --branch fsharp_extract https://github.com/surban/docfx.git

  2. Open All.sln within the cloned repository with VIsual Studio 2017 (15.5 or 15.6 preview).

  3. Build the solution with the default settings. It should restore NuGet packages and build without issues.

  4. Open the file "FSharpCompilation.fs" within the project "Microsoft.DocAsCode.Metadata.ManagedReference.FSharp" using the solution explorer.

Expected result:
IntelliSense and functions like "Go to Definition" are working.

Actual result:
IntelliSense does not work at all and "Go to Definition" on any symbol results in the message "Cannot navigate to the symbol under the caret.".

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/200003/f-intellisense-is-completely-broken-in-specific-pr.html
VSTS ticketId: 569025

These are the original issue comments:
(no comments)
These are the original issue solutions:
(no solutions)

@dsyme dsyme added Bug Area-LangService-API Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. labels Mar 10, 2018
@cartermp
Copy link
Contributor

It looks like the language service is not initialized for this project. Nor does ordering work in the project system.

The authoring of the project is a bit odd, with a shared props file doing something I'm unfamiliar with:

<Compile Condition="Exists($(VersionFSFile)) And '$(MSBuildProjectExtension)' == '.fsproj'" Include="$(VersionFSFile)" />

Additionally, running build.cmd caused some tests to fail and I get the following when opening the solution VS:

Error occurred while restoring NuGet packages: The operation failed as details for project Microsoft.DocAsCode.Build.MemberLevelManagedReference could not be loaded.

The project in question doesn't reference this, but it's still odd.

@KevinRansom @TIHan any ideas?

@surban
Copy link
Contributor

surban commented Mar 12, 2018

<Compile Condition="Exists($(VersionFSFile)) And '$(MSBuildProjectExtension)' == '.fsproj'" Include="$(VersionFSFile)" />
This is used to include an autogenerated file that sets the assembly version, company, etc. This file is only generated for Release builds and thus should not affect IntelliSense in Visual Studio.

build.cmd also produces some unit test errors on my machine, but this should not affect IntelliSense as it is done after building the All.sln solution.

@bchavez
Copy link

bchavez commented Mar 16, 2018

Last few Visual Studio versions I've been getting the same error in F#:

devenv_1289

Previously, I use to be able to walk up to any third-party F# method and "Go To Definition" and get some kind of decompiled F# list of methods like functionName(unit -> int stuff) list and browse around other neighboring F# methods that helped API discovery.

I did this with my F# FAKE scripts, now I get this crazy error box. 😢 "Go To Definition" works as long as your "going to" methods defined inside your project. 😢

@bchavez
Copy link

bchavez commented Oct 10, 2018

LOL.

Some 6 months later, I finally found what was causing "Cannot navigate to the symbol under the caret." error. See: #4016

Basically, if you have forward slashes in your F# FAKE scripts:

#load "./.fake/build.fsx/intellisense.fsx"

You'll get this error. Change the #load path to contain backslashes:

#load ".\\.fake\\build.fsx\\intellisense.fsx"

and now F12 (Go to Definition) works!!!!!!!

This caret 🥕 error was driving me absolutely insane.

@cartermp cartermp modified the milestones: 16.0, 16.1 Feb 21, 2019
@cartermp cartermp modified the milestones: 16.1, 16.2 Apr 23, 2019
@cartermp cartermp modified the milestones: 16.2, Backlog Apr 30, 2019
@cartermp cartermp modified the milestones: Backlog, 16.3 Aug 9, 2019
@cartermp
Copy link
Contributor

cartermp commented Aug 9, 2019

Fixed by #7376

@cartermp cartermp closed this as completed Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-LangService-API Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
None yet
Development

No branches or pull requests

5 participants