提交 f3a96000 编写于 作者: R Ramya Achutha Rao

Disable emmet completion provider for mapped modes #29318

上级 f4055d95
......@@ -13,17 +13,11 @@ import { isValidLocationForEmmetAbbreviation } from './abbreviationActions';
import { getSyntax, getNode, getInnerRange } from './util';
export class DefaultCompletionItemProvider implements vscode.CompletionItemProvider {
private _mappedSyntax = false;
constructor(mappedSyntax?: boolean) {
if (mappedSyntax) {
this._mappedSyntax = mappedSyntax;
}
}
public provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Thenable<vscode.CompletionList> {
let syntax = getSyntax(document);
if (!this._mappedSyntax) {
syntax = this.syntaxHelper(syntax, document, position);
}
syntax = this.syntaxHelper(syntax, document, position);
if (!syntax) {
return;
}
......
......@@ -17,7 +17,7 @@ import { fetchEditPoint } from './editPoint';
import { fetchSelectItem } from './selectItem';
import { evaluateMathExpression } from './evaluateMathExpression';
import { incrementDecrement } from './incrementDecrement';
import { LANGUAGE_MODES, getMappedModes, getExcludedModes } from './util';
import { LANGUAGE_MODES, getExcludedModes } from './util';
import { updateExtensionsPath } from 'vscode-emmet-helper';
export function activate(context: vscode.ExtensionContext) {
......@@ -31,14 +31,6 @@ export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(provider);
});
let completionProviderForMappedSyntax = new DefaultCompletionItemProvider(true);
let mappedModes = getMappedModes();
Object.keys(mappedModes).forEach(syntax => {
const provider = vscode.languages.registerCompletionItemProvider(syntax, completionProviderForMappedSyntax, ...LANGUAGE_MODES[mappedModes[syntax]]);
context.subscriptions.push(provider);
});
context.subscriptions.push(vscode.commands.registerCommand('emmet.wrapWithAbbreviation', () => {
wrapWithAbbreviation();
}));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册