Skip to content

Commit d389f5f

Browse files
committed
Escape dollar signs in completion snippets
1 parent ff7a3c3 commit d389f5f

File tree

1 file changed

+2
-1
lines changed
  • ghcide/src/Development/IDE/Plugin/Completions

1 file changed

+2
-1
lines changed

ghcide/src/Development/IDE/Plugin/Completions/Logic.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ mkCompl
202202
_preselect = Nothing,
203203
_sortText = Nothing,
204204
_filterText = Nothing,
205-
_insertText = Just insertText,
205+
_insertText = Just $ sanitize insertText,
206206
_insertTextFormat = Just InsertTextFormat_Snippet,
207207
_insertTextMode = Nothing,
208208
_textEdit = Nothing,
@@ -227,6 +227,7 @@ mkCompl
227227
pprLineCol (UnhelpfulLoc fs) = T.pack $ unpackFS fs
228228
pprLineCol (RealSrcLoc loc _) =
229229
"line " <> printOutputable (srcLocLine loc) <> ", column " <> printOutputable (srcLocCol loc)
230+
sanitize = T.replace "$" "\\$"
230231

231232

232233
mkAdditionalEditsCommand :: Maybe PluginId -> ExtendImport -> Maybe Command

0 commit comments

Comments
 (0)