mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Explicit mapping for langs whose parent are emmet supported #28545
This commit is contained in:
@@ -10,7 +10,7 @@ import parseStylesheet from '@emmetio/css-parser';
|
||||
import parse from '@emmetio/html-matcher';
|
||||
import Node from '@emmetio/node';
|
||||
|
||||
import { getSyntax, getProfile, getVariables, isStyleSheet, getNode, getInnerRange } from './util';
|
||||
import { getSyntax, getProfile, getVariables, isStyleSheet, getNode, getInnerRange, getMappedModes } from './util';
|
||||
import { DocumentStreamReader } from './bufferStream';
|
||||
|
||||
const field = (index, placeholder) => `\${${index}${placeholder ? ':' + placeholder : ''}}`;
|
||||
@@ -42,17 +42,12 @@ export function expandAbbreviation() {
|
||||
return;
|
||||
}
|
||||
let syntax = getSyntax(editor.document);
|
||||
let mappedSyntax = false;
|
||||
let emmetConfig = vscode.workspace.getConfiguration('emmet');
|
||||
if (emmetConfig && emmetConfig['syntaxProfiles']) {
|
||||
let syntaxProfiles = emmetConfig['syntaxProfiles'];
|
||||
if (typeof syntaxProfiles[syntax] === 'string') {
|
||||
syntax = syntaxProfiles[syntax];
|
||||
mappedSyntax = true;
|
||||
}
|
||||
}
|
||||
let mappedSyntax = getMappedModes()[syntax];
|
||||
|
||||
if (!mappedSyntax) {
|
||||
syntax = syntaxHelper(syntax, editor.document, editor.selection.end);
|
||||
} else {
|
||||
syntax = mappedSyntax;
|
||||
}
|
||||
if (!syntax) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user