Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 {
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 {
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 {
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);
}
}
}