mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-13 03:28:33 -05:00
* Revert "Revert "Merge from vscode merge-base (#22769)" (#22779)"
This reverts commit 47a1745180.
* Fix notebook download task
* Remove done call from extensions-ci
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import * as vscode from 'vscode';
|
|
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
import { ITextDocument } from '../types/textDocument';
|
|
|
|
export class InMemoryDocument implements ITextDocument {
|
|
|
|
private readonly _doc: TextDocument;
|
|
|
|
constructor(
|
|
public readonly uri: vscode.Uri, contents: string,
|
|
public readonly version = 0,
|
|
) {
|
|
|
|
this._doc = TextDocument.create(uri.toString(), 'markdown', version, contents);
|
|
}
|
|
|
|
get lineCount(): number {
|
|
return this._doc.lineCount;
|
|
}
|
|
|
|
positionAt(offset: number): vscode.Position {
|
|
const pos = this._doc.positionAt(offset);
|
|
return new vscode.Position(pos.line, pos.character);
|
|
}
|
|
|
|
getText(range?: vscode.Range): string {
|
|
return this._doc.getText(range);
|
|
}
|
|
}
|