Giter Site home page Giter Site logo

I'm getting unwanted navigation when holding `Ctrl` and hovering over operators like `&&` or `>`. Not sure if caused by this PR or a bug in VS. about fsharp HOT 5 OPEN

vzarytovskii avatar vzarytovskii commented on June 21, 2024
I'm getting unwanted navigation when holding `Ctrl` and hovering over operators like `&&` or `>`. Not sure if caused by this PR or a bug in VS.

from fsharp.

Comments (5)

vzarytovskii avatar vzarytovskii commented on June 21, 2024 1

Are they clicking while holding Ctrl? If so, this is by design. Ctrl-click navigates you to the thing under the caret.

I believe there is a setting for this in vs if the user doesn't like that behavior.

I believe it's just hovering, @majocha may confirm/deny it.

from fsharp.

majocha avatar majocha commented on June 21, 2024 1

Yes, it's just hover.

More interestingly, if you enable "View > Code Definition Window", the unwanted navigation can happen just with typing.

For example:

Type Console.Out. Move the cursor back with left-arrow, and bam, navigation to metadata.

I suspect the problem is that our code path for external symbols ends up calling NavigateToExternalDeclarationAsync instead of just returning a FSharpNavigableItem array.

VS calls IFSharpGoToDefinitionService.FindDefinitionsAsync -> the symbol is external -> we end up here:

gtd.NavigateToExternalDeclarationAsync(targetSymbolUse, metadataReferences)

from fsharp.

majocha avatar majocha commented on June 21, 2024

Just hovering over external symbol, (not just operators) while holding Ctrl causes VS (Roslyn?) to call IFSharpGoToDefinitionService.FindDefinitionsAsync.

Which in turn calls NavigateToExternalDeclarationAsync:

member _.FindDefinitionsAsync(position) =
cancellableTask {
let gtd = GoToDefinition(metadataAsSource)
let! result = gtd.FindDefinitionAtPosition(initialDoc, position)
match result with
| ValueSome(FSharpGoToDefinitionResult.NavigableItem(navItem), _) -> return ImmutableArray.create navItem
| ValueSome(FSharpGoToDefinitionResult.ExternalAssembly(targetSymbolUse, metadataReferences), _) ->
do!
gtd.NavigateToExternalDeclarationAsync(targetSymbolUse, metadataReferences)
|> CancellableTask.ignore
return ImmutableArray.empty
| _ -> return ImmutableArray.empty
}

Somehow this doesn't happen that often with vsix built from main, but I can repro this in debug mode each time.

from fsharp.

vzarytovskii avatar vzarytovskii commented on June 21, 2024

Yeah, that's definitely either VS or Roslyn. @CyrusNajmabadi is it something you can control?

from fsharp.

CyrusNajmabadi avatar CyrusNajmabadi commented on June 21, 2024

Are they clicking while holding Ctrl? If so, this is by design. Ctrl-click navigates you to the thing under the caret.

I believe there is a setting for this in vs if the user doesn't like that behavior.

from fsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.