DanielGavin / ols

Language server for Odin
MIT License
375 stars 56 forks source link

`foreign import` library path corrupted after code format #399

Closed ccll closed 1 month ago

ccll commented 1 month ago

After OLS in VSCode updated automatically to latest nightly (20224-06-03), when Odin files were saved and auto formated, the foreign import ... statements will be corrupted.

The original file:

when ODIN_DEBUG {
    foreign import uv "../../vcpkg/installed/x64-linux/debug/lib/libuv.a"
} else {
    foreign import uv "../../vcpkg/installed/x64-linux/lib/libuv.a"
}
foreign import uv_wrapper "../../build/lib/uv_wrapper.a"

After format:

when ODIN_DEBUG {
    foreign import uv foreign
} else {
    foreign import uv foreign
}
foreign import uv_wrapper foreign

I like OLS a lot, the intellisense and format are very fast and accurate, but the nightly release scheme is a bit frightening. I'm wondering if it can be released under a semantic versioning scheme, allowing user to pin-point a version they prefer in VSCode settings.

DanielGavin commented 1 month ago

Yeah it was caused by a change in core:odin/parser. It is more my fault that my format tests actually failed, but for some reason it doesn't fail the nightly build. It should have been caught. Regarding semantic versioning, it sounds like a good idea, but not sure if I have time to add it now.

DanielGavin commented 1 month ago

It is now fixed in the latest odin version. I'll rebuild the nightly now.

ccll commented 1 month ago

Totally understood. Thanks for your great work despite limited time. ❤️