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

Support for local queries #107

Closed
wants to merge 4 commits into from
Closed

Support for local queries #107

wants to merge 4 commits into from

Conversation

jcs090218
Copy link
Member

Feature for #94.

(defface tree-sitter-hl-face:local.reference
'((default :inherit font-lock-variable-name-face))
"Face for new local reference."
:group 'tree-sitter-hl-faces)
Copy link
Member Author

Choose a reason for hiding this comment

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

These are listed here.

(message "Copying queries for %s" lang-symbol)
(when (and force (file-directory-p dst-dir))
(delete-directory dst-dir t))
(copy-directory src dst-dir nil t t)))))
Copy link
Member Author

Choose a reason for hiding this comment

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

Local query seems located in locals.scm and not highlight.scm.

Do you think we can just pull the entire query files down?

(dolist (query quries)
(insert-file-contents query)
(goto-char (point-max))
(insert "\n"))))
Copy link
Member Author

Choose a reason for hiding this comment

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

Load all quires at a time.

@shackra shackra added the enhancement New feature or request label Feb 9, 2021
@ubolonton
Copy link
Collaborator

IIRC, local queries are used by upstream in a separate query pass, which then provides data for .is-local? predicates in highlighting queries. Concatenating them wouldn't work.

Did you get a working behavior instead?

@jcs090218
Copy link
Member Author

Okay, sorry about this PR. I thought it would work in the first place. Although the highlighting did work but every thing seems to be highlighted as local variable too which is an unexpected behaviour. 😢

I would like to implement this feature. Do you know where I should start?

@jcs090218 jcs090218 closed this Feb 17, 2021
@ubolonton
Copy link
Collaborator

I would like to implement this feature. Do you know where I should start?

I just added some notes to #94.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants