Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Koneki » feature request: highlight globals
feature request: highlight globals [message #835000] Mon, 02 April 2012 13:05 Go to next message
Jay Carlson is currently offline Jay Carlson
Messages: 2
Registered: April 2012
Junior Member
One of the most common errors in Lua is to misspell an identifier. If you have
local tests
print(test)
test will refer to a global. The AST contains this information. Many code styles, especially for modules, do not use globals much outside of local foo=foo imports. A visual highlight on test in
print(test)
would help people coding this way.

I don't know much about the DLTK, but Smalltalk has a cheap non-typed typo checker for method selectors. Translated to Lua, an occurrence of foo.testt is likely to be a typo unless somewhere else in the program any
bar.testt=...
exists. That seems harder though.
Re: feature request: highlight globals [message #837425 is a reply to message #835000] Thu, 05 April 2012 12:46 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin Cabé
Messages: 151
Registered: July 2009
Location: Toulouse, France
Senior Member

Jay,

Semantic highlighting would be a great addition indeed, especially to spot typos more easily as you suggest.
Could you please file a feature request in the bug tracker of the project?

Thanks for the suggestion!
Re: feature request: highlight globals [message #839425 is a reply to message #837425] Sun, 08 April 2012 13:52 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin Cabé
Messages: 151
Registered: July 2009
Location: Toulouse, France
Senior Member

Benjamin Cabe wrote on Thu, 05 April 2012 18:46

Could you please file a feature request in the bug tracker of the project?


I have just opened bug 376301, and the fix is on its way Smile.
It will be committed in the github fork, since this is where the AST is in a good enough shape.
Re: feature request: highlight globals [message #840041 is a reply to message #839425] Mon, 09 April 2012 11:40 Go to previous message
Jay Carlson is currently offline Jay Carlson
Messages: 2
Registered: April 2012
Junior Member
Cool! I'm sorry I didn't get to the tracker--work got crazy.

There are probably a lot of interesting things that can be done once the AST is exposed to the highlight engine. I had no idea how to start. Thanks.
Previous Topic:debugging lua 5.2
Next Topic:"realtime" console update?
Goto Forum:
  


Current Time: Thu Apr 17 23:35:30 EDT 2014

Powered by FUDForum. Page generated in 0.04091 seconds