mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 12:33:35 +01:00
Get emmet completions from css extension (#41652)
* Get emmet completions from html,css extensions * Resolve extensionsPath, use emmet results even if empty * Support css abbr with : * Refactoring * Add some basic emmet tests * Refactoring * More tests
This commit is contained in:
@@ -8,7 +8,6 @@ import parse from '@emmetio/html-matcher';
|
||||
import parseStylesheet from '@emmetio/css-parser';
|
||||
import { Node, HtmlNode, CssToken, Property, Rule } from 'EmmetNode';
|
||||
import { DocumentStreamReader } from './bufferStream';
|
||||
import * as path from 'path';
|
||||
|
||||
let _emmetHelper: any;
|
||||
let _currentExtensionsPath: string | undefined = undefined;
|
||||
@@ -26,17 +25,9 @@ export function resolveUpdateExtensionsPath() {
|
||||
return;
|
||||
}
|
||||
let extensionsPath = vscode.workspace.getConfiguration('emmet')['extensionsPath'];
|
||||
if (extensionsPath && !path.isAbsolute(extensionsPath)) {
|
||||
extensionsPath = path.join(vscode.workspace.rootPath || '', extensionsPath);
|
||||
}
|
||||
if (_currentExtensionsPath !== extensionsPath) {
|
||||
_currentExtensionsPath = extensionsPath;
|
||||
if (_currentExtensionsPath && !path.isAbsolute(_currentExtensionsPath)) {
|
||||
vscode.window.showErrorMessage('The path provided in emmet.extensionsPath setting should be absolute path');
|
||||
_emmetHelper.updateExtensionsPath();
|
||||
return;
|
||||
}
|
||||
_emmetHelper.updateExtensionsPath(_currentExtensionsPath).then(null, (err: string) => vscode.window.showErrorMessage(err));
|
||||
_emmetHelper.updateExtensionsPath(extensionsPath, vscode.workspace.rootPath).then(null, (err: string) => vscode.window.showErrorMessage(err));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +54,6 @@ const emmetModes = ['html', 'pug', 'slim', 'haml', 'xml', 'xsl', 'jsx', 'css', '
|
||||
// For other languages, users will have to use `emmet.includeLanguages` or
|
||||
// language specific extensions can provide emmet completion support
|
||||
export const MAPPED_MODES: Object = {
|
||||
'handlebars': 'html',
|
||||
'php': 'html'
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user