Skip to content

Commit

Permalink
automatically run ormolu
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner authored and github-actions[bot] committed Jul 2, 2024
1 parent 1d5ae81 commit 92a74df
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions unison-cli/src/Unison/LSP/VFS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +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,
-- 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)
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 92a74df

Please sign in to comment.