Git Product home page Git Product logo

tower-lsp-boilerplate's Introduction

boilerplate for a rust language server powered by tower-lsp

Introduction

This repo is a template for tower-lsp, a useful github project template which makes writing new language servers easier.

Development

  1. pnpm i
  2. cargo build
  3. press F5 or change to the Debug panel and click Launch Client

Note

If encountered errors like Cannot find module '/xxx/xxx/dist/extension.js' please try run command tsc -b manually, you could refer IWANABETHATGUY#6 for more details

A valid program in nano rust

fn factorial(x) {
    // Conditionals are supported!
    if x == 0 {
        1
    } else {
        x * factorial(x - 1)
    }
}

// The main function
fn main() {
    let three = 3;
    let meaning_of_life = three * 14 + 1;

    print("Hello, world!");
    print("The meaning of life is...");

    if meaning_of_life == 42 {
        print(meaning_of_life);
    } else {
        print("...something we cannot know");

        print("However, I can tell you that the factorial of 10 is...");
        // Function calling
        print(factorial(10));
    }
}

Features

This repo use a language nano rust which first introduced by chumsky . Most common language feature has been implemented, you could preview via the video below.

  • InlayHint for LiteralType inlay hint

  • semantic token
    make sure your semantic token is enabled, you could enable your semantic token by adding this line to your settings.json

{
 "editor.semanticHighlighting.enabled": true,
}
  • syntactic error diagnostic
syntactic.mp4
  • code completion
Peek.2022-03-06.21-47.mp4
  • go to definition
definition.mp4
  • find reference
reference.mp4
  • rename
rename.mp4

tower-lsp-boilerplate's People

Contributors

iwanabethatguy 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.