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

UI: Highlight references to variable #109

Closed
frothga opened this issue Apr 18, 2020 · 1 comment
Closed

UI: Highlight references to variable #109

frothga opened this issue Apr 18, 2020 · 1 comment

Comments

@frothga
Copy link
Collaborator

frothga commented Apr 18, 2020

Similar to a modern IDE such as Eclipse, when a given variable is selected, highlight all references to it in the same equation set.

Could create a background thread to scan the rest of the nodes in the tree and find the variable by simple string matching. The substring is very likely to be a reference if the character before and after it are not valid identifier characters. Or, we could do a limited amount of semantic matching by trying to resolve the candidate substring.

This highlight information could be attached to each tree node, and passed on to the the tree cell renderer to attach to the relevant text fields. When selection changes, this thread could be killed and replaced by a new one, or else the same thread could receive a new target and change what it is doing. There should be some delay from when a variable is focused until its references are highlighted, perhaps 500ms or so. Highlight color should be different (and more muted) than for regular selection.

@frothga frothga added this to the Release 1.1 milestone Apr 18, 2020
@frothga
Copy link
Collaborator Author

frothga commented Apr 19, 2020

The initial implementation does not use a separate thread or delay time, because it is fast enough to keep up with user interaction.

@frothga frothga closed this as completed Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant