mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Simplify startup
This commit is contained in:
parent
dcdbbddd16
commit
d24e612106
5 changed files with 25 additions and 33 deletions
|
@ -7,7 +7,8 @@ import { Ctx, sendRequestWithRetry } from './ctx';
|
|||
|
||||
export function activateHighlighting(ctx: Ctx) {
|
||||
const highlighter = new Highlighter(ctx);
|
||||
ctx.onStart(client => {
|
||||
const client = ctx.client;
|
||||
if (client != null) {
|
||||
client.onNotification(
|
||||
'rust-analyzer/publishDecorations',
|
||||
(params: PublishDecorationsParams) => {
|
||||
|
@ -28,7 +29,7 @@ export function activateHighlighting(ctx: Ctx) {
|
|||
highlighter.setHighlights(targetEditor, params.decorations);
|
||||
},
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
vscode.workspace.onDidChangeConfiguration(
|
||||
_ => highlighter.removeHighlights(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue