Doc Symbols proper support

This commit is contained in:
BoykoAlex
2022-03-10 13:44:08 -05:00
committed by BoykoAlex
parent a588354ca9
commit d350da5992
9 changed files with 123 additions and 49 deletions

View File

@@ -6,7 +6,8 @@ import {
Event,
EventEmitter,
ProviderResult,
TextDocument
TextDocument,
Uri
} from "vscode";
import {HighlightParams, toVSRange} from './highlight-service';
import * as Lsp from 'vscode-languageclient';
@@ -22,7 +23,7 @@ export class HighlightCodeLensProvider implements CodeLensProvider {
handle(highlghtParams: HighlightParams) {
if (!deepEqual(this.highlights.get(highlghtParams.doc.uri), highlghtParams)) {
this.highlights.set(highlghtParams.doc.uri, highlghtParams);
this.highlights.set(Uri.parse(highlghtParams.doc.uri).toString(), highlghtParams);
this._onDidChangeCodeLenses.fire();
}
}

View File

@@ -43,7 +43,7 @@ export class HighlightService {
}
handle(params : HighlightParams) : void {
this.highlights.set(params.doc.uri, params);
this.highlights.set(VSCode.Uri.parse(params.doc.uri).toString(), params);
this.refresh(params.doc);
}
@@ -52,7 +52,7 @@ export class HighlightService {
for (let editor of editors) {
const activeUri = editor.document.uri.toString();
const activeVersion = editor.document.version;
if (docId.uri === activeUri && docId.version === activeVersion) {
if (VSCode.Uri.parse(docId.uri).toString() === activeUri && docId.version === activeVersion) {
//We only update highlights in the active editor for now
this.updateHighlightsForEditor(editor);
}