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

Commit 7b9ed3d

Browse files
cartermpKevinRansom
authored andcommitted
Fix IndexOutOfRangeException in check for providing completion (dotnet#4138)
* Fix IndexOutOfRange in check for providing completion: * Add test
1 parent 3f8d22b commit 7b9ed3d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Completion/CompletionProvider.fs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,9 @@ type internal FSharpCompletionProvider
8585
else
8686
let triggerPosition = caretPosition - 1
8787
let triggerChar = sourceText.[triggerPosition]
88-
let prevChar = sourceText.[triggerPosition - 1]
89-
88+
9089
// do not trigger completion if it's not single dot, i.e. range expression
91-
if not Settings.IntelliSense.ShowAfterCharIsTyped && prevChar = '.' then
90+
if not Settings.IntelliSense.ShowAfterCharIsTyped && triggerPosition > 0 && sourceText.[triggerPosition - 1] = '.' then
9291
false
9392
else
9493
let documentId, filePath, defines = getInfo()

0 commit comments

Comments
 (0)