fix(diagnostic): highlight hints, deprecated and unused text with their own unique hlgroups#3188
Conversation
…ir own unique hlgroups
7089ffb refactor(semanticTokens): remove unnecessary lengend from provider c92cc70 feat(semanticTokens): hanlde semanticTokens refresh request dad735a fix(semanticTokensManager): use resolved provider of document c6cbcbb refactor(highlight): improve highlight methods 50b1f98 chore(api): use getbufinfo for linecount f43bee3 refactor(plugin): avoid wait extensions activated on initialize 720a5a7 chore(doc): fix link of README 31084ee perf(highlight): check exists highlights when possible 21f64bf docs(doc): doc of g:coc_text_prop_offset 1a7262c fix(tests): fix vim command test on CI 7b57d47 fix(handler): make codeLens.dispose (#3195) d5eb44e fix(format): avoid unexpected cancel of format 3f8aa08 fix(handler): fix rename undefined c0cc51d fix(source/file): add windows driver(X:\ or X:/) path support (#3189) 70b445b chore(handler): add more tests e25d8fe chore(diagnostic): avoid unnecessary refresh d62ad5b refactor(handler): split handler to different modules 0607abe chore(tsconfig): set noEmit to true adefcb3 chore(typings): add missing methods of languages 3cd702c feat(highligher): add method addTexts 60ddea0 fix(diagnostic): avoid check equality of diagnostics 894616a docs(doc): doc of g:coc_service_initialized 4817390 chore(package): upgrade typescript 7c61968 feat(typings): more typings (#3187) 7051352 refactor(types): simplify types and exports 1866fc9 fix(diagnostic): highlight hints, deprecated and unused text with their own unique hlgroups (#3188) 0aa97ad refactor(handler): use locations handler 0a60275 refactor(handler): use hover handler 4e5a59b refactor(handler): use hover handler 6e7b735 refactor(highlights): avoid unnecessary try catch 66c6f9d fix(document): check latest insert for change 3874573 chore(handler): add more tests for search and highlights 8d14a34 chore(test): improve signature tests f2b0f5d refactor(handler): improve documentHighlight handler 2ab3951 fix(float): disable fold for float windows 52140a7 refactor(codeActions): improve tests of codeActions 2a53fce fix(signature): use start position from coc_last_placeholder 6bc3ee0 test(handler): add semanticTokens tests (#3182) 77ecd7f fix(language-client): missed logs (#3183) d88f985 refactor(handler): move colors related to colors module c50a030 chore(codeActions): add more tests ace2582 chore(signature): add more tests
|
@fannheyward do you think it's a good idea to associate this to SemanticTokenModifiers.deprecated? I've noticed deprecated strikethrough APIs due to diagnostics, it's quite useful, but some language servers are only providing it at semantic token side solely, not diagnostic.
Anyway, back to the topic, I suspect a reasonable deprecated semantic token modifier implementation would be (given use-ts-hi-group), that it picked |
@oblitum Yes, coc.nvim's semanticTokens didn't pick tokenModifiers by now. I'll take it this week. |
This PR fixes the remaining entries in
DiagnosticHighlightto use unique hlgroups, namelyCoc<Something>Highlight, instead of reusing existing ones. Note that I say "remaining" because that enum was usingCocErrorHighlightandCocWarningHighlightfrom the beginning (commit df7a1d9, relevant code), thenCocInfoFloatwas correctly replaced withCocInfoHighlightin commit 4cd2b40, and finally I replace the remaining hlgroup for the "hint" severity withCocHintHighlightin this PR.Additionally, I added the
CocDeprecatedHighlightandCocUnusedHighlightgroups for deprecated and unused code respectively, which link toCocStrikeThroughandCocFadeOut. This was done both for the sake of consistency, and future-proofing in case theCocStrikeThroughandCocFadeOutgroups may come in handy for text formatting in other unrelated things, similarly to hlgroups such asCocBold,CocItalic,CocUnderlineand others. Because the two new hlgroups are by default just linked, this will have no visible effect on user configurations.As for
CocHintHighlight, this PR indeed fixes highlighting of hints, which right now look like:And here is how they will look after this PR (which was the behavior before commit df7a1d9):
As you can see, their highlighting of the relevant source code is now consistent with errors because by default all
Coc*Highlightgroups are linked toCocUnderline.