Version of haxe-language-server with a Nix flake
Find a file
LordMZTE 8e5dda805b
Some checks failed
Formatting / check (push) Has been cancelled
CI / build (push) Has been cancelled
Add Nix flake with package
2024-08-20 21:41:29 +02:00
.github/workflows Set haxe executable and use npm ci (#89) 2023-03-26 17:41:31 +02:00
.vscode Set haxe executable and use npm ci (#89) 2023-03-26 17:41:31 +02:00
cases updated dependencies 2022-12-14 23:07:31 +01:00
haxe_libraries updated tokentree lib 2024-08-02 23:48:37 +02:00
shared/haxeLanguageServer added displayHost (#118) 2023-09-14 01:24:42 +02:00
src/haxeLanguageServer Fix spawn sync (#130) 2024-08-17 01:24:12 +02:00
test fixed formatting of tests 2024-02-10 23:56:41 +01:00
.gitignore Use hx-uglifyjs to minify the code in release builds 2019-05-22 01:15:21 +02:00
.haxerc Update haxe, fix null safety issues (#127) 2024-07-30 15:22:51 +02:00
build.hxml Add Nix flake with package 2024-08-20 21:41:29 +02:00
flake.lock Add Nix flake with package 2024-08-20 21:41:29 +02:00
flake.nix Add Nix flake with package 2024-08-20 21:41:29 +02:00
install.hxml Add Nix flake with package 2024-08-20 21:41:29 +02:00
LICENSE.md Add LICENSE.md 2017-03-06 09:29:20 +01:00
package-lock.json updated haxeparser, tokentree and formatter to support inline markup 2022-09-07 15:35:52 +02:00
package.json updated haxeparser, tokentree and formatter to support inline markup 2022-09-07 15:35:52 +02:00
package.nix Add Nix flake with package 2024-08-20 21:41:29 +02:00
README.md updated instructions for Kate 2023-03-26 19:40:11 +02:00
vshaxe-build.json Remove safe navigation macro (#128) 2024-08-05 13:26:36 +02:00

Haxe Language Server

CI

This is a language server implementing Language Server Protocol for the Haxe language.

The goal of this project is to encapsulate haxe's completion API with all its quirks behind a solid and easy-to-use protocol that can be used by any editor/IDE.

Used by the Visual Studio Code Haxe Extension. It has also successfully been used in Neovim and Sublime Text[1][2], but no official extensions exist at this time.

Note that any issues should be reported to vshaxe directly (this is also the reason why the issue tracker is disabled). Pull requests are welcome however!

IMPORTANT: This requires Haxe 3.4.0 or newer due to usage of -D display-stdin, --wait stdio and tons of other fixes and additions related to IDE support.

Building From Source

The easiest way to work on the language server is probably to build it as part of the vshaxe VSCode extension as instructed here (even if you ultimately want to use it outside of VSCode), which allows for easy debugging.

However, you can also build it as a standalone project like so:

git clone https://github.com/vshaxe/haxe-language-server
cd haxe-language-server
npm ci
npx lix run vshaxe-build -t language-server

This creates a bin/server.js that can be started with node server.js.

Usage with (Neo)vim

There's a large amount of language client plugins for (Neo)vim, but the best choice currently seems to be coc.nvim. A coc-settings.json that is known to work with haxe-language-server looks like this:

{
    "languageserver": {
        "haxe": {
            "command": "node",
            "args": ["<path-to-server.js>"],
            "filetypes": ["haxe"],
            "trace.server": "verbose",
            "initializationOptions": {
                "displayArguments": ["build.hxml"]
            },
            "settings": {
                "haxe.executable": "haxe"
            }
        }
    }
}

Usage with Kate

Go to configure Kate (Ctrl+Shift+,) » LSP Client » User Server Settings » Add the following snippet to the JSON config within the servers object. Don't forget to change the path to the LSP server.

"haxe": {
    "command": ["node", "<path-to-server.js>"],
    "rootIndicationFileNames": ["*.hx", "*.hxml"],
    "url": "https://github.com/vshaxe/haxe-language-server",
    "initializationOptions": {"displayArguments": ["build.hxml"]},
    "settings": {"haxe": {"buildCompletionCache": true}},
    "highlightingModeRegex": "^Haxe$"
},

Click Apply, you can then close the window. Use File » Reload or F5 to reload the project. Accept when it asks you whether you want to start the LSP server.

Where <path-to-server.js> can either be a server.js you built from source or simply downloaded as part of the Haxe Visual Studio Code extension ("/<you-home-folder>/.vscode/extensions/nadako.vshaxe-<version>/bin/server.js").