SpartanJ / ecode

Lightweight multi-platform code editor designed for modern hardware with a focus on responsiveness and performance.
MIT License
938 stars 13 forks source link

Error initializing typescript-language-server on windows #310

Closed blikblum closed 2 months ago

blikblum commented 3 months ago

Using ecode 0.6 on windows 10

Opening a folder with a js project i receive a notification: "LSP Server typescript-language-server failed to initialize, received some error:"

Installed typescript-language-server using npm install -g typescript-language-server typescript as described in typescript-language-server project

Languages health tool recognizes typescript-language-server

Running typescript-language-server --stdio on terminal works

App log:

2024-08-10 22:09:59 - INFO: Texture ID 26 loaded in 4.036 ms.
2024-08-10 22:09:59 - WARNING: LSPClientServer server typescript-language-server Send for non-running server: typescript-language-server
2024-08-10 22:09:59 - INFO: Displayed notification:
LSP Server typescript-language-server failed to initialize, received some error:
2024-08-10 22:09:59 - INFO: Texture ID 27 loaded in 0.718 ms.
2024-08-10 22:10:03 - INFO: Texture ID 28 loaded in 0.639 ms.
2024-08-10 22:10:03 - ERROR: ERROR WinAPI: A ౥a de dados transferida para uma chamada do sistema 短uito pequena.
2024-08-10 22:10:03 - WARNING: LSPClientServer server typescript-language-server Send for non-running server: typescript-language-server
2024-08-10 22:10:30 - WARNING: LSPClientServer server typescript-language-server Send for non-running server: typescript-language-server
2024-08-10 22:11:17 - WARNING: LSPClientServer server typescript-language-server Send for non-running server: typescript-language-server
2024-08-10 22:13:09 - WARNING: LSPClientServer server typescript-language-server Send for non-running server: typescript-language-server
2024-08-10 22:13:20 - WARNING: LSPClientServer server typescript-language-server Send for non-running server: typescript-language-server

System info

Version: eepp version 2.8.0 (codename: "Siddhi")    Build time: Jul 20 2024 00:53:31
    Platform: Windows
    OS: Microsoft Windows 10
    Arch: x64
    CPU Cores: 8
    Process Path: C:\bin\code\ecode\
    Current Working Directory: C:\bin\code\ecode
    Disk Free Space: 16.70 GiB
    Window/Input Backend: SDL 2.30.3
    GL Backend: OpenGL 2
    GL Vendor: Intel
    GL Renderer: Intel(R) HD Graphics 630
    GL Version: 4.6.0 - Build 31.0.101.2128
    GL Shading Language Version: 4.60 - Build 31.0.101.2128
    Resolution: 1920x1017
SpartanJ commented 3 months ago

Oh, I never used the ts server on Windows, it seems that it's distributed with several binaries with the same name but different extension, the server won't run unless you set the full path of the LSP. With the current ecode version you can go to: Settings -> Tools -> Plugin Manager -> select/click LSP Client -> Click Preferences -> edit the file adding your server configuration, it will look like:

{
  "config": {
    "disable_semantic_highlighting_lang": [],
    "hover_delay": "1s",
    "semantic_highlighting": true,
    "server_close_after_idle_time": "1m",
    "silent": false,
    "trim_logs": false
  },
  "keybindings": {
    "lsp-format-range": "alt+shift+f",
    "lsp-go-to-declaration": "",
    "lsp-go-to-definition": "f2",
    "lsp-go-to-implementation": "shift+f2",
    "lsp-memory-usage": "",
    "lsp-plugin-restart": "",
    "lsp-refresh-semantic-highlighting": "",
    "lsp-rename-symbol-under-cursor": "mod+shift+r",
    "lsp-switch-header-source": "",
    "lsp-symbol-code-action": "alt+return",
    "lsp-symbol-info": "f1",
    "lsp-symbol-references": "mod+shift+u",
    "lspz-go-to-type-definition": ""
  },
  "servers": [
    {
      "command": "C:\\Program Files\\nodejs\\typescript-language-server.cmd",
      "command_parameters": "--stdio",
      "name": "typescript-language-server"
    }
  ]
}

The relevant part is the configured server with the full path. A patch to fix this issue will be pushed after this message.

SpartanJ commented 3 months ago

This is a patched ecode that should get the typescript-language-server working out of the box ecode-windows-0.6.0-x86_64.zip.

blikblum commented 3 months ago

Works like a charm

Many thanks