Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts | ||
---|---|---|
113 ↗ | (On Diff #218445) | Why not avoid calling clangdClient.registerFeature instead?
|
address the comment, don't register the feature.
clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts | ||
---|---|---|
113 ↗ | (On Diff #218445) | good point, done. |
clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts | ||
---|---|---|
113 ↗ | (On Diff #218445) | Should we update other uses of semanticHighlightingFeature too? context.subscriptions.push(vscode.Disposable.from(semanticHighlightingFeature)) probably ensures we call dispose() when the clangdClient is getting removed, I guess we definitely don't need that. Other uses as well:
Maybe assign null or undefined to semanticHighlightingFeature when the flag is false? |
clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts | ||
---|---|---|
113 ↗ | (On Diff #218445) | I don't think it is worth updating all usages, it is no harm to keep them here even when the highlighting is disabled (the dispose is a no-op; we never receive notifications from clangd); and it would add more guard code which I'd avoid. |
clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts | ||
---|---|---|
113 ↗ | (On Diff #218445) | How can we be sure that nothing bad is going to happen? If we don't create the object in the first place, we are confident nothing harmful can be done with it. |
clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts | ||
---|---|---|
113 ↗ | (On Diff #218445) |
If we receive a notification, that means we have clangd bugs. I understand you point here, an ideal solution is to avoid too many usages of SemanticHighlightingFeature in the client side, after D67165, it'd help simplify the patch here. |
clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts | ||
---|---|---|
113 ↗ | (On Diff #218445) | It should be much simpler to not construct the semanticHighlightingFeature with D67165, right? if (getConfig<boolean>('semanticHighlighting')) { const semanticHighlightingFeature = new semanticHighlighting.SemanticHighlightingFeature(); context.subscriptions.push( vscode.Disposable.from(semanticHighlightingFeature)); clangdClient.registerFeature(semanticHighlightingFeature); } Could we do that? |
clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts | ||
---|---|---|
113 ↗ | (On Diff #218445) | yes, exactly. |