Giter Club home page Giter Club logo

openscad-lsp's Introduction

openscad-LSP

A LSP (Language Server Protocol) server for OpenSCAD.

inspired by dzhu/openscad-language-server

Tested with VSCode on Mac and Windows. [vscode extension]

Tested with lsp-mode on Emacs on Linux by @Lenbok.

Features

  • builtin function/module documents
  • code and path auto-completion
  • jump to definition
  • code snippets
  • function/module signatures on hover
  • document symbols
  • formatter, utilizing clang-format, you need install it yourself, it is not built-in.
  • hover and suggestion documentation, read from comments before the function/module.

IDE plugins

IDE Plugin Note
Neovim mason.nvim Only tested on Mac and Linux
Neovim nvim-lspconfig Only tested on Mac and Linux
VS Code openscad-language-support Only tested on Mac and Windows

Install

openscad-LSP is written in Rust, in order to use it, you need to install Rust toolchain.

cargo install openscad-lsp

Build

cd openscad-LSP
cargo build --release

Usage

The server communicates over TCP socket (127.0.0.1:3245).

USAGE:
    openscad-lsp [OPTIONS]

OPTIONS:
        --builtin <BUILTIN>        external builtin functions file path, if set, the built-in
                                   builtin functions file will not be used [default: ]
        --fmt-exe <FMT_EXE>        clang format executable file path [default: clang-format]
        --fmt-style <FMT_STYLE>    LLVM, GNU, Google, Chromium, Microsoft, Mozilla, WebKit, file
                                   [default: Microsoft]
    -h, --help                     Print help information
        --ignore-default           exclude default params in auto-completion
        --ip <IP>                  [default: 127.0.0.1]
    -p, --port <PORT>              [default: 3245]
        --stdio                    use stdio instead of tcp
    -V, --version                  Print version information

To change the config during running, you can send notification workspace/didChangeConfiguration

// example
{
    "settings": {
        "openscad": {
            "search_paths": "/libs",
            "fmt_exe": "/usr/bin/clang-format",
            "fmt_style": "file",
            "default_param": true
        }
    }
}

openscad-lsp's People

Contributors

leathong avatar dzhu avatar maxverevkin avatar 21st-centuryman avatar chemicalxandco avatar davidphilliposter avatar lenbok avatar luizribeiro 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.