Skip to content

Commit

Permalink
Disable emmet completion provider for mapped modes #29318
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Jun 23, 2017
1 parent f4055d9 commit f3a9600
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
12 changes: 3 additions & 9 deletions extensions/emmet/src/defaultCompletionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
10 changes: 1 addition & 9 deletions extensions/emmet/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
}));
Expand Down

0 comments on commit f3a9600

Please sign in to comment.