Skip to content

Commit 8bae9e6

Browse files
committed
hls-pragmas-plugin: Simply completion and add comments
1 parent 974d591 commit 8bae9e6

File tree

1 file changed

+7
-4
lines changed
  • plugins/hls-pragmas-plugin/src/Ide/Plugin

1 file changed

+7
-4
lines changed

Diff for: plugins/hls-pragmas-plugin/src/Ide/Plugin/Pragmas.hs

+7-4
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,13 @@ completion _ide _ complParams = do
200200
| otherwise
201201
= [ mkPragmaCompl (prefix <> pragmaTemplate <> suffix) matcher detail
202202
| (pragmaTemplate, matcher, detail, appearWhere) <- validPragmas
203-
, Fuzzy.test word matcher
204-
, (appearWhere == NewLine && line == word)
205-
|| (appearWhere == CanInline && line /= word)
206-
|| (T.elem ' ' matcher && appearWhere == NewLine && Fuzzy.test line matcher)
203+
, -- Only suggest a pragma that need its own line if the whole line
204+
-- fuzzily matches the pragma
205+
(appearWhere == NewLine && Fuzzy.test line matcher ) ||
206+
-- Only suggest a pragma that appears in the middle of a line when
207+
-- the current word is not the only thing in the line and the
208+
-- current word fuzzily matches the pragma
209+
(appearWhere == CanInline && line /= word && Fuzzy.test word matcher)
207210
]
208211
where
209212
line = T.toLower $ VFS.fullLine pfix

0 commit comments

Comments
 (0)