How to use the vscode-languageclient.TextDocumentIdentifier.create function in vscode-languageclient

To help you get started, we’ve selected a few vscode-languageclient examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github getgauge / gauge-vscode / src / execution / gaugeExecutor.ts View on Github external
private getAllScenarios(languageClient: LanguageClient, atCursor?: boolean): Thenable {
        let uri = TextDocumentIdentifier.create(window.activeTextEditor.document.uri.toString());
        let currPos = window.activeTextEditor.selection.active;
        let params = { textDocument: uri, position: currPos };
        if (!atCursor) {
            // change the position to get all scenarios instead of only related to cursor position
            params.position = new Position(1, 1);
        }
        return languageClient.sendRequest("gauge/scenarios", params, new CancellationTokenSource().token);
    }
github getgauge / gauge-vscode / src / execution / gaugeExecution.ts View on Github external
function getAllScenarios(languageClient: LanguageClient, atCursor?: boolean): Thenable {
    let uri = TextDocumentIdentifier.create(window.activeTextEditor.document.uri.toString());
    let currPos = window.activeTextEditor.selection.active;
    let params = { textDocument: uri, position: currPos };
    if (!atCursor) {
        // change the position to get all scenarios instead of only related to cursor position
        params.position = new Position(1, 1);
    }
    return languageClient.sendRequest("gauge/scenarios", params, new CancellationTokenSource().token);
}
github joelday / papyrus-lang / src / papyrus-lang-vscode / src / ClientServer.ts View on Github external
public requestSyntaxTree(uri: string): Thenable {
        return this._client.sendRequest(documentSyntaxTreeRequestType.type, {
            textDocument: TextDocumentIdentifier.create(uri),
        });
    }
github joelday / papyrus-lang / src / papyrus-lang-vscode / src / server / LanguageClient.ts View on Github external
requestSyntaxTree(uri: string): Thenable {
        return this._client.sendRequest(documentSyntaxTreeRequestType.type, {
            textDocument: TextDocumentIdentifier.create(uri),
        });
    }
github dotnet / aspnetcore-tooling / src / Razor / src / Microsoft.AspNetCore.Razor.VSCode / src / Semantic / SemanticTokensRangeRequest.ts View on Github external
constructor(
        razorDocumentUri: vscode.Uri,
        range: vscode.Range,
    ) {
        this.textDocument = TextDocumentIdentifier.create(razorDocumentUri.toString());
        this.range = convertRangeToSerializable(range);
    }
}
github dotnet / aspnetcore-tooling / src / Razor / src / Microsoft.AspNetCore.Razor.VSCode / src / Semantic / SemanticTokensRequest.ts View on Github external
constructor(
        razorDocumentUri: vscode.Uri) {
        this.textDocument = TextDocumentIdentifier.create(razorDocumentUri.toString());
    }
}
github dotnet / aspnetcore-tooling / src / Razor / src / Microsoft.AspNetCore.Razor.VSCode / src / Semantic / SemanticTokensEditRequest.ts View on Github external
constructor(
        razorDocumentUri: vscode.Uri,
        public readonly previousResultId: string,
    ) {
        this.textDocument = TextDocumentIdentifier.create(razorDocumentUri.toString());
    }
}
github joelday / papyrus-lang / src / papyrus-lang-vscode / src / ClientServer.ts View on Github external
public requestScriptInfo(uri: string): Thenable {
        return this._client.sendRequest(documentScriptInfoRequestType.type, {
            textDocument: TextDocumentIdentifier.create(uri),
        });
    }
github getgauge / gauge-vscode / src / gaugeReference.ts View on Github external
return (): Thenable => {
            let position = window.activeTextEditor.selection.active;
            let documentId = TextDocumentIdentifier.create(window.activeTextEditor.document.uri.toString());
            let activeEditor = window.activeTextEditor.document.uri;
            let languageClient = clients.get(activeEditor.fsPath).client;
            let params = { textDocument: documentId, position };
            return languageClient.sendRequest("gauge/stepValueAt", params, new CancellationTokenSource().token).then(
                (stepValue: string) => {
                    return this.showStepReferences(clients)(documentId.uri, position, stepValue);
                });
        };
    }