Skip to content

Commit

Permalink
emmet.excludeLang shouldnt need reload. Fixes #29680
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Jun 27, 2017
1 parent fe276c9 commit 92681cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion extensions/emmet/src/defaultCompletionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ import { Node, HtmlNode } from 'EmmetNode';
import { DocumentStreamReader } from './bufferStream';
import { EmmetCompletionItemProvider, isStyleSheet } from 'vscode-emmet-helper';
import { isValidLocationForEmmetAbbreviation } from './abbreviationActions';
import { getSyntax, getNode, getInnerRange } from './util';
import { getSyntax, getNode, getInnerRange, getExcludedModes } from './util';

export class DefaultCompletionItemProvider implements vscode.CompletionItemProvider {

public provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Thenable<vscode.CompletionList> {
let syntax = getSyntax(document);
if (getExcludedModes().indexOf(syntax) > -1) {
return;
}
syntax = this.syntaxHelper(syntax, document, position);

if (!syntax) {
Expand Down
4 changes: 2 additions & 2 deletions extensions/emmet/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import { updateExtensionsPath } from 'vscode-emmet-helper';

export function activate(context: vscode.ExtensionContext) {
let completionProvider = new DefaultCompletionItemProvider();
let exlcludedLanguages = getExcludedModes();
let excludedLanguages = getExcludedModes();
Object.keys(LANGUAGE_MODES).forEach(language => {
if (exlcludedLanguages.indexOf(language) > -1) {
if (excludedLanguages.indexOf(language) > -1) {
return;
}
const provider = vscode.languages.registerCompletionItemProvider(language, completionProvider, ...LANGUAGE_MODES[language]);
Expand Down

0 comments on commit 92681cb

Please sign in to comment.