mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 14:31:31 +01:00
Stylesheet partial parse (#46376)
* First draft at partial parsing of css for emmet * Partial parsing of stylesheets for Emmet * Addressing feedback * Refactoring and fixing little bug * Liitle fix * Equals are now equals * We don't want emmet in selectors * Skip comments when preparsing * Addressing feedback, refactoring and cleaning up code. * Update endPosition only if not eof * Use function to find closing comment * Don't check more than 5000 characters back
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
import * as vscode from 'vscode';
|
||||
import { Node } from 'EmmetNode';
|
||||
import { isValidLocationForEmmetAbbreviation } from './abbreviationActions';
|
||||
import { getEmmetHelper, getNode, getMappingForIncludedLanguages, parseDocument, getEmmetConfiguration, getEmmetMode, isStyleSheet } from './util';
|
||||
import { getEmmetHelper, getNode, getMappingForIncludedLanguages, parsePartialStylesheet, getEmmetConfiguration, getEmmetMode, isStyleSheet, parseDocument } from './util';
|
||||
|
||||
export class DefaultCompletionItemProvider implements vscode.CompletionItemProvider {
|
||||
|
||||
@@ -40,7 +40,7 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
|
||||
validateLocation = syntax === 'html' || isStyleSheet(document.languageId);
|
||||
// If document can be css parsed, get currentNode
|
||||
if (isStyleSheet(document.languageId)) {
|
||||
const rootNode = parseDocument(document, false);
|
||||
const rootNode = document.lineCount > 1000 ? parsePartialStylesheet(document, position) : parseDocument(document, false);
|
||||
if (!rootNode) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user