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

Explore 'vscode-css-languageservice' as default parser for all files #92

Closed
mrmlnc opened this issue Nov 22, 2019 · 4 comments
Closed
Milestone

Comments

@mrmlnc
Copy link
Owner

mrmlnc commented Nov 22, 2019

Now the scss-symbols-parser package is outdated and has a some bugs. For example, this package does not support @use and cannot parse correctly the following content from Bootstrap:

$grid-breakpoints: (
  xs: 0,
  sm: 576px,
  md: 768px,
  lg: 992px,
  xl: 1200px
) !default;

@include _assert-ascending($grid-breakpoints, "$grid-breakpoints");
@include _assert-starts-at-zero($grid-breakpoints, "$grid-breakpoints");

$container-max-widths: (
  sm: 540px,
  md: 720px,
  lg: 960px,
  xl: 1140px
) !default;

@include _assert-ascending($container-max-widths, "$container-max-widths");

Previously we switch parser by performance issues. Right now (for me) this is not a important development direction of this plugin.

@mrmlnc
Copy link
Owner Author

mrmlnc commented Nov 22, 2019

https://github.com/twbs/bootstrap/blob/master/scss/_variables.scss

vscode-css-languageservice: 82.553ms
scss-symbols-parser: 7.821ms  # with fix
postcss-scss: 25.152ms

@mrmlnc mrmlnc changed the title Explore 'vscode-css-languageservice' as default parser for all files Explore 'vscode-css-languageservice'/'postcss-scss' as default parser for all files Nov 22, 2019
@mrmlnc mrmlnc changed the title Explore 'vscode-css-languageservice'/'postcss-scss' as default parser for all files Explore 'vscode-css-languageservice' as default parser for all files Nov 22, 2019
@mrmlnc mrmlnc mentioned this issue Nov 22, 2019
12 tasks
@mrmlnc
Copy link
Owner Author

mrmlnc commented Nov 22, 2019

As part of this ticket, we must fix the problem in the scss-symbols-parser.

https://github.com/mrmlnc/scss-symbols-parser/blob/e82822155161c2e4ffed2099b3448961e6fbde84/src/index.ts#L114

- } else if (token[0] === ')' && tokens[pos + 1] && tokens[pos + 1] === ';') {
+ } else if (token[0] === ')' && tokens[pos + 1] && tokens[pos + 1][0] === ';') {

@octref
Copy link
Collaborator

octref commented Nov 22, 2019

Yeah, me and @aeschli would be happy if we can share the parser can fix bug together.
FYI there's already a PR for adding @use and I'm planning to review and pull it in soon.
microsoft/vscode-css-languageservice#183

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