Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vshaxe/haxe-language-server
Language Server Protocol implementation for the Haxe language
https://github.com/vshaxe/haxe-language-server
haxe ide intellisense language-server language-server-protocol vscode
Last synced: 3 months ago
JSON representation
Language Server Protocol implementation for the Haxe language
- Host: GitHub
- URL: https://github.com/vshaxe/haxe-language-server
- Owner: vshaxe
- License: mit
- Created: 2016-04-13T16:55:04.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-07-30T16:52:33.000Z (6 months ago)
- Last Synced: 2024-07-31T16:53:54.899Z (6 months ago)
- Topics: haxe, ide, intellisense, language-server, language-server-protocol, vscode
- Language: Haxe
- Homepage:
- Size: 1.99 MB
- Stars: 99
- Watchers: 14
- Forks: 29
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Haxe Language Server
[![CI](https://github.com/vshaxe/haxe-language-server/actions/workflows/main.yml/badge.svg)](https://github.com/vshaxe/haxe-language-server/actions/workflows/main.yml)
This is a language server implementing [Language Server Protocol](https://github.com/Microsoft/language-server-protocol) for the [Haxe](http://haxe.org/) 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](https://github.com/vshaxe/vshaxe). It has also successfully been used in Neovim and Sublime Text[[1]](https://github.com/vshaxe/vshaxe/issues/171)[[2]](https://github.com/vshaxe/vshaxe/issues/328), but no official extensions exist at this time.
Note that any issues should be reported to [vshaxe](https://github.com/vshaxe/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`](https://github.com/HaxeFoundation/haxe/pull/5120),
[`--wait stdio`](https://github.com/HaxeFoundation/haxe/pull/5188) 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](https://github.com/vshaxe/vshaxe/wiki/Installation#from-source) (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](https://github.com/neoclide/coc.nvim). A `coc-settings.json` that is known to work with haxe-language-server looks like this:
```haxe
{
"languageserver": {
"haxe": {
"command": "node",
"args": [""],
"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.
```json
"haxe": {
"command": ["node", ""],
"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 `` can either be a `server.js` you built from source or simply downloaded as part of the Haxe Visual Studio Code extension (`"//.vscode/extensions/nadako.vshaxe-/bin/server.js"`).