Closed Gepar closed 6 years ago
Thank you for fixing this. I have some work in progress in RegExp parser, I'll integrate this and publish soon.
createSymbolItem check and create symbol only if known, so I must check the return before using it. There is several locations to fix.
Fix in version 1.5.0
Method getSymbolsSpec of RegExParser can sometimes cause errors when try "go to definition": I fixed it by replacing code
symbol = this.createSymbolItem(found[2], found[3], found.index, parent, false);
symbol.offsetEnd = this.regExpS.lastIndex;
withsymbol = this.createSymbolItem(found[2], found[3], found.index, parent, false);
if(symbol){
symbol.offsetEnd = this.regExpS.lastIndex;
}
After that feature "go to definition" started working again. But it will be better to fix original method createSymbolItem that should not return undefined for unknown keywords.