Skip to content

Commit

Permalink
Merge pull request #5175 from unisonweb/cp/trailing-bang-lsp
Browse files Browse the repository at this point in the history
  • Loading branch information
aryairani authored Jul 2, 2024
2 parents e99fb07 + 92a74df commit 54e17f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion unison-cli/src/Unison/LSP/VFS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 54e17f2

Please sign in to comment.