Skip to content

Skip bindings for assignments in @. #320

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

Merged

Conversation

BenPH
Copy link
Contributor

@BenPH BenPH commented Dec 2, 2021

For any assignment this checks that none of its ancestors is an @. call before marking a binding. I'm happy to hear any suggestions if there is a better approach.

Fixes julia-vscode/julia-vscode#2514

pfitzseb
pfitzseb previously approved these changes Dec 2, 2021
Copy link
Member

@pfitzseb pfitzseb left a comment

Choose a reason for hiding this comment

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

I think this is fine. Bit concerned that iterating arbitrarily far up in the CST in too many places is gonna tank performance though...

@BenPH
Copy link
Contributor Author

BenPH commented Dec 2, 2021

That was my concern too. There could be a limit where it stops. But maybe the better approach is to have some kind of flag once you enter an @. macro call that gets checked at assignments. I wasn't sure how to implement that without changing too much.

@pfitzseb
Copy link
Member

pfitzseb commented Dec 2, 2021

So I think we can add a state field to the various States that can disable certain functionality for all children of the current node (since traverse is depth-first). I can push a proof of concept to your branch if you want.

to cut down on tree traversal
@pfitzseb
Copy link
Member

pfitzseb commented Dec 2, 2021

Man, working across forks is annoying...
Anyways, what do you think about BenPH#1?

…nments-in-@__dot__

feature flag approach
@BenPH
Copy link
Contributor Author

BenPH commented Dec 3, 2021

I like it. Very clean. That's a neat trick with the bit arithmetic for the flags.

@pfitzseb pfitzseb merged commit 30902d0 into julia-vscode:master Dec 3, 2021
@BenPH BenPH deleted the skip-bindings-for-assignments-in-@__dot__ branch January 24, 2023 04:44
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.

local variable used but hint shows it is not used
2 participants