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

"Unexpected attribute syntax_type on node of type scope" in stderr #453

Open
bm-w opened this issue Jul 17, 2024 · 2 comments
Open

"Unexpected attribute syntax_type on node of type scope" in stderr #453

bm-w opened this issue Jul 17, 2024 · 2 comments

Comments

@bm-w
Copy link

bm-w commented Jul 17, 2024

We’re seeing a lot of these messages in standard-error:

Unexpected attribute syntax_type on node of type scope

These are emitted here, and stem from the fact that "syntax_type" is not included in SCOPE_ATTRS:

static SCOPE_ATTRS: Lazy<HashSet<&'static str>> =
Lazy::new(|| HashSet::from([TYPE_ATTR, IS_EXPORTED_ATTR, IS_ENDPOINT_ATTR]));

I’m not sure whether "syntax_type" should be in SCOPE_ATTRS, or the attribute is erroneously added to scope nodes in TSGs — seems to me it’s the former, but I’ll leave that up to you.

@hendrikvanantwerpen
Copy link
Collaborator

hendrikvanantwerpen commented Jul 18, 2024

Thanks for the report! For which language are you getting these errors? And is this using a released version or the repo's main branch?

In principle, setting syntax_type in scope nodes doesn't make much sense, but we also allow source_node on all nodes it seems, which is kind of similar.

@bm-w
Copy link
Author

bm-w commented Jul 18, 2024

Not sure about the source language — this came from an internal report so I’ll try to chase that down. I’m pretty sure it’s one of the languages in this repo (Java/JS/Py/TS). It’s tree-sitter-stack-graphs 0.8.1

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

No branches or pull requests

2 participants