Open shshaw opened 1 year ago
Updating this to say that snippets and expansions don't seem to be working in SCSS, Sass and LESS anymore, not just the preview.
I'm setting the syntax
based on the EmmetKnownSyntax
so it should be resolving to the correct internal value.
That’s a bit weird one: you should explicitly provide emmetCompletionSource
extension as autocomplete
option of SASS lang. Your config may look like this:
import { sass, sassLanguage } from '@codemirror/lang-sass';
import { emmetCompletionSource, EmmetKnownSyntax.scss } from '@emmetio/codemirror6-plugin';
new EditorView({
doc: text,
extensions: [
basicSetup,
sass(),
sassLanguage.data.of({
// configure Emmet as completion provider for SASS lang
autocomplete: emmetCompletionSource
}),
Prec.high(abbreviationTracker({
// don’t forget to explicitly specify current syntax to Emmet
syntax: EmmetKnownSyntax.scss,
config: {
stylesheet: {
snippets: {
my: 'padding: 10px;'
}
}
}
})),
]
});
Related to #14: I have the new
syntax
setup in place. Snippets work correctly, but the snippet autocompletions are not showing up for Sass and SCSS. CSS still shows them fine.Sass: https://user-images.githubusercontent.com/777155/233471378-15fb816b-5caf-4134-b67c-871e7b37dd9b.mov
Regular CSS:
I haven't tested the other languages, but I'll provide more details if I do.
Worth noting that I'm using the just released https://github.com/codemirror/lang-sass package via the latest version of https://github.com/codemirror/language-data