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

Reflecting PR feedback for #13956 #13989

Merged
merged 5 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Compiler/Service/FSharpCheckerResults.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2652,9 +2652,9 @@ type FSharpCheckFileResults
ToolTipText.ToolTipText
[
for kw in names do
match Tokenization.FSharpKeywords.KeywordsDescriptionLookup.TryGetValue kw with
| false, _ -> ()
| true, kwDescription ->
match Tokenization.FSharpKeywords.KeywordsDescriptionLookup kw with
| None -> ()
| Some kwDescription ->
let kwText = kw |> TaggedText.tagKeyword |> wordL |> LayoutRender.toArray
let kwTip = ToolTipElementData.Create(kwText, FSharpXmlDoc.None)

Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Service/ServiceDeclarationLists.fs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type ToolTipElementData =
Remarks: TaggedText[] option
ParamName : string option }

static member Create(layout, xml, ?typeMapping, ?paramName, ?remarks) =
static member internal Create(layout, xml, ?typeMapping, ?paramName, ?remarks) =
{ MainDescription=layout; XmlDoc=xml; TypeMapping=defaultArg typeMapping []; ParamName=paramName; Remarks=remarks }

/// A single data tip display element
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Service/ServiceDeclarationLists.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type public ToolTipElementData =
ParamName: string option
}

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

/// A single tool tip display element
//
Expand Down
8 changes: 7 additions & 1 deletion src/Compiler/Service/ServiceLexing.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,13 @@ module FSharpKeywords =

let KeywordsWithDescription = PrettyNaming.keywordsWithDescription

let KeywordsDescriptionLookup = KeywordsWithDescription |> dict
let internal KeywordsDescriptionLookup =
let d = KeywordsWithDescription |> dict

fun kw ->
match d.TryGetValue kw with
| false, _ -> None
| true, desc -> Some desc

let KeywordNames = Lexhelp.Keywords.keywordNames

Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Service/ServiceLexing.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ module FSharpKeywords =
val KeywordsWithDescription: (string * string) list

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

/// All the keywords in the F# language
val KeywordNames: string list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3977,7 +3977,6 @@ FSharp.Compiler.EditorServices.ToolTipElementData
FSharp.Compiler.EditorServices.ToolTipElementData: Boolean Equals(FSharp.Compiler.EditorServices.ToolTipElementData)
FSharp.Compiler.EditorServices.ToolTipElementData: Boolean Equals(System.Object)
FSharp.Compiler.EditorServices.ToolTipElementData: Boolean Equals(System.Object, System.Collections.IEqualityComparer)
FSharp.Compiler.EditorServices.ToolTipElementData: FSharp.Compiler.EditorServices.ToolTipElementData Create(FSharp.Compiler.Text.TaggedText[], FSharp.Compiler.Symbols.FSharpXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.TaggedText[]]], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.TaggedText[]])
FSharp.Compiler.EditorServices.ToolTipElementData: FSharp.Compiler.Symbols.FSharpXmlDoc XmlDoc
FSharp.Compiler.EditorServices.ToolTipElementData: FSharp.Compiler.Symbols.FSharpXmlDoc get_XmlDoc()
FSharp.Compiler.EditorServices.ToolTipElementData: FSharp.Compiler.Text.TaggedText[] MainDescription
Expand Down Expand Up @@ -9901,8 +9900,6 @@ FSharp.Compiler.Tokenization.FSharpKeywords: Microsoft.FSharp.Collections.FSharp
FSharp.Compiler.Tokenization.FSharpKeywords: Microsoft.FSharp.Collections.FSharpList`1[System.String] get_KeywordNames()
FSharp.Compiler.Tokenization.FSharpKeywords: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] KeywordsWithDescription
FSharp.Compiler.Tokenization.FSharpKeywords: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] get_KeywordsWithDescription()
FSharp.Compiler.Tokenization.FSharpKeywords: System.Collections.Generic.IDictionary`2[System.String,System.String] KeywordsDescriptionLookup
FSharp.Compiler.Tokenization.FSharpKeywords: System.Collections.Generic.IDictionary`2[System.String,System.String] get_KeywordsDescriptionLookup()
FSharp.Compiler.Tokenization.FSharpKeywords: System.String NormalizeIdentifierBackticks(System.String)
FSharp.Compiler.Tokenization.FSharpLexer
FSharp.Compiler.Tokenization.FSharpLexer: Void Tokenize(FSharp.Compiler.Text.ISourceText, Microsoft.FSharp.Core.FSharpFunc`2[FSharp.Compiler.Tokenization.FSharpToken,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[System.String]], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Tokenization.FSharpLexerFlags], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpMap`2[System.String,System.String]], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken])
Expand Down