mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 12:08:36 -05:00
Merge from vscode merge-base (#22769)
* Merge from vscode merge-base * Turn off basic checks * Enable compilation, unit, and integration tests
This commit is contained in:
@@ -5,14 +5,12 @@
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { TextDocument } from 'vscode-languageserver-textdocument';
|
||||
import { SkinnyTextDocument, SkinnyTextLine } from '../workspaceContents';
|
||||
import { ITextDocument } from '../types/textDocument';
|
||||
|
||||
export class InMemoryDocument implements SkinnyTextDocument {
|
||||
export class InMemoryDocument implements ITextDocument {
|
||||
|
||||
private readonly _doc: TextDocument;
|
||||
|
||||
private lines: SkinnyTextLine[] | undefined;
|
||||
|
||||
constructor(
|
||||
public readonly uri: vscode.Uri, contents: string,
|
||||
public readonly version = 0,
|
||||
@@ -25,16 +23,6 @@ export class InMemoryDocument implements SkinnyTextDocument {
|
||||
return this._doc.lineCount;
|
||||
}
|
||||
|
||||
lineAt(index: any): SkinnyTextLine {
|
||||
if (!this.lines) {
|
||||
this.lines = this._doc.getText().split(/\r?\n/).map(text => ({
|
||||
text,
|
||||
get isEmptyOrWhitespace() { return /^\s*$/.test(text); }
|
||||
}));
|
||||
}
|
||||
return this.lines[index];
|
||||
}
|
||||
|
||||
positionAt(offset: number): vscode.Position {
|
||||
const pos = this._doc.positionAt(offset);
|
||||
return new vscode.Position(pos.line, pos.character);
|
||||
|
||||
Reference in New Issue
Block a user