-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Added html language implementation #385
Conversation
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.
This looks good with a couple minor comments.
- Also would be good to add a test to make sure that plaintext tag angle pair works the same as in html
@@ -0,0 +1,29 @@ | |||
languageId: 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.
I wonder if "clear" should leave the angles. Can't decide
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.
Take and clear always have the same range so far. I don't want to change that
src/test/suite/fixtures/recorded/languages/html/takeBoundsBatt.yml
Outdated
Show resolved
Hide resolved
I added a plaintext version as well |
yeah was worried about that. what happens if you switch the order like this? |
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.
Ok looks great. I left one more thing. Also thought of one more quick test case:
- test having parens inside a string to make sure it properly reverts to text-based when inside a string
- Also parens inside a comment
src/test/suite/fixtures/recorded/surroundingPair/html/clearBoundsOx2.yml
Outdated
Show resolved
Hide resolved
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.
Ok looks good with one last question
node: SyntaxNode, | ||
selection: SelectionWithEditor | ||
) { | ||
if (node.type === "attribute_value") { |
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.
Will an attribute value always be a string?
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.
No. But it's the only type that can contain other matching pairs
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.
Ok so this is a hack, then, right? Because there might be things that are children that are not strings? It's ok if it's a hack, we should just document that in a comment
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.
You could also just check node parent type as well maybe?
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.
Or check that it has first and last child of type "
?
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.
I wouldn't say it's a hack. It is a type that can contain text based matching pairs. But I can't contain any children in the tree sitter as far as I know. I tried with few different values and it all behaved as expected.
No description provided.