Emmet suggestions in non markup/stylesheet languages #29532

This commit is contained in:
Ramya Achutha Rao
2017-06-28 13:59:28 -07:00
parent e692fc72c6
commit 7ba1dcff0c
6 changed files with 47 additions and 49 deletions

View File

@@ -17,19 +17,20 @@ import { fetchEditPoint } from './editPoint';
import { fetchSelectItem } from './selectItem';
import { evaluateMathExpression } from './evaluateMathExpression';
import { incrementDecrement } from './incrementDecrement';
import { LANGUAGE_MODES, getExcludedModes } from './util';
import { LANGUAGE_MODES, getMappingForIncludedLanguages } from './util';
import { updateExtensionsPath } from 'vscode-emmet-helper';
export function activate(context: vscode.ExtensionContext) {
let completionProvider = new DefaultCompletionItemProvider();
let excludedLanguages = getExcludedModes();
Object.keys(LANGUAGE_MODES).forEach(language => {
if (excludedLanguages.indexOf(language) > -1) {
return;
}
const provider = vscode.languages.registerCompletionItemProvider(language, completionProvider, ...LANGUAGE_MODES[language]);
context.subscriptions.push(provider);
});
let includedLanguages = getMappingForIncludedLanguages();
Object.keys(includedLanguages).forEach(language => {
const provider = vscode.languages.registerCompletionItemProvider(language, completionProvider, ...LANGUAGE_MODES[includedLanguages[language]]);
context.subscriptions.push(provider);
});
context.subscriptions.push(vscode.commands.registerCommand('emmet.wrapWithAbbreviation', (args) => {
wrapWithAbbreviation(args);