-
Notifications
You must be signed in to change notification settings - Fork 215
Fix hovers and conflicts in Vue <style lang="sass">
blocks
#930
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
Conversation
Ah figured it out, I had to manually go into each |
): DocumentClassList[] { | ||
const text = getTextWithoutComments(doc, 'css', range) | ||
let regex = isSemicolonlessCssLanguage(doc.languageId, state.editor?.userLanguages) | ||
let regex = isSemicolonlessCssLanguage(lang ?? doc.languageId, state.editor?.userLanguages) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question, in what scenario would lang
and doc.languageId
be different?
is that when you have <style lang="sass">
in an html or vue file where lang
will be sass
and doc.languageId
would be html
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vue file with a <style> block or a <script> block. Also HTML file with a <script> block. doc
always refers to the whole file/document rather than just a portion of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha yep that's what I meant and thought. Thanks for verifying!
We can't make them a part of the normal project workspace because of dependency hoisting, unfortunately. If there's a way to disable hoisting but still use workspaces I'd use them for all of these. |
I need to fix the test:prepare script though, good call. I'll do that in a separate PR. |
We weren't parsing these blocks as Sass (or any semicolon-less language) and we were instead assuming CSS syntax. Because of this we wouldn't pick up conflicts when we should and sometimes would pick up conflicts when we shouldn't.
This PR fixes this by handling language boundaries on hover and threading language information from
<style lang="…">
blocks.Fixes #895