This is an archive of the discontinued LLVM Phabricator instance.

[clangd][vscode] Make SemanticHighlightingFeature more self-contained.
ClosedPublic

Authored by hokein on Sep 4 2019, 6:19 AM.

Details

Summary

so that we don't have too many usage from the client side (just a single
occurrance for register), this also aligns with how other builtin feature
being implemented in vscode.

Diff Detail

Repository
rL LLVM

Event Timeline

hokein created this revision.Sep 4 2019, 6:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2019, 6:19 AM
hokein planned changes to this revision.Sep 4 2019, 6:23 AM

wait, there is still an issue.

hokein updated this revision to Diff 218691.Sep 4 2019, 7:19 AM

Update the patch.

hokein retitled this revision from [clangd][vscode] Don't register notifications multiple times when clangd crashes. to [clangd][vscode] Make SemanticHighlightingFeature more self-contained..Sep 4 2019, 7:20 AM
hokein edited the summary of this revision. (Show Details)
ilya-biryukov added inline comments.Sep 4 2019, 7:44 AM
clang-tools-extra/clangd/clients/clangd-vscode/src/semantic-highlighting.ts
88 ↗(On Diff #218691)

Could we subscribe to client.onDidChangeState and dispose() whenever clangd crashes or stops?
This would ensure our initialize <-> dispose calls are properly paired and we will remove the highlightings even if clangd never restarts (I guess that could happen when we crash more than 5 times in a short timespan)

hokein updated this revision to Diff 218710.Sep 4 2019, 8:11 AM
hokein marked an inline comment as done.

address comments.

ilya-biryukov accepted this revision.Sep 4 2019, 8:49 AM

LGTM, thanks!

This revision is now accepted and ready to land.Sep 4 2019, 8:49 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 5 2019, 2:12 AM