Skip to content

Missing editor syntax highlighting with svelte preprocessor defaults set. #888

@xeptore

Description

@xeptore

Describe the bug
Editor syntax highlighting goes away when svelte preprocessor defaults are set. It seems the editor falls-back to its default nature, e.g., expects all style tags to be css.

Note: All the errors and warnings are still reported fine, the only missing part is the syntax highlighting (and editor suggestions of course).

To Reproduce

  1. Add svelte.config.js with the following contents (from here, and here):
    const sveltePreprocess = require('svelte-preprocess');
    
    module.exports = {
      preprocess: sveltePreprocess({
        defaults: {
          markup: 'html',
          script: 'typescript',
          style: 'scss'
        },
      });
    };
  2. Restart the Svelte's language server by issuing Svelte: Restart Language Server VSCode command.

Expected behavior
Syntax highlighting should work fine with or without setting lang="scss" attribute on component's style tags.

Screenshots
image

System (please complete the following information):

  • OS: Linux
  • IDE: VSCode
  • Plugin/Package: Svelte for VSCode official extension

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions