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

identify (highlight/annotate) globals in the editor #125

Open
pq opened this issue Jul 4, 2018 · 3 comments
Open

identify (highlight/annotate) globals in the editor #125

pq opened this issue Jul 4, 2018 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@pq
Copy link
Collaborator

pq commented Jul 4, 2018

this has come up a few times in conversation but i don't think there's an issue tracking. anyway, user trickyflemming on lines was snagged when overwriting metro:

I was finally bitten by the globals last night. I was working on a script and I created an array called metro. Hoo boy, norns did not like that. The error text was not useful so it took a bit of hunting to figure out what happened. I had to replace the offending variable, resave the script, and then reboot norns to fix it.

and suggested

One quick solution for the globals issue would be to add the globals to matron’s syntax highlighting. They could be a bright red to quickly show that they are not available variable names.

👍

see also: monome/norns#426 and monome/norns#425

@pq pq added the enhancement New feature or request label Jul 4, 2018
@pq
Copy link
Collaborator Author

pq commented Jul 4, 2018

also worth possibly printing something useful in the repl on script load (discussion on monome/norns#426).

i have some ideas for how this could happen while fixing the lagging lua syntax support #9; currently investigating!

also related: monome/norns#436

@pq pq self-assigned this Jul 4, 2018
@mhetrick
Copy link

mhetrick commented Jul 7, 2018

I had another idea:

Currently, maiden has a red "X" that appears (almost too frequently!) on lines with errors or incomplete statements.

A yellow "!" would be useful on lines that contain redeclarations of or assignments to global variables. Mousing over this would provide a warning message that the variable exists as a global and that this could provide unexpected behavior.

@pq
Copy link
Collaborator Author

pq commented Jul 8, 2018

A yellow "!" would be useful on lines that contain redeclarations of or assignments to global variables.

👍

also maybe promising is to draw attention to the global functions you have (rightly) redefined because they serve as norns callbacks (, e..g., enc, gridkey, etc.) . in my head this is sort of like how "overrides" are decorated in the gutter of some editors, for example Java in IDEA:

image

@pq pq changed the title indentify (highlight/annotate) globals in the editor identify (highlight/annotate) globals in the editor Jul 12, 2018
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

No branches or pull requests

2 participants