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

Can't handle override syntax in the last line of the file #9

Closed
WilsonZiweiWang opened this issue Nov 8, 2023 · 2 comments
Closed

Comments

@WilsonZiweiWang
Copy link
Contributor

WilsonZiweiWang commented Nov 8, 2023

Version:
1.0.1

Current behaviour:
The same overrides syntax in tree-sitter is treated differently as shown in these screenshots. When it is not in the last line in the file, it is treated as the override (even though it is still picking up the content following). When it is in the last line, it is treated as an identifier and nothing related to override anymore.
image
image

Expectation:
When it encounters MYVAR:a: in the last line of the file, it still treats it as overrides or partially. This is an override statement yet to be completed and it will benefit the completion in language extension.

Good to have:
When it encounters MYVAR:a: not in the last line of the file, the current one is enough to identify an override syntax to perform further actions. But it will be nice if it won't pick up the content following as part of the override syntax.

@WilsonZiweiWang
Copy link
Contributor Author

I just realized that variable expansion in override is not handled:
FILES:${PN}:append = "/usr/bin/example"
image

It would be nice to treat it as override statement's child even in a case like this:
FILES:${PN}: = "/usr/bin/example" where the second override is about to be typed after the :
image

@amaanq
Copy link
Member

amaanq commented Nov 11, 2023

tree-sitter's error recovery can't be fine tuned for specific cases, it's a general error recovery mechanism so I'm not going to fix this - but the valid variable expansion code has been fixed

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