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

attempt to fix attrs #394

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Lazyuki
Copy link
Member

@Lazyuki Lazyuki commented Dec 16, 2022

Another attempt at fixing #292

It kind of works with attrs but I need to see why it's changing so many irrelevant tests.

@@ -10,15 +10,15 @@ assignees: ""
A clear and concise description of what the bug is.
If you're planning on posting a screenshot, please paste the accompanying code here.

**Screenshot**
**Screenshot**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are these spaces coming from? Do you have prettier installed? Do I need to add some rules?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume prettier changed it. Not sure what rule it is though

@@ -109,7 +109,7 @@
},
{
"c": "div",
"t": "source.js meta.var.expr.js string.quoted.double.ts",
"t": "source.js meta.var.expr.js string.quoted.double.js.jsx",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come the extensions have changed to jsx.js here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's the part I'm trying to fix if possible. source.ts#expression doesn't parse JSX so I added source.js.jsx as one of the includes. But that changed some of these scopes in unwanted places. Although if you open VSCode you don't really see the difference in colors.

@jasonwilliams
Copy link
Collaborator

jasonwilliams commented Feb 4, 2023

It kind of works with attrs but I need to see why it's changing so many irrelevant tests.

So it's because the new rule you've created is matching existing lines and that's why it's changing irrelevant tests.
Here is an example with the component.js fixture.

Here is your rule put into regex101 and a component fixture added as the body.
https://regex101.com/r/GcqXnV/1

Is there a way we can update an existing rule without having a very similar one? Or we will need to change this rule so it doesn't affect existing lines. (make the regex more specific maybe).

This may be a separate issue but using this as an example: We can see it leaks scopes here:
image

meta.var.expr.tsx is still on the stack, so this rule is causing some weird side effects (it doesn't happen when I remove it).

@@ -75,7 +75,7 @@
},
{
"contentName": "source.css.scss",
"begin": "(?:}>|\\)\\))(`)",
"begin": "(?:}>)(`)",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(?:}>|\\)\\))()` was needed to catch multi-line rules.
here is an example

Although the fact you adjusted this I guess you was aware of that and thats why you made a new rule?

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

Successfully merging this pull request may close these issues.

None yet

2 participants