diff --git a/extensions/emmet/src/test/completion.test.ts b/extensions/emmet/src/test/completion.test.ts index 728dc26a3b3..91844f69f24 100644 --- a/extensions/emmet/src/test/completion.test.ts +++ b/extensions/emmet/src/test/completion.test.ts @@ -37,6 +37,13 @@ suite('Tests for completion in CSS embedded in HTML', () => { { label: 'widows: ;', documentation: `widows: ;` } ]); }); + + // https://github.com/microsoft/vscode/issues/117020 + test('#117020, ! at end of abbreviation should have completion', async () => { + await testCssCompletionProvider(`.foo { bdbn!| }`, [ + { label: 'border-bottom: none !important;', documentation: `border-bottom: none !important;` } + ]); + }); }); interface TestCompletionItem { diff --git a/extensions/emmet/src/util.ts b/extensions/emmet/src/util.ts index 17ad4fbefec..664c0eb6a30 100644 --- a/extensions/emmet/src/util.ts +++ b/extensions/emmet/src/util.ts @@ -62,18 +62,18 @@ export const LANGUAGE_MODES: { [id: string]: string[] } = { 'haml': ['!', '.', '}', ':', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], 'xml': ['.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], 'xsl': ['!', '.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], - 'css': [':', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], - 'scss': [':', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], - 'sass': [':', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], - 'less': [':', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], - 'stylus': [':', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + 'css': [':', '!', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + 'scss': [':', '!', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + 'sass': [':', '!', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + 'less': [':', '!', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + 'stylus': [':', '!', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], 'javascriptreact': ['!', '.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], 'typescriptreact': ['!', '.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] }; export function isStyleSheet(syntax: string): boolean { let stylesheetSyntaxes = ['css', 'scss', 'sass', 'less', 'stylus']; - return (stylesheetSyntaxes.indexOf(syntax) > -1); + return stylesheetSyntaxes.includes(syntax); } export function validate(allowStylesheet: boolean = true): boolean {