Skip to content

Commit c15cb48

Browse files
committed
escape module names
1 parent 75d2a0a commit c15cb48

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Language/PureScript/Ide.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ findDeclarations filters currentModule completionOptions = do
171171
mapMaybe (\case
172172
F.Filter (Left modules) ->
173173
Just $ "(exists (select 1 from exports e where id.module_name = e.defined_in and id.name = e.name and id.declaration_type = e.declaration_type and e.module_name in (" <>
174-
T.intercalate "," (toList modules <&> runModuleName <&> \m -> "'" <> m <> "'") <>
174+
T.intercalate "," (toList modules <&> runModuleName <&> \m -> "'" <> escapeSQL m <> "'") <>
175175
"))" <>
176-
" or " <> "id.module_name in (" <> T.intercalate "," (toList modules <&> runModuleName <&> \m -> "'" <> m <> "'") <> "))"
176+
" or " <> "id.module_name in (" <> T.intercalate "," (toList modules <&> runModuleName <&> \m -> "'" <> escapeSQL m <> "'") <> "))"
177177
F.Filter (Right (F.Prefix "")) -> Nothing
178178
F.Filter (Right (F.Prefix f)) -> Just $ "id.name glob '" <> escapeSQL f <> "*'"
179179
F.Filter (Right (F.Exact f)) -> Just $ "id.name glob '" <> escapeSQL f <> "'"

0 commit comments

Comments
 (0)