Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Go Rust Jsonnet Language Server

This is a jsonnet language server using the go-jsonnet implementation to generate the AST and evaluate jsonnet code

For a small list of example videos head to the Showcase page.

This repository contains 3 components:

ComponentDescription
grustonnet-lsThe language server
grustonnet-lintRuns the diagnostics on the given files
grustonnet-debuggerA jsonnet debugger using DAP

Roadmap

  • [-] Completion
    • Global completion
    • Index completion
    • Value preview
      • Make the Object preview pretty
    • [-] Complete “everything”
      • Find the remaining cases where completion does not work/tries to complete the wrong node
    • Stdlib
    • [-] Advanced Stdlib completion
      • extVar completion
      • Return values
      • Function parameters from std.map
    • Complete Loops
      • Use std.map for loops
    • All jsonnet imports
      • Properly handle completion if “/” is already in the string
    • self
    • super
      • Fix super not working if it never had an index
    • [-] Keyword completion
      • Only complete if valid
      • Add missing keywords
    • [-] Conditionals
      • Actually evaluate the condition
    • Default parameters
    • Builder pattern
      • Check extremely complex patterns
    • Array access
    • Unused function arguments
  • Semantic tokens
  • [-] Inlay Hints
    • Function parameters
      • Only update if needed
    • Indices
    • Name after long objects
  • Goto definition
    • Goto file from import string
    • Can goto everything we can complete
  • Find reference
    • Import strings
    • Can find references for all identifiers we can goto
  • Rename
    • Rename imports if file is renamed
    • Rename file if import is renamed
    • Can rename all identifiers we can find the reference of
  • Signature Help
  • Docsonnet support
    • How to handle the license issues? Docsonnet does not have an open source license
      • Just evaluate it
    • Handle the stdlib the same as docsonnet?
    • Signature help parameters
  • [-] AST repair
  • Commands
    • Evaluate file
  • Missing LSP features
    • Code actions
    • Code Lense?
    • Hover
    • Document highlight
    • Document/Workspace symbols
    • Folding
    • Call hierachie
    • File operation support for automatic refactoring (like renaming imports)
  • Improve performance
    • Test rust2go mem
    • More multithreading
  • More tests
    • Fix ignored tests
  • (Major) Code cleanup
    • Once the prototyping phase is over

Known Issues

  • (Go)-Jsonnet bugs
    • If you import foo.libsonnet and there is also a foo.libsonnet in the current working directory, evaluating the snippet will result in a diagnostic error
      • To reproduce cat mydir/bar.jsonnet | jsonnet --jpath mydir -
    • If there is a circular dependency go-jsonnet emits a strange error
  • Eval diagnostics are always use the state from disk and not from memory

Jsonnet Quirks

  • tailstrict
    • not part of the spec apart from the reserved keyword
    • no documentation at all
    • in foo(myArg()) tailstrict forces myArg to be evaluated before the body, even if it is unused