Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit 3f8d22b

Browse files
vasily-kirichenkoTIHan
authored andcommitted
Detect AttributeApplication completion context for unfinished attributes (dotnet#4126)
* detect AttributeApplication completion context for unfinished attributes * fix whitespace sensitiveness, add more tests * more tests * support ":" in attribute names fix tests * fix tests * pass ParsedInput instead of ParsedInput option to TryGetCompletionContext * refactor tests
1 parent 4f7201c commit 3f8d22b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Completion/CompletionProvider.fs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,13 @@ type internal FSharpCompletionProvider
194194

195195
if results.Count > 0 && not declarations.IsForType && not declarations.IsError && List.isEmpty partialName.QualifyingIdents then
196196
let lineStr = textLines.[caretLinePos.Line].ToString()
197-
match UntypedParseImpl.TryGetCompletionContext(Pos.fromZ caretLinePos.Line caretLinePos.Character, Some parseResults, lineStr) with
197+
198+
let completionContext =
199+
parseResults.ParseTree
200+
|> Option.bind (fun parseTree ->
201+
UntypedParseImpl.TryGetCompletionContext(Pos.fromZ caretLinePos.Line caretLinePos.Character, parseTree, lineStr))
202+
203+
match completionContext with
198204
| None -> results.AddRange(keywordCompletionItems)
199205
| _ -> ()
200206

0 commit comments

Comments
 (0)