ols icon indicating copy to clipboard operation
ols copied to clipboard

On save server exits in Helix editor

Open mitjafelicijan opened this issue 1 year ago • 3 comments

I have installed ols and when I start editing a file (which compiles and works properly) the server crashes and I get a notification in the editor Language server exited.

Below are the logs from Helix editor.

46918  -02-20T11:58:35.204 helix_lsp::transport [ERROR] ols err <- "/home/runner/work/ols/ols/src/server/requests.odin(1175:59) Index 0 is out of range 0..<0\n"
1  -02-20T11:58:35.347 helix_lsp::transport [ERROR] ols err: <- StreamClosed

I am using Fedora 39.

Is there anything else I paste here?

Thanks

mitjafelicijan avatar Feb 20 '24 11:02 mitjafelicijan

It looks like you need ols.json in your project. Helix doesn't make a project workspace without it. That apparently causes the server to crash.

DanielGavin avatar Feb 20 '24 22:02 DanielGavin

That worked like a charm. Thank you.

LSP formatting works. Also works if there are errors in the code. I also get snippet recommendations. But I am not getting autocomplete suggestion when I type let's say fmt..

Am I still missing something?

This is my ols.json I have in the project.

{
  "collections": [
    {
      "name": "core",
      "path": "~/Applications/odin/core"
    },
    {
      "name": "vendor",
      "path": "~/Applications/odin/vendor"
    }
  ],
  "thread_pool_count": 4,
  "enable_semantic_tokens": false,
  "enable_document_symbols": true,
  "enable_hover": true,
  "enable_format": true,
  "enable_snippets": true,
  "formatter": {
    "tabs": false,
    "characters": 90
  }
}

mitjafelicijan avatar Feb 21 '24 07:02 mitjafelicijan

There seems to be a bug in ~. Try with absolute path. You can potentially also remove the collections, if the odin is in path, it should be able to find them without collections.

DanielGavin avatar Feb 21 '24 08:02 DanielGavin