Skip to content

Commit

Permalink
hls-pragmas-plugin: Simply completion and add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaymankar committed Jun 12, 2023
1 parent 974d591 commit 8bae9e6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions plugins/hls-pragmas-plugin/src/Ide/Plugin/Pragmas.hs
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,13 @@ completion _ide _ complParams = do
| otherwise
= [ mkPragmaCompl (prefix <> pragmaTemplate <> suffix) matcher detail
| (pragmaTemplate, matcher, detail, appearWhere) <- validPragmas
, Fuzzy.test word matcher
, (appearWhere == NewLine && line == word)
|| (appearWhere == CanInline && line /= word)
|| (T.elem ' ' matcher && appearWhere == NewLine && Fuzzy.test line matcher)
, -- Only suggest a pragma that need its own line if the whole line
-- fuzzily matches the pragma
(appearWhere == NewLine && Fuzzy.test line matcher ) ||
-- Only suggest a pragma that appears in the middle of a line when
-- the current word is not the only thing in the line and the
-- current word fuzzily matches the pragma
(appearWhere == CanInline && line /= word && Fuzzy.test word matcher)
]
where
line = T.toLower $ VFS.fullLine pfix
Expand Down

0 comments on commit 8bae9e6

Please sign in to comment.