* fix missing backslash
* fix: zls escaping colon to %3A on URIs
ZLS escapes a colon char ":" as "%3A" when encoding file paths to URIs
When decoding, need to make the target string 2 character shorter
to compensate for length decrease when replacing %3A with :
* add new failing test because of resize()
* revert changes to %3A handling - problem seems to be with allocator.resize
* switch to realloc
* Fix test failures, revert errdefer->defer
* platform-specific URI tests
URI parsing is highly platform-specific
run Unix-style (file:///home/main.zig) on non-Windows test runners,
run Windows-style (file://c%3A/main.zig) on Windows test runners
* Add smoke tests for folding ranges
* fix index out of bounds in foldingRanges
closes#801
For invalid syntax trees, zig's parser seems to return bogus data where
startToken > endToken, which then causes everything else to crash.
This seems like a deeper issue, which needs to be fixed "properly", but
let's just paper over it here.
Improves the server message we send if the system Zig version is older
than the Zig version that ZLS was built with:
- Correct typo (“build with” → “built with”).
- Show versions so users know which one they need to update to.
- Suggest step needed to fix the error (“Update Zig…”).
e.g. typing 'foo.?.bar(' crashes zls because it doesn't recognize ? as a
possible token as part of a function expression, and tries to call
getFieldAccessType with '.bar' instead.
The actual fix is the one line in src/signature_help.zig
getFieldAccessType was reworked to be more resilient to this type of
thing - the `undefined` value of `current_type.type.data` was being used
since it hit the `.period` branch first. This caused the crash.
* Added textDocument/foldingRange
* Added support for code regions
* Fixed warning message in foldingRangeHandler
Co-authored-by: LucaSas <sas.luca.alex@gmail.com>