Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snippets and Expansions not working in alternate style languages (SCSS, Sass, Less) #20

Open
shshaw opened this issue Apr 20, 2023 · 2 comments

Comments

@shshaw
Copy link
Contributor

shshaw commented Apr 20, 2023

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:
Screenshot 2023-04-20 at 1 05 24 PM

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

@shshaw
Copy link
Contributor Author

shshaw commented Sep 9, 2024

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.

Screenshot 2024-09-09 at 1 26 15 PM

@shshaw shshaw changed the title Snippet Previews Snippets and Expansions not working in alternate style languages (SCSS, Sass, Less) Sep 9, 2024
@sergeche
Copy link
Member

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;'
                    }
                }
            }
        })),
    ]
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants