perf - use Lazy for comparers and 💄 Lazy to align with IdleValue (#170866)

perf - use `Lazy` for comparers and 💄 `Lazy` to align with `IdleValue`
This commit is contained in:
Benjamin Pasero
2023-01-10 07:12:34 +01:00
committed by GitHub
parent e7b5449579
commit 5b60b8a53e
20 changed files with 58 additions and 115 deletions

View File

@@ -428,7 +428,7 @@ export class ExtHostTextEditor {
this.value = Object.freeze({
get document(): vscode.TextDocument {
return document.getValue();
return document.value;
},
set document(_value) {
throw readonly('document');
@@ -482,7 +482,7 @@ export class ExtHostTextEditor {
if (that._disposed) {
return Promise.reject(new Error('TextEditor#edit not possible on closed editors'));
}
const edit = new TextEditorEdit(document.getValue(), options);
const edit = new TextEditorEdit(document.value, options);
callback(edit);
return that._applyEdit(edit);
},
@@ -513,7 +513,7 @@ export class ExtHostTextEditor {
}
}
}
return _proxy.$tryInsertSnippet(id, document.getValue().version, snippet.value, ranges, options);
return _proxy.$tryInsertSnippet(id, document.value.version, snippet.value, ranges, options);
},
setDecorations(decorationType: vscode.TextEditorDecorationType, ranges: Range[] | vscode.DecorationOptions[]): void {
const willBeEmpty = (ranges.length === 0);