SpontanCombust / witcherscript-ide

Language Server implementation for WitcherScript - Witcher 3's scripting language.
https://spontancombust.github.io/witcherscript-ide/
Apache License 2.0
10 stars 0 forks source link

[BUG] Weird line endings causing parser malfunction #31

Closed SpontanCombust closed 4 weeks ago

SpontanCombust commented 1 month ago

Some Witcher 3 script files in the vanilla codebase have weird line endings that have only the CR (0x0D) byte instead of CRLR (0x0D, 0x0A). This causes the parser to parse the file incorrectly.

A quick and easy fix for such files is simply saving them (Ctrl + S). This prompts the VSCode to send a fixed text representation of the file in the server notification and the script can then be reparsed properly.

Either implement a fix for this or state somewhere in the README that this can happen.

SpontanCombust commented 1 month ago

Visible indication of the bug are "This type does not take any type arguments" diagnostics being displayed in completely random spots in affected files.

SpontanCombust commented 1 month ago

Correction: CTRL + S does seem to fix the file, but only temporarily. If you attempt to edit it, even if just by adding a space, the entire file will be red from errors until you save it manually yet again.

SpontanCombust commented 1 month ago

Saving the file wasn't working because document buffers were not getting refreshed. This aspect of the issue has been fixed in 04d889c.

SpontanCombust commented 4 weeks ago

Released with v0.3.0