Comments (7)
I added the path to the lib folder, that contains the file to the jpath config:
/home/vagrant/.docker-devbox/ddb/ddb/feature/jsonnet/lib
now, ctrl+clicking the file name can correctly navigate to the libjsonnet file, but there is no completion for ddb.<ctrl+space>
The log:
time="2023-08-16T14:13:37+02:00" level=info msg="Starting the language server"
time="2023-08-16T14:13:37+02:00" level=info msg="Initializing jsonnet-language-server version 0.12.1"
time="2023-08-16T14:13:37+02:00" level=info msg="Reading stdlib"
time="2023-08-16T14:13:38+02:00" level=debug msg="Publishing diagnostics for file:///home/vagrant/.docker-devbox/ddb/ddb/feature/jsonnet/lib/ddb.docker.libjsonnet"
time="2023-08-16T14:13:38+02:00" level=debug msg="Publishing diagnostics for file:///home/vagrant/.docker-devbox/ddb/ddb/feature/jsonnet/lib/ddb.docker.libjsonnet"
time="2023-08-16T14:13:38+02:00" level=debug msg="Done publishing diagnostics for file:///home/vagrant/.docker-devbox/ddb/ddb/feature/jsonnet/lib/ddb.docker.libjsonnet"
time="2023-08-16T14:13:38+02:00" level=debug msg="Done publishing diagnostics for file:///home/vagrant/.docker-devbox/ddb/ddb/feature/jsonnet/lib/ddb.docker.libjsonnet"
time="2023-08-16T14:13:48+02:00" level=debug msg="Unable to resolve jpath for /home/vagrant/projects/THE-PROJECT/docker-compose.yml.jsonnet: unable to identify the project root.\nTried to find 'tkrc.yaml' or 'jsonnetfile.json' in the parent directories.\nPlease refer to https://tanka.dev/directory-structure for more information"
time="2023-08-16T14:13:48+02:00" level=debug msg="Unable to resolve jpath for /home/vagrant/projects/THE-PROJECT/docker-compose.yml.jsonnet: unable to identify the project root.\nTried to find 'tkrc.yaml' or 'jsonnetfile.json' in the parent directories.\nPlease refer to https://tanka.dev/directory-structure for more information"
time="2023-08-16T14:13:48+02:00" level=error msg="Completion: error finding ranges: field was not found in ast.DesugaredObject"
time="2023-08-16T14:13:49+02:00" level=debug msg="Publishing diagnostics for file:///home/vagrant/projects/THE-PROJECT/docker-compose.yml.jsonnet"
time="2023-08-16T14:13:49+02:00" level=debug msg="Done publishing diagnostics for file:///home/vagrant/projects/THE-PROJECT/docker-compose.yml.jsonnet"
that message is making me wondering what's wrong:
time="2023-08-16T14:13:48+02:00" level=error msg="Completion: error finding ranges: field was not found in ast.DesugaredObject"
while importing the file that way works:
local ddb = import '/home/vagrant/.docker-devbox/ddb/ddb/feature/jsonnet/lib/ddb.docker.libjsonnet';
The libjsonnet file : https://github.com/inetum-orleans/docker-devbox-ddb/blob/develop/ddb/feature/jsonnet/lib/ddb.docker.libjsonnet
from vscode-jsonnet.
Can you try to disable the "Tanka Mode" setting?
from vscode-jsonnet.
Same: (EDIT: it's even worse, the ctrl+click doesn't work anymore)
time="2023-08-16T14:56:31+02:00" level=info msg="Starting the language server"
time="2023-08-16T14:56:31+02:00" level=info msg="Initializing jsonnet-language-server version 0.12.1"
time="2023-08-16T14:56:31+02:00" level=info msg="Reading stdlib"
time="2023-08-16T14:56:32+02:00" level=debug msg="Publishing diagnostics for file:///home/vagrant/.docker-devbox/ddb/ddb/feature/jsonnet/lib/ddb.docker.libjsonnet"
time="2023-08-16T14:56:32+02:00" level=debug msg="Publishing diagnostics for file:///home/vagrant/.docker-devbox/ddb/ddb/feature/jsonnet/lib/ddb.docker.libjsonnet"
time="2023-08-16T14:56:32+02:00" level=debug msg="Done publishing diagnostics for file:///home/vagrant/.docker-devbox/ddb/ddb/feature/jsonnet/lib/ddb.docker.libjsonnet"
time="2023-08-16T14:56:32+02:00" level=debug msg="Done publishing diagnostics for file:///home/vagrant/.docker-devbox/ddb/ddb/feature/jsonnet/lib/ddb.docker.libjsonnet"
time="2023-08-16T14:56:34+02:00" level=error msg="Completion: error finding ranges: field was not found in ast.DesugaredObject"
time="2023-08-16T14:56:34+02:00" level=debug msg="Publishing diagnostics for file:///home/vagrant/projects/THE-PROJECT/docker-compose.yml.jsonnet"
time="2023-08-16T14:56:34+02:00" level=debug msg="Done publishing diagnostics for file:///home/vagrant/projects/THE-PROJECT/docker-compose.yml.jsonnet"
time="2023-08-16T14:56:36+02:00" level=error msg="Completion: error finding ranges: field was not found in ast.DesugaredObject"
Is there any way I can know what jpath is passed to the language server ?
NOTE: I'm using the extension in a remote SSH session, could it cause any issue ?
from vscode-jsonnet.
It seems that the jpath variable here is never used. Am I right to assume that I should trigger a configuration change rather than restarting the server in order to apply the jpath config properly ? Which path syntax should I use on windows/on linux ?
from vscode-jsonnet.
It seems that the jpath variable here is never used. Am I right to assume that I should trigger a configuration change rather than restarting the server in order to apply the jpath config properly ? Which path syntax should I use on windows/on linux ?
It's supposed to be passed in the DidChangeConfiguration
hook:
vscode-jsonnet/src/extension.ts
Line 169 in 5d9bbbd
from vscode-jsonnet.
It is called on startup, but not on "jsonnet.restartLanguageServer"
Inside the startClient method, it does not seem to have any effect.
By restarting the vscode window, I got it to work, but even after a configuration change trigger, it seems a bit flaky with the error message in my second post.
from vscode-jsonnet.
So, to sum up: When I was testing, I was just hitting "Jsonnet: Restart Language Server" instead of restarting VSCode. It seems to work better now, with a working configuration.
The configuration I have:
{
"jsonnet.languageServer.jpath": [
"/home/vagrant/.docker-devbox/ddb/ddb/feature/jsonnet/lib"
],
"jsonnet.languageServer.tankaMode": false
}
After starting the window again, the import is properly resolved and completion works as expected.
I submitted #31 to fix the issue of the configuration being lost on server restart.
On windows, it doesn't work, but I don't know yet if that's my fault or not. I'll keep you posted.
from vscode-jsonnet.
Related Issues (20)
- bug: multiple Jsonnet Language Server instances
- Outline view HOT 1
- Unable to start language server on windows
- formatting options
- Publish extension on Open VSX HOT 2
- `.jsonnet` files are being recognized as JavaScript files HOT 2
- `jsonnet: Evaluate File` does not work in Windows HOT 7
- Odd auto formatting HOT 2
- Is formatter configurable? HOT 2
- Support multi-root workspaces HOT 4
- Is there a way to provide TLAs when evaluating the file? HOT 2
- Tanka support HOT 3
- Grafana Labs is still here? Is any updates or comments from owners? Is repository deprecated? HOT 1
- Can't navigate to an import file on windows
- Getting "'opts.calledFrom' is unset or empty" even when doing new(std.thisFile)
- folder settings ignored
- Pass jpath from file?
- v0.6.0 Seems to ignore configurations
- Convert YAML to Jsonnet
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-jsonnet.