Code Monkey home page Code Monkey logo

mesonlsp's Introduction

MesonLSP

Copr build status CodeFactor codecov

Packaging status OpenSSF Best Practices

A reimplementation of my Meson language server in C++ (Formerly Swift). It's there for providing code intelligence in editors using the language server protocol.

Current feature set

  • Hovering
  • Symbol resolving
  • Jump-To-Definition
  • Jump-To-Subdir
  • A basic set of diagnostics
  • Formatting
  • Document symbols
  • Autocompletion (Somewhat working)
  • Inlay hints
  • Highlighting
  • Automatic subproject/wrap downloads
  • Code actions
  • Renaming
  • Semantic Highlighting
  • Folding

Auto Completion Diagnostics Hover Hover Inlay Hints Special integration for pkg-config

Limitations

  • set_variable/get_variable with non-constant variable name will fail in more complex cases.
  • subdir with non-constant subdir name will fail in more complex cases.
  • Type deduction is not 100% correct yet
  • Type definitions may have minor errors regarding:
    • Is this argument optional?
    • What is the type of the argument?

Why a reimplementation?

The first version, written in Vala, had some code maintenance problems because basically everything was done in one file. I had the choice between untangling that mess or rewriting it as cleanly as possible. I have chosen the latter because I wanted to learn Swift.

And now rewrote it in C++ for more performance, a better buildsystem and to address technical debt.

Installation

Install the language server

Easy way

Compile from source

# Install the dependencies...
git clone https://github.com/JCWasmx86/MesonLSP
cd MesonLSP
meson setup _build --buildtype release -Db_lto=true
ninja -C _build
sudo ninja -C _build install

Connect with your editor

VSCode (Official support)

Install the official meson extension. If you don't have MesonLSP in the PATH, it will ask you whether it should download the language server.

GNOME Builder 45 and GNOME Builder Nightly (Official support)

You have to do nothing. The editor already has the support code for MesonLSP. All you have to do is install the language server.

Kate (No official support)

Add this JSON to ~/.config/kate/lspclient/settings.json:

{
  "servers": {
    "meson": {
      "command": [
        "mesonlsp",
        "--lsp"
      ],
      "rootIndicationFileNames": [
        "meson.build",
        "meson_options.txt"
      ],
      "url": "https://github.com/JCWasmx86/MesonLSP",
      "highlightingModeRegex": "^Meson$"
    }
  }
}

After that, a dialog should be shown asking you to confirm that the language server may be started.

Neovim

nvim-lspconfig has the mesonlsp server configuration you can use.

For coc.nvim, add this JSON to :CocConfig:

{
    "languageserver": {
        "meson": {
            "command": "MesonLSP",
            "args": ["--lsp"],
            "rootPatterns": ["meson.build"],
            "filetypes": ["meson"]
        }
    }
}

Want to contribute?

Take an item from the TODO list in PROGRESS.md and work on it. Feel free to join the matrix channel #mesonlsp:matrix.org

Projects I tested the language server with

mesonlsp's People

Contributors

jcwasmx86 avatar dependabot[bot] avatar qulogic avatar fwcd avatar imgbotapp avatar polyzen avatar sweep-ai[bot] avatar ferdnyc avatar jasongantner avatar ptomato avatar step-security-bot avatar fourdim 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.