zabel-xyz / plsql-language

plsql-language for vscode
MIT License
78 stars 29 forks source link

RegExParser needs some improvements #52

Closed Gepar closed 6 years ago

Gepar commented 6 years ago

Method getSymbolsSpec of RegExParser can sometimes cause errors when try "go to definition": err I fixed it by replacing code symbol = this.createSymbolItem(found[2], found[3], found.index, parent, false); symbol.offsetEnd = this.regExpS.lastIndex; with symbol = 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.

zabel-xyz commented 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.

zabel-xyz commented 6 years ago

Fix in version 1.5.0