carlverge / jsonnet-lsp Goto Github PK
View Code? Open in Web Editor NEWJsonnet Language Server and Editor Clients
License: Apache License 2.0
Jsonnet Language Server and Editor Clients
License: Apache License 2.0
When working with a large repo, we have libsonnets which come as part of a package resulting in a structure similar to this:
repo
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.
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.
Given this:
local a =
local b = false;
2;
a + 3
a
to its def, it jumps to b
instead.a
is a boolean (from b
).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
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!
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.