DanielGavin / ols

Language server for Odin
MIT License
382 stars 58 forks source link

Can't use `~/...` in collections path #281

Closed joakin closed 3 months ago

joakin commented 7 months ago

Hi!

I was trying to configure my collections like this:

  "collections": [
    {
      "name": "core",
      "path": "~/dev/forks/Odin/core"
    }
  ],

But it doesn't seem to work.

If I change it to an absolute path it does work.

Would it be possible to expand paths so that ~/ would work? It would be very helpful to keep a single ols committed in the repo across machines without having to update the user name on each machine and keeping a dirty file I can't commit.

DanielGavin commented 7 months ago

It is already a case that should be handled.

What is the value of $HOME?

joakin commented 6 months ago
→ echo $HOME
/home/joakin

This works:

{
  "collections": [
    { "name": "core", "path": "/home/joakin/dev/forks/Odin/core" }
  ]
}

But this doesn't

{
  "collections": [{ "name": "core", "path": "~/dev/forks/Odin/core" }]
}

This is on windows under WSL:

→ uname -a
Linux DESKTOP-THEJR4U 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Let me know if there is anything else I can do to help debug