Skip to content

Commit

Permalink
Avoid parsing file when abbr is invalid #43470
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Mar 27, 2018
1 parent 163b417 commit c07abc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/emmet/src/defaultCompletionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import * as vscode from 'vscode';
import { Stylesheet } from 'EmmetNode';
import { isValidLocationForEmmetAbbreviation } from './abbreviationActions';
import { getEmmetHelper, getMappingForIncludedLanguages, parsePartialStylesheet, getEmmetConfiguration, getEmmetMode, isStyleSheet, parseDocument } from './util';
import { getEmmetHelper, getMappingForIncludedLanguages, parsePartialStylesheet, getEmmetConfiguration, getEmmetMode, isStyleSheet, parseDocument, } from './util';

export class DefaultCompletionItemProvider implements vscode.CompletionItemProvider {

Expand All @@ -29,7 +29,7 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi

const helper = getEmmetHelper();
const extractAbbreviationResults = helper.extractAbbreviation(document, position, !isStyleSheet(syntax));
if (!extractAbbreviationResults) {
if (!extractAbbreviationResults || !helper.isAbbreviationValid(syntax, extractAbbreviationResults.abbreviation)) {
return;
}

Expand Down

0 comments on commit c07abc0

Please sign in to comment.