Giter Site home page Giter Site logo

haxe-language-server's Introduction

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").

haxe-language-server's People

Contributors

gama11 avatar nadako avatar alexhaxe avatar simn avatar rblsb avatar klabz avatar sebthom avatar haxiomic avatar andyli avatar dpomier avatar jakub-w avatar jdonaldson avatar jeremyfa avatar antriel avatar rsduck avatar tobil4sk avatar wiggin77 avatar qazcetelic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.