File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
unison-cli/src/Unison/LSP Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -60,9 +60,12 @@ completionHandler m respond =
6060 respond . maybe (Right $ InL mempty ) (Right . InR . InL ) =<< runMaybeT do
6161 let fileUri = (m ^. params . textDocument . uri)
6262 (range, prefix) <- VFS. completionPrefix (m ^. params . textDocument . uri) (m ^. params . position)
63+ -- dots are separators in names and a name with a trailing '.' doesn't parse and short-circuits completion.
64+ -- Since the completion overwrites the explicitly provided range anyways, stripping just works better.
65+ let strippedPrefix = Text. dropWhileEnd (== ' .' ) prefix
6366 ppe <- PPED. suffixifiedPPE <$> lift currentPPED
6467 codebaseCompletions <- lift getCodebaseCompletions
65- let (isIncomplete, matches) = completionsForQuery codebaseCompletions prefix
68+ let (isIncomplete, matches) = completionsForQuery codebaseCompletions strippedPrefix
6669 let defCompletionItems =
6770 matches
6871 & mapMaybe \ (path, fqn, dep) ->
You can’t perform that action at this time.
0 commit comments