Skip to content

Implement mouseover tooltips for keywords#13956

Merged
T-Gro merged 16 commits into
mainfrom
12062-implement-tooltips-for-keywords
Sep 22, 2022
Merged

Implement mouseover tooltips for keywords#13956
T-Gro merged 16 commits into
mainfrom
12062-implement-tooltips-for-keywords

Conversation

@T-Gro

@T-Gro T-Gro commented Sep 22, 2022

Copy link
Copy Markdown
Member

This PR implements mouseover tooltips for keywords in Visual Studio.
This already works in FsAutoComplete (Ionide) and this new VS implementation uses the same data source, provided by Compiler Services.

Here is a visual example.
image

REMARK:
In order to test, I had to rebase this branch on top of recent "packages-update" of all Roslyn and Visual Studio packages.
Without it, "build.cmd -testVS" was failing in latest Int Preview version of visual studio.

@T-Gro T-Gro linked an issue Sep 22, 2022 that may be closed by this pull request
@dnfadmin

dnfadmin commented Sep 22, 2022

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@psfinaki psfinaki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'd probably remove the icons at all, I don't see any particular value in having them whereas they take space :)

Otherwise - awesome!

Comment thread src/Compiler/Service/ServiceLexing.fs Outdated
@T-Gro

T-Gro commented Sep 22, 2022

Copy link
Copy Markdown
Member Author

So I'd probably remove the icons at all, I don't see any particular value in having them whereas they take space :)

Otherwise - awesome!

We do use icons in other tooltips, always fitting the respective token (property, class, method,... have their own icons).
Having one for keywords keeps the behavior consistent.

@psfinaki

Copy link
Copy Markdown
Contributor

So I'd probably remove the icons at all, I don't see any particular value in having them whereas they take space :)
Otherwise - awesome!

We do use icons in other tooltips, always fitting the respective token (property, class, method,... have their own icons). Having one for keywords keeps the behavior consistent.

Sure. I don't have a strong opinion here :)

@vzarytovskii vzarytovskii enabled auto-merge (squash) September 22, 2022 15:11
@T-Gro T-Gro disabled auto-merge September 22, 2022 16:18
@T-Gro T-Gro merged commit 0ee2932 into main Sep 22, 2022
@T-Gro T-Gro deleted the 12062-implement-tooltips-for-keywords branch September 26, 2022 07:39
@vzarytovskii vzarytovskii mentioned this pull request Sep 26, 2022
ParamName: string option
}

static member Create: layout: TaggedText[] * xml: FSharpXmlDoc * ?typeMapping: TaggedText[] list * ?paramName: string * ?remarks: TaggedText[] -> ToolTipElementData

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be internal please? I think it is only used from FSharpCheckerResults.fs? Thanks

val KeywordsWithDescription: (string * string) list

/// A lookup from keywords to their descriptions
val KeywordsDescriptionLookup: System.Collections.Generic.IDictionary<string, string>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be a string -> string option method please, GetKeywordDescription? Rather than revealing an IDictionary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Go to definition on external dependency/metadata is broken in 17.4 Implement tooltips for keywords

5 participants