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

feat: add thrift #401

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

feat: add thrift #401

wants to merge 1 commit into from

Conversation

amaanq
Copy link
Member

@amaanq amaanq commented Feb 28, 2023

This is my first time writing a textobjects.scm file - I would appreciate critique.

For the weird queries at the top, I don't want to match assignments that could, say, have optional attributes above them, only the qualifiers, identifier, and value. I hope I did it right but maybe it's better to use #make-range! here.


(exception) @class.outer
(exception
"{" (_) @class.inner "}")
Copy link
Member

Choose a reason for hiding this comment

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

this is guaranteed to be only one node?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a repeat of "field"

Copy link
Member Author

Choose a reason for hiding this comment

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

image

Copy link
Member

Choose a reason for hiding this comment

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

so it could be multiple nodes and this query wouldn't work then

@kiyoon
Copy link
Collaborator

kiyoon commented Mar 6, 2023

Thank you. I didn't check everything yet, but assignment.inner should select either LHS or RHS of the assignment. So depending on your cursor location it should select left or right.

In my experience, if you put assignment.inner on both side in one query, then it will ignore one of them. So I recommend you to copy the query and add an inner for the left side.

@kiyoon
Copy link
Collaborator

kiyoon commented Mar 6, 2023

Also, sorry for the delay. There are languages I understand better and others that I don't know very well. If you don't mind, I'd appreciate if you can provide with a sample code that can test all of the textobjects you've defined. If not, don't worry, I'll also look into finding them. It's just for ease of testing, and plus documenting what kind of cases are tested.

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.

3 participants