Skip to content

Commit

Permalink
(fix) emmet completions for sass (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Aug 4, 2020
1 parent fd3c8f0 commit 1695e38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/language-server/src/plugins/css/CSSPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getEmmetCompletionParticipants } from 'vscode-emmet-helper';
import { getEmmetCompletionParticipants, doComplete as doEmmetComplete } from 'vscode-emmet-helper';
import {
Color,
ColorInformation,
Expand Down Expand Up @@ -119,10 +119,16 @@ export class CSSPlugin
}

const cssDocument = this.getCSSDoc(document);
if (!cssDocument.isInGenerated(position) || isSASS(cssDocument)) {
if (!cssDocument.isInGenerated(position)) {
return null;
}

if (isSASS(cssDocument)) {
// the css language service does not support sass, still we can use
// the emmet helper directly to at least get emmet completions
return doEmmetComplete(document, position, 'sass', {});
}

const type = extractLanguage(cssDocument);
const lang = getLanguageService(type);
const emmetResults: CompletionList = {
Expand Down
2 changes: 2 additions & 0 deletions packages/svelte-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@
"text.html": "html",
"text.pug": "jade",
"source.css": "css",
"source.css.less": "less",
"source.css.scss": "scss",
"source.sass": "sass",
"source.js": "javascript",
"source.ts": "typescript"
}
Expand Down

0 comments on commit 1695e38

Please sign in to comment.