Code Monkey home page Code Monkey logo

jsonnet-lsp's People

Contributors

andersbach-dp avatar carlverge avatar gabrielrussoc avatar jordanmoxon-db avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

jsonnet-lsp's Issues

Allow additional lib paths

When working with a large repo, we have libsonnets which come as part of a package resulting in a structure similar to this:

repo

  • \src
    • \someProject
      • \file.jsonnet
  • \packages
    • \someLibPkg
      • \lib
        • \library.libsonnet

When we call jsonnet-exe to compile, we add additional jpaths. When using your editor, it seems to only look in the current folder or the root of the repo and I see errors such as:

path 'library.libsonnet' not found in candidates [file:///d:/git/repo/library.libsonnet file:///d:/git/repo/src/someProject/library.libsonnet]jsonnet(RuntimeError)

Other editors handle this be accepting an array of additional paths to search. I am not sure if that is the best solution, but it is one solution.

Improve single line verbatim strings

If I use a single line verbatim string (e.g. foo: @"bar\baz",), the editor will highlght the \b as though this is an escape sequence, however the entire point of a verbatim string is that these are not escape sequences. This does not happen for multiline verbatim strings.

NPE in NodeToValue

Completion asked for completion on a nil node -- NodeToValue should handle this gracefully, but completion also shouldn't be operating on a nil AST node

goroutine 6 [running]:
github.com/carlverge/jsonnet-lsp/pkg/analysis.defaultToValue({0x0, 0x0})
	github.com/carlverge/jsonnet-lsp/pkg/analysis/value.go:317 +0x9c
github.com/carlverge/jsonnet-lsp/pkg/analysis.NodeToValue({0x0?, 0x0?}, {0x101131fa0, 0x140007ba240})
	github.com/carlverge/jsonnet-lsp/pkg/analysis/value.go:472 +0xbb0
github.com/carlverge/jsonnet-lsp/pkg/lsp.(*Server).Completion(0x14000104120, {0x1010be7a0?, 0x140004401e0?}, 0x140004401e0)
	github.com/carlverge/jsonnet-lsp/pkg/lsp/handler.go:345 +0x160
go.lsp.dev/protocol.serverDispatch({0x101132420, 0x14000146640}, {0x101137800, 0x14000104120}, 0x140007b8220, {0x128a8b598, 0x140007ba200})
	go.lsp.dev/[email protected]/server.go:206 +0x4154
go.lsp.dev/protocol.ServerHandler.func1({0x101132420, 0x14000146640}, 0x140007b8220, {0x128a8b598, 0x140007ba200})
	go.lsp.dev/[email protected]/server.go:36 +0x6c
go.lsp.dev/jsonrpc2.(*conn).run(0x14000146690, {0x101132420, 0x14000146640}, 0x1400000c360)
	go.lsp.dev/[email protected]/conn.go:206 +0x234
created by go.lsp.dev/jsonrpc2.(*conn).Go
	go.lsp.dev/[email protected]/conn.go:189 +0xac

Formatting not working properly

Hello!

First I would like to thank you for your amazing work on this extension, it's really saving me a lot of time when working on some Jsonnet!

However I noticed two bugs I think: when using the latest version (0.1.10) and the previous one (0.1.8), the "implicit plus" feature does not work at all, I tried multiple combination of "disabling/enabling/reloading/restarting VScode" and it never worked, enabled or disable it doesn't touch any exiting + or remove unnecessary ones.

I also noticed that since 0.1.10 the "String style" option where no more applied properly and it always replace simple quotes by double quotes, even when it is explicitly set to simple quotes.

Here is my configuration VSCode version/config:
Version: 1.77.3
Commit: 704ed70d4fd1c6bd6342c436f1ede30d1cff4710
Date: 2023-04-12T09:41:48.638Z (2 wks ago)
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Darwin arm64 22.4.0
Sandboxed: No

In my settings.json I only have:

"jsonnet.lsp.fmt.stringStyle": "'",
"jsonnet.lsp.fmt.implicitPlus": true

And I'm using Golang Jsonnet v0.19.1.

Would you have any idea why it doesn't work as expected?

Thank you for your help!

bazel-bin support - how is it meant to work?

We have some libsonnets loaded like so:

local foo = (import "foo.libsonnet");

but that file is from a remote repository tracked by bazel; I can't click through to resolve the symbols in the LSP. Is that something that is meant to Just Work ? I can provide more info on our bazel setup if thats useful.

Thanks!

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.