Code Monkey home page Code Monkey logo

cue-lsp-server's Introduction

Initial Implementation of a CUE LSP

Originally, this was forked from https://cue-review.googlesource.com/c/cue/+/5840. However, the current implementation uses its own ast abstraction.

Some changes had to be made for certain structs for them to be accessible within the context of the lsp package. For example, builtin had to be exposed.

Project Layout

Contains a Visual Studio Code extension to use the cue LSP with.

To test it out, you can just run code --extensionDevelopmentPath=$PWD/cue-vscode-ext from the root of the repository, after you compiled the command line with go build -o cue-lsp ./cmd/cue.

Contains the definitions for a new command available: lsp:

lsp starts the CUE language server.

At the moment, communication is limited to stdio.

Usage:
  cue lsp [flags]

Flags:
      --config-file string   Path to yml config file. (default "cue-lsp.yml")
  -h, --help                 help for lsp

Global Flags:
  -E, --all-errors   print all available errors
  -i, --ignore       proceed in the presence of errors
  -s, --simplify     simplify output
      --strict       report errors for lossy mappings
      --trace        trace computation
  -v, --verbose      print information about progress

Package that exposes a simple function to start the lsp at the moment. For now this is needed, as the lsp resides in the internal directory and as such cannot be directly accessed by the command package.

This contains the actual implementation of the lsp, as well as any helper packages.

Everything in here was originally taken from promql-server. However, the specific implementations, were reworked for CUE (e.g. completion.go).

To use all the types, interfaces, etc. already created for the gopls language server, we need to clone a part of that here (since those reside in internal of gopls as well). This was copied from the promql-server

cue/internal/lsp/update_internal.sh pulls in the latest changes from the gopls repository. This was copied from the Makefile of promql-server.

This package is used to provide the lsp with information about CUE files. The package is fairly documented, so check out the documentation there.

This was copied over from promql-server, but has seen heavy rewrites to make it work with CUE. Still needs work to make packages work nicely. See the documentation there, for more information (specifically doc.go).

cue-lsp-server's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

dolanor-galaxy

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.