language-javascript-semantic
language-javascript-semantic copied to clipboard
Scope analysis
trafficstars
It would be great if the same identifier got a different colour if it was declared in a different scope. e.g.
function read(path) {
}
function write(path) {
}
Those two path variables refer to different things.
I agree, but this is unfortunately impossible with Acorn as it does not really support incremental parsing (I just hacked it so it "kind of" does).
What about this case?
function hello() {
this.state = {
test: '.text'
}
this.state.test = 'i am a local variable'
test = 'i am a global variable'
}
The word 'test' is highlighted in the same color in both cases but I'm guessing its a difficult thing to fix with the current implementation for the same reason stated above.