PhilippeChab / nwscript-ee-language-server

A NWScript Language Server.
https://marketplace.visualstudio.com/items?itemName=PhilippeChab.nwscript-ee-language-server
MIT License
20 stars 7 forks source link

Error when adding ovr folder as a symlink in workspace directory to get syntax highlighting for nw_inc_nui #31

Closed Liareth closed 2 years ago

Liareth commented 2 years ago
c:\Users\Lia\.vscode\extensions\philippechab.nwscript-ee-language-server-1.4.0\server\out\Tokenizer\Tokenizer.js:50
        return line.slice(token.startIndex, token.endIndex);
                                ^

TypeError: Cannot read properties of undefined (reading 'startIndex')
    at Tokenizer.getRawTokenContent (c:\Users\Lia\.vscode\extensions\philippechab.nwscript-ee-language-server-1.4.0\server\out\Tokenizer\Tokenizer.js:50:33)
    at Tokenizer.getTokenLanguageType (c:\Users\Lia\.vscode\extensions\philippechab.nwscript-ee-language-server-1.4.0\server\out\Tokenizer\Tokenizer.js:56:33)
    at Tokenizer.tokenizeLinesForGlobalScope (c:\Users\Lia\.vscode\extensions\philippechab.nwscript-ee-language-server-1.4.0\server\out\Tokenizer\Tokenizer.js:169:46)
    at Tokenizer.tokenizeContent (c:\Users\Lia\.vscode\extensions\philippechab.nwscript-ee-language-server-1.4.0\server\out\Tokenizer\Tokenizer.js:293:25)
    at generateTokens (c:\Users\Lia\.vscode\extensions\philippechab.nwscript-ee-language-server-1.4.0\server\out\Documents\DocumentsIndexer.js:19:39)

The ovr folder contents are from the latest preview. I binary chopped the contents of the ovr folder until I figured out that simply including nw_inc_nui in your workspace causes this error.

PhilippeChab commented 2 years ago

Thank you for reporting this!

I have the same error with the current version of the file. I'll look into this.

PhilippeChab commented 2 years ago

Fixed in 1.4.1.