mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-23 19:59:37 +00:00
Don't include leading @ in JS/TS completion word range (#149400)
Fixes #149385
This commit is contained in:
@@ -7,7 +7,6 @@ import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { Command, CommandManager } from '../commands/commandManager';
|
||||
import type * as Proto from '../protocol';
|
||||
import protocol = require('../protocol');
|
||||
import * as PConst from '../protocol.const';
|
||||
import { ClientCapability, ITypeScriptServiceClient, ServerResponse } from '../typescriptService';
|
||||
import API from '../utils/api';
|
||||
@@ -717,7 +716,14 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider<
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const wordRange = document.getWordRangeAtPosition(position);
|
||||
let wordRange = document.getWordRangeAtPosition(position);
|
||||
if (wordRange && !wordRange.isEmpty) {
|
||||
const secondCharPosition = wordRange.start.translate(0, 1);
|
||||
const firstChar = document.getText(new vscode.Range(wordRange.start, secondCharPosition));
|
||||
if (firstChar === '@') {
|
||||
wordRange = wordRange.with(secondCharPosition);
|
||||
}
|
||||
}
|
||||
|
||||
await this.client.interruptGetErr(() => this.fileConfigurationManager.ensureConfigurationForDocument(document, token));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user