mirror of
https://github.com/unisonweb/unison.git
synced 2024-10-05 14:17:33 +03:00
Merge pull request #5175 from unisonweb/cp/trailing-bang-lsp
This commit is contained in:
commit
54e17f2746
@ -81,7 +81,11 @@ identifierSplitAtPosition uri pos = do
|
||||
vf <- getVirtualFile uri
|
||||
PosPrefixInfo {fullLine, cursorPos} <- MaybeT (VFS.getCompletionPrefix pos vf)
|
||||
let (before, after) = Text.splitAt (cursorPos ^. character . to fromIntegral) fullLine
|
||||
pure (Text.takeWhileEnd isIdentifierChar before, Text.takeWhile isIdentifierChar after)
|
||||
pure
|
||||
( Text.takeWhileEnd isIdentifierChar before,
|
||||
-- names can end with '!', and it's not a force, so we include it in the identifier if it's at the end.
|
||||
Text.takeWhile (\c -> isIdentifierChar c || c == '!') after
|
||||
)
|
||||
where
|
||||
isIdentifierChar c =
|
||||
-- Manually exclude '!' and apostrophe, since those are usually just forces and
|
||||
|
Loading…
Reference in New Issue
Block a user