Experiment with switching markdown extension to use native privates

Let's try this out with one extension to start
This commit is contained in:
Matt Bierner
2026-03-10 23:13:16 -07:00
parent 6597286e32
commit 7df46143a1
43 changed files with 845 additions and 690 deletions

View File

@@ -9,7 +9,7 @@ import { ITextDocument } from '../types/textDocument';
export class InMemoryDocument implements ITextDocument {
private readonly _doc: TextDocument;
readonly #doc: TextDocument;
public readonly uri: vscode.Uri;
public readonly version: number;
@@ -21,15 +21,15 @@ export class InMemoryDocument implements ITextDocument {
) {
this.uri = uri;
this.version = version;
this._doc = TextDocument.create(this.uri.toString(), 'markdown', 0, contents);
this.#doc = TextDocument.create(this.uri.toString(), 'markdown', 0, contents);
}
getText(range?: vscode.Range): string {
return this._doc.getText(range);
return this.#doc.getText(range);
}
positionAt(offset: number): vscode.Position {
const pos = this._doc.positionAt(offset);
const pos = this.#doc.positionAt(offset);
return new vscode.Position(pos.line, pos.character);
}
}