Skip to content

Commit

Permalink
include keywords in tooltip lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
baronfel committed Aug 7, 2022
1 parent 7f40654 commit e6d9b09
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/FsAutoComplete.Core/ParseAndCheckResults.fs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@ type ParseAndCheckResults
| _ -> Ok(tip)

member x.TryGetToolTipEnhanced (pos: Position) (lineStr: LineStr) =
let (|EmptyTooltip|_|) (ToolTipText elems) =
match elems with
| [] -> Some ()
| elems when elems |> List.forall ((=) ToolTipElement.None) -> Some ()
| _ -> None

match Completion.atPos (pos, x.GetParseResults.ParseTree) with
| Completion.Context.StringLiteral -> Ok None
| Completion.Context.SynType
Expand All @@ -343,7 +349,7 @@ type ParseAndCheckResults
checkResults.GetSymbolUseAtLocation(pos.Line, col, lineStr, identIsland)

match tip with
| ToolTipText (elems) when elems |> List.forall ((=) ToolTipElement.None) && symbol.IsNone ->
| EmptyTooltip when symbol.IsNone ->
match identIsland with
| [ ident ] ->
match KeywordList.keywordTooltips.TryGetValue ident with
Expand Down

0 comments on commit e6d9b09

Please sign in to comment.