How to use the vscode-languageclient.CompletionRequest 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 DonJayamanne / pythonVSCode / src / client / datascience / interactive-window / intellisense / dotNetIntellisenseProvider.ts View on Github external
protected async provideCompletionItems(position: monacoEditor.Position, context: monacoEditor.languages.CompletionContext, cellId: string, token: CancellationToken): Promise {
        const languageClient = await this.getLanguageClient();
        const document = await this.getDocument();
        if (languageClient && document) {
            const docPos = document.convertToDocumentPosition(cellId, position.lineNumber, position.column);
            const result = await languageClient.sendRequest(
                vscodeLanguageClient.CompletionRequest.type,
                languageClient.code2ProtocolConverter.asCompletionParams(document, docPos, context),
                token);
            return convertToMonacoCompletionList(result, true);
        }

        return {
            suggestions: [],
            incomplete: false
        };
    }
    protected async provideHover(position: monacoEditor.Position, cellId: string, token: CancellationToken): Promise {
github DonJayamanne / pythonVSCode / src / client / datascience / interactive-common / intellisense / dotNetIntellisenseProvider.ts View on Github external
protected async provideCompletionItems(position: monacoEditor.Position, context: monacoEditor.languages.CompletionContext, cellId: string, token: CancellationToken): Promise {
        const languageClient = await this.getLanguageClient();
        const document = await this.getDocument();
        if (languageClient && document) {
            const docPos = document.convertToDocumentPosition(cellId, position.lineNumber, position.column);
            const result = await languageClient.sendRequest(
                vscodeLanguageClient.CompletionRequest.type,
                languageClient.code2ProtocolConverter.asCompletionParams(document, docPos, context),
                token);
            return convertToMonacoCompletionList(result, true);
        }

        return {
            suggestions: [],
            incomplete: false
        };
    }
    protected async provideHover(position: monacoEditor.Position, cellId: string, token: CancellationToken): Promise {
github DonJayamanne / pythonVSCode / src / client / datascience / interactive-window / intellisense / dotNetIntellisenseProvider.ts View on Github external
protected async provideCompletionItems(position: monacoEditor.Position, context: monacoEditor.languages.CompletionContext, cellId: string, token: CancellationToken): Promise {
        const languageClient = await this.getLanguageClient();
        const document = await this.getDocument();
        if (languageClient && document) {
            const docPos = document.convertToDocumentPosition(cellId, position.lineNumber, position.column);
            const result = await languageClient.sendRequest(
                vscodeLanguageClient.CompletionRequest.type,
                languageClient.code2ProtocolConverter.asCompletionParams(document, docPos, context),
                token);
            return convertToMonacoCompletionList(result, true);
        }

        return {
            suggestions: [],
            incomplete: false
        };
    }
    protected async provideHover(position: monacoEditor.Position, cellId: string, token: CancellationToken): Promise {
github DonJayamanne / pythonVSCode / src / client / activation / languageServer / activator.ts View on Github external
private async handleProvideCompletionItems(document: TextDocument, position: Position, token: CancellationToken, context: CompletionContext): Promise {
        const languageClient = this.getLanguageClient();
        if (languageClient) {
            const args = languageClient.code2ProtocolConverter.asCompletionParams(document, position, context);
            const result = await languageClient.sendRequest(
                vscodeLanguageClient.CompletionRequest.type,
                args,
                token
            );
            if (result) {
                return languageClient.protocol2CodeConverter.asCompletionResult(result);
            }
        }
    }