Git Product home page Git Product logo

yang-vscode's Introduction

Language support for YANG for Visual Studio Code

Provides YANG language support via YANG Language Server.

Quick Start

  1. Install the Extension
  2. If you do not have a Java 11 correctly installed
    • Download and install a Java 11 runtime environment.
  3. Extension is activated when you first access a YANG file
  4. Use "Open in Diagram" from the context menu to see the graphical model view.

Features

 templates  completion  navigation

  • As you type reporting of parsing and compilation errors
  • Code completion
  • description hovers
  • Symbol search
  • Code outline
  • Code navigation
  • Code lens (references)
  • Highlights
  • Code formatting
  • Code snippets
  • Code actions
  • Diagrams

Configuration

For configuration and further services, please have a look at the docs of the YANG Language Server.

yang-vscode's People

Contributors

dependabot[bot] avatar dhuebner avatar jankoehnlein avatar jbicker avatar paul-marechal avatar spoenemann avatar svenefftinge avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

yang-vscode's Issues

Not respecting vscode exclusions

The "Files: Exclude" setting in vscode is not being respected. This causes problems like duplicate definitions if a workspace has symlinks that make files appear in multiple locations (e.g. due to using a build system such as bazel).

Got some errors whenever I try to create a new Yang file

Hi developers and experts, not sure if it's just me, I've got a fresh Code and the Yangster extension installed in my Windows 10 VM, with JDK 11.0.18. Syntax highlighting is fine when I open old Yang files. But when I create a new one there will always be errors popping out. Also other features like auto-complete are not working, so definitely something is not working well.

[Error - 11:06:14 AM] Error during request: : java.util.concurrent.CompletionException: java.lang.UnsupportedOperationException
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
	at java.base/java.util.concurrent.CompletableFuture.andTree(CompletableFuture.java:1452)
	at java.base/java.util.concurrent.CompletableFuture.andTree(CompletableFuture.java:1442)
	at java.base/java.util.concurrent.CompletableFuture.andTree(CompletableFuture.java:1442)
	at java.base/java.util.concurrent.CompletableFuture.andTree(CompletableFuture.java:1442)
	at java.base/java.util.concurrent.CompletableFuture.allOf(CompletableFuture.java:2337)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.cancel(RequestManager.java:114)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.runWrite(RequestManager.java:80)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.runBuildable(LanguageServerImpl.java:457)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.didChange(LanguageServerImpl.java:397)
	at jdk.internal.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187)
	at org.eclipse.lsp4j.jsonrpc.validation.ReflectiveMessageValidator.consume(ReflectiveMessageValidator.java:68)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.UnsupportedOperationException
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.semanticTokensCompute(YangSyncDiagramLanguageServer.java:43)
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.lambda$semanticTokensFull$0(YangSyncDiagramLanguageServer.java:36)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66)
	... 5 more
[Error - 11:06:14 AM] Error during request: : java.lang.UnsupportedOperationException
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.semanticTokensCompute(YangSyncDiagramLanguageServer.java:43)
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.lambda$semanticTokensFull$0(YangSyncDiagramLanguageServer.java:36)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Jun 16, 2023 11:06:14 AM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: java.lang.UnsupportedOperationException
java.util.concurrent.CompletionException: java.lang.UnsupportedOperationException
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346)
	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:704)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
	at org.eclipse.xtext.ide.server.concurrent.AbstractRequest.logAndCompleteExceptionally(AbstractRequest.java:73)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:69)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.UnsupportedOperationException
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.semanticTokensCompute(YangSyncDiagramLanguageServer.java:43)
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.lambda$semanticTokensFull$0(YangSyncDiagramLanguageServer.java:36)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66)
	... 5 more

[Error - 11:06:14 AM] Request textDocument/semanticTokens/full failed.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: java.lang.UnsupportedOperationException
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346)
	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:704)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
	at org.eclipse.xtext.ide.server.concurrent.AbstractRequest.logAndCompleteExceptionally(AbstractRequest.java:73)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:69)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.UnsupportedOperationException
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.semanticTokensCompute(YangSyncDiagramLanguageServer.java:43)
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.lambda$semanticTokensFull$0(YangSyncDiagramLanguageServer.java:36)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66)
	... 5 more

[Error - 11:06:14 AM] Error during request: : java.util.concurrent.CompletionException: java.lang.UnsupportedOperationException
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
	at java.base/java.util.concurrent.CompletableFuture.andTree(CompletableFuture.java:1452)
	at java.base/java.util.concurrent.CompletableFuture.andTree(CompletableFuture.java:1444)
	at java.base/java.util.concurrent.CompletableFuture.allOf(CompletableFuture.java:2337)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.cancel(RequestManager.java:114)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.runWrite(RequestManager.java:80)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.runBuildable(LanguageServerImpl.java:457)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.didChange(LanguageServerImpl.java:397)
	at jdk.internal.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187)
	at org.eclipse.lsp4j.jsonrpc.validation.ReflectiveMessageValidator.consume(ReflectiveMessageValidator.java:68)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.UnsupportedOperationException
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.semanticTokensCompute(YangSyncDiagramLanguageServer.java:43)
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.lambda$semanticTokensFull$0(YangSyncDiagramLanguageServer.java:36)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66)
	... 5 more
[Error - 11:06:15 AM] Error during request: : java.lang.UnsupportedOperationException
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.semanticTokensCompute(YangSyncDiagramLanguageServer.java:43)
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.lambda$semanticTokensFull$0(YangSyncDiagramLanguageServer.java:36)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Jun 16, 2023 11:06:15 AM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: java.lang.UnsupportedOperationException
java.util.concurrent.CompletionException: java.lang.UnsupportedOperationException
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346)
	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:704)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
	at org.eclipse.xtext.ide.server.concurrent.AbstractRequest.logAndCompleteExceptionally(AbstractRequest.java:73)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:69)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.UnsupportedOperationException
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.semanticTokensCompute(YangSyncDiagramLanguageServer.java:43)
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.lambda$semanticTokensFull$0(YangSyncDiagramLanguageServer.java:36)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66)
	... 5 more

[Error - 11:06:15 AM] Request textDocument/semanticTokens/full failed.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: java.lang.UnsupportedOperationException
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346)
	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:704)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
	at org.eclipse.xtext.ide.server.concurrent.AbstractRequest.logAndCompleteExceptionally(AbstractRequest.java:73)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:69)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.UnsupportedOperationException
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.semanticTokensCompute(YangSyncDiagramLanguageServer.java:43)
	at io.typefox.yang.diagram.YangSyncDiagramLanguageServer.lambda$semanticTokensFull$0(YangSyncDiagramLanguageServer.java:36)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66)
	... 5 more

On the extension host log:

2023-06-16 10:45:32.036 [error] [typefox.yang-vscode] provider FAILED
2023-06-16 10:45:32.040 [error] Error: Internal error.
	at c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:167953
	at c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:168247
	at Immediate.<anonymous> (c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:168610)
	at process.processImmediate (node:internal/timers:466:21)
2023-06-16 10:45:32.483 [error] [typefox.yang-vscode] provider FAILED
2023-06-16 10:45:32.483 [error] Error: Internal error.
	at c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:167953
	at c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:168247
	at Immediate.<anonymous> (c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:168610)
	at process.processImmediate (node:internal/timers:466:21)
2023-06-16 10:46:29.592 [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:javascript'
2023-06-16 10:46:59.301 [error] [typefox.yang-vscode] provider FAILED
2023-06-16 10:46:59.303 [error] Error: Internal error.
	at c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:167953
	at c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:168247
	at Immediate.<anonymous> (c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:168610)
	at process.processImmediate (node:internal/timers:466:21)
2023-06-16 10:58:39.047 [error] [typefox.yang-vscode] provider FAILED
2023-06-16 10:58:39.085 [error] Error: Internal error.
	at c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:167953
	at c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:168247
	at Immediate.<anonymous> (c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:168610)
	at process.processImmediate (node:internal/timers:466:21)
2023-06-16 11:06:14.851 [error] [typefox.yang-vscode] provider FAILED
2023-06-16 11:06:14.866 [error] Error: Internal error.
	at c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:167953
	at c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:168247
	at Immediate.<anonymous> (c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:168610)
	at process.processImmediate (node:internal/timers:466:21)
2023-06-16 11:06:15.213 [error] [typefox.yang-vscode] provider FAILED
2023-06-16 11:06:15.213 [error] Error: Internal error.
	at c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:167953
	at c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:168247
	at Immediate.<anonymous> (c:\Users\Gavin\.vscode\extensions\typefox.yang-vscode-2.2.0\extension\pack\extension.js:1:168610)
	at process.processImmediate (node:internal/timers:466:21)

See if I need to provide more information for troubleshooting, thanks!

Code completion not working

Code completion not working
I don't know if additional configurations are needed.
I want work like the first GIF image of GitHub's Features.

my env:
os: win10
vscode 1.84.2
java 11.0.19

frequently internal error

Issue Type: Bug

In the same environment, the same PC, different time,
internal error frequently occurs.

sometimes, i saw 'The Yang Language Server server crashed 5 times in the last 3 minutes.... ' message.

Extension version: 1.7.0
VS Code version: Code 1.43.0 (78a4c91400152c0f27ba4d363eb56d2835f9903a, 2020-03-09T19:47:57.235Z)
OS version: Windows_NT x64 10.0.18363

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (12 x 3696)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.81GB (4.86GB free)
Process Argv
Screen Reader no
VM 0%

Export language client handle

For extensions that primarily make use of yang-lsp, expose the language client as part of yang-vscode extension exports.

Java based code helper uses 100%+ CPU

Issue Type: Performance Issue

This occurs as soon as I open some yang files with java installed. Killing the java process doesn't help as something is watching for it and restarts it. My laptop is sitting with the fan running on high, even though nothing is happening.

Extension version: 1.7.0
VS Code version: Code 1.28.1 (3368db6750222d319c851f6d90eb619d886e08f5, 2018-10-11T18:07:48.477Z)
OS version: Darwin x64 17.7.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 x 2900)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 3, 4, 4
Memory (System) 16.00GB (0.02GB free)
Process Argv -psn_0_12606469
Screen Reader no
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
   23	    98	 34144	code main
    2	    49	 34145	   gpu-process
    4	   246	 34146	   window (nonFtCusTypes.yang — Untitled (Workspace))
    0	    98	 34232	     extensionHost
    0	    82	 34409	       electron_node j.js 
    0	    16	 34418	       /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/server/dist/jsonServerMain --node-ipc --clientProcessId=34232
    0	    33	 34450	       electron_node server.js 
    0	    16	 34236	     watcherService
    0	   147	 34147	   window (Vagrantfile — Repositories)
    0	     0	 34217	     /usr/local/bin/bash -l
    0	   164	 34235	     extensionHost
    0	    16	 34511	       /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/server/dist/jsonServerMain --node-ipc --clientProcessId=34235
    0	    33	 34530	       electron_node server.js 
   98	   770	 36978	       electron_node j.js 
    0	    33	 34238	     watcherService
    3	    82	 34285	   shared-process
   63	    82	 37013	   window (Issue Reporter)
    0	     0	 37014	   /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
Workspace Info
|  Window (Vagrantfile — Repositories)
|  Window (some.yang — Untitled (Workspace))
|    Folder (1810_yang): 765 files
|      File types: yang(697) txt(35) xml(11) sh(4) md(3) tree(2) yml(1) py(1)
|                  gitreview(1) gitmodules(1)
|      Conf files:
|    Folder (Repositories): more than 24280 files
|      File types: py(9596) pyc(6899) h(1018) yml(939) so(564) txt(502)
|                  j2(403) yang(388) vim(355) json(205)
|      Conf files: makefile(15) settings.json(2) project.json(1)
|    Folder (another): 4402 files
|      File types: pyc(1912) py(1643) h(181) txt(89) so(83) yang(77) json(28)
|                  rst(27) xsl(18) pxd(16)
|      Conf files: settings.json(1) makefile(1);

Crashes on start due to ComputationException

Installed the extension, tried opening different Yang files and reloading the window. The extension fails consistently with the same exception.

Click to expand logs
Exception in thread "main" com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: java.lang.ExceptionInInitializerError
	at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:553)
	at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:419)
	at com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
	at com.google.inject.internal.FailableCache.get(FailableCache.java:50)
	at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:49)
	at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:125)
	at com.google.inject.internal.InjectorImpl.initializeBinding(InjectorImpl.java:507)
	at com.google.inject.internal.AbstractBindingProcessor$Processor$1.run(AbstractBindingProcessor.java:159)
	at com.google.inject.internal.ProcessedBindingData.initializeBindings(ProcessedBindingData.java:44)
	at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:122)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106)
	at com.google.inject.Guice.createInjector(Guice.java:95)
	at com.google.inject.Guice.createInjector(Guice.java:72)
	at com.google.inject.Guice.createInjector(Guice.java:62)
	at io.typefox.yang.diagram.launch.YangLanguageServerSetup$1.createInjector(YangLanguageServerSetup.java:45)
	at io.typefox.yang.YangStandaloneSetupGenerated.createInjectorAndDoEMFRegistration(YangStandaloneSetupGenerated.java:37)
	at io.typefox.yang.diagram.launch.YangLanguageServerSetup.setupLanguages(YangLanguageServerSetup.java:47)
	at org.eclipse.sprotty.xtext.launch.DiagramServerLauncher.run(DiagramServerLauncher.java:180)
	at io.typefox.yang.diagram.launch.YangServerLauncher.main(YangServerLauncher.java:22)
Caused by: com.google.inject.internal.util.$ComputationException: java.lang.ExceptionInInitializerError
	at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:553)
	at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:419)
	at com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
	at com.google.inject.internal.FailableCache.get(FailableCache.java:50)
	at com.google.inject.internal.MembersInjectorStore.get(MembersInjectorStore.java:65)
	at com.google.inject.internal.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:73)
	at com.google.inject.internal.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:28)
	at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:36)
	at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:32)
	at com.google.inject.internal.FailableCache$1.apply(FailableCache.java:39)
	at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:549)
	... 18 more
Caused by: java.lang.ExceptionInInitializerError
	at com.google.inject.internal.cglib.reflect.$FastClassEmitter.<init>(FastClassEmitter.java:67)
	at com.google.inject.internal.cglib.reflect.$FastClass$Generator.generateClass(FastClass.java:72)
	at com.google.inject.internal.cglib.core.$DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
	at com.google.inject.internal.cglib.core.$AbstractClassGenerator.create(AbstractClassGenerator.java:216)
	at com.google.inject.internal.cglib.reflect.$FastClass$Generator.create(FastClass.java:64)
	at com.google.inject.internal.BytecodeGen.newFastClass(BytecodeGen.java:207)
	at com.google.inject.internal.SingleMethodInjector.createMethodInvoker(SingleMethodInjector.java:49)
	at com.google.inject.internal.SingleMethodInjector.<init>(SingleMethodInjector.java:38)
	at com.google.inject.internal.MembersInjectorStore.getInjectors(MembersInjectorStore.java:125)
	at com.google.inject.internal.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:95)
	at com.google.inject.internal.MembersInjectorStore.access$000(MembersInjectorStore.java:34)
	at com.google.inject.internal.MembersInjectorStore$1.create(MembersInjectorStore.java:42)
	at com.google.inject.internal.MembersInjectorStore$1.create(MembersInjectorStore.java:39)
	at com.google.inject.internal.FailableCache$1.apply(FailableCache.java:39)
	at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:549)
	... 28 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @53c4a559
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
	at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
	at com.google.inject.internal.cglib.core.$ReflectUtils$2.run(ReflectUtils.java:56)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
	at com.google.inject.internal.cglib.core.$ReflectUtils.<clinit>(ReflectUtils.java:46)
	... 43 more
[Info  - 4:25:19 PM] Connection to server got closed. Server will restart.

When statement xpath not correctly evaluated within case nodes

According to https://datatracker.ietf.org/doc/html/rfc7950#section-7.21.5

      If the "when" statement is a child of a "uses", "choice", or
      "case" statement, then the context node is the closest ancestor
      node to the node with the "when" statement that is also a data
      node.  If no such node exists, the context node is the root node.
      The accessible tree is tentatively altered during the processing
      of the XPath expression by removing all instances (if any) of the
      nodes added by the "uses", "choice", or "case" statement.

The extension seems to not use the closest ancestor node that is a data node as context node.
For the reference of when to be displayed in the editor, you need to add ../ to the path, which is incorrect. In a correct model, the reference is not shown in the editor.

Originally, I suspected an issue in another tool, and created this ticket: CZ-NIC/yangson#112. Maybe this is helpful

Windows Problems

Apparently, the extension doesn't work on windows. To be tested

Does not start in VSCode & MacOs-BigSur

Cannot start Yangster in freshly installed VSCode on BigSur: getting "Server initialization failed" Internal Error with Code -32603

Persist with JDK 8 & 11 as well

Jun 04, 2021 5:54:11 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: java.lang.IllegalArgumentException: Bad escape
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Bad escape
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:607)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:591)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488)
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1990)
at org.eclipse.xtext.ide.server.concurrent.WriteRequest.run(WriteRequest.java:44)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Bad escape
at sun.nio.fs.UnixUriUtils.fromUri(UnixUriUtils.java:87)
at sun.nio.fs.UnixFileSystemProvider.getPath(UnixFileSystemProvider.java:98)
at java.nio.file.Paths.get(Paths.java:138)
at io.typefox.yang.settings.PreferenceValuesProvider.createPreferenceValues(PreferenceValuesProvider.java:110)
at io.typefox.yang.ide.server.YangExclusionProvider.getPreferences(YangExclusionProvider.java:60)
at io.typefox.yang.ide.server.YangExclusionProvider.isExcluded(YangExclusionProvider.java:24)
at io.typefox.yang.ide.server.YangProjectManager.lambda$newBuildRequest$0(YangProjectManager.java:27)
at org.eclipse.xtext.xbase.lib.internal.BooleanFunctionDelegate.apply(BooleanFunctionDelegate.java:41)
at com.google.common.collect.Iterators$5.computeNext(Iterators.java:637)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
at com.google.common.collect.Iterators.addAll(Iterators.java:355)
at com.google.common.collect.Lists.newArrayList(Lists.java:143)
at com.google.common.collect.Lists.newArrayList(Lists.java:130)
at org.eclipse.xtext.xbase.lib.IterableExtensions.toList(IterableExtensions.java:620)
at io.typefox.yang.ide.server.YangProjectManager.newBuildRequest(YangProjectManager.java:30)
at org.eclipse.xtext.ide.server.ProjectManager.doBuild(ProjectManager.java:104)
at org.eclipse.xtext.ide.server.ProjectManager.doInitialBuild(ProjectManager.java:96)
at org.eclipse.xtext.ide.server.BuildManager.doInitialBuild(BuildManager.java:172)
at org.eclipse.xtext.ide.server.WorkspaceManager.refreshWorkspaceConfig(WorkspaceManager.java:172)
at org.eclipse.xtext.ide.server.WorkspaceManager.initialize(WorkspaceManager.java:145)
at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$initialize$0(LanguageServerImpl.java:220)
at org.eclipse.xtext.ide.server.concurrent.WriteRequest.run(WriteRequest.java:38)
... 5 more

[Error - 5:54:11 PM] Server initialization failed.
Message: Internal error.
Code: -32603
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Bad escape
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:607)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:591)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488)
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1990)
at org.eclipse.xtext.ide.server.concurrent.WriteRequest.run(WriteRequest.java:44)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Bad escape
at sun.nio.fs.UnixUriUtils.fromUri(UnixUriUtils.java:87)
at sun.nio.fs.UnixFileSystemProvider.getPath(UnixFileSystemProvider.java:98)
at java.nio.file.Paths.get(Paths.java:138)
at io.typefox.yang.settings.PreferenceValuesProvider.createPreferenceValues(PreferenceValuesProvider.java:110)
at io.typefox.yang.ide.server.YangExclusionProvider.getPreferences(YangExclusionProvider.java:60)
at io.typefox.yang.ide.server.YangExclusionProvider.isExcluded(YangExclusionProvider.java:24)
at io.typefox.yang.ide.server.YangProjectManager.lambda$newBuildRequest$0(YangProjectManager.java:27)
at org.eclipse.xtext.xbase.lib.internal.BooleanFunctionDelegate.apply(BooleanFunctionDelegate.java:41)
at com.google.common.collect.Iterators$5.computeNext(Iterators.java:637)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
at com.google.common.collect.Iterators.addAll(Iterators.java:355)
at com.google.common.collect.Lists.newArrayList(Lists.java:143)
at com.google.common.collect.Lists.newArrayList(Lists.java:130)
at org.eclipse.xtext.xbase.lib.IterableExtensions.toList(IterableExtensions.java:620)
at io.typefox.yang.ide.server.YangProjectManager.newBuildRequest(YangProjectManager.java:30)
at org.eclipse.xtext.ide.server.ProjectManager.doBuild(ProjectManager.java:104)
at org.eclipse.xtext.ide.server.ProjectManager.doInitialBuild(ProjectManager.java:96)
at org.eclipse.xtext.ide.server.BuildManager.doInitialBuild(BuildManager.java:172)
at org.eclipse.xtext.ide.server.WorkspaceManager.refreshWorkspaceConfig(WorkspaceManager.java:172)
at org.eclipse.xtext.ide.server.WorkspaceManager.initialize(WorkspaceManager.java:145)
at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$initialize$0(LanguageServerImpl.java:220)
at org.eclipse.xtext.ide.server.concurrent.WriteRequest.run(WriteRequest.java:38)
... 5 more

yang library path

Hi,
I have a project that uses external path for libraries.
I tried to add them to the classpath but I always have the same error:
Couldn't resolve reference to AbstractModule '...'.
There is a way to configure an external path for yang libraries?
Thank you
Max

Couldn't start client Yang Language Server

Issue Type: Bug
Extension: Yang VS Code Extension

Couldn't start client Yang Language Server

[Error - 1:26:26 PM] Starting client failed
Launching server using command /Users/pmontero/.vscode/extensions/typefox.yang-vscode-1.7.0/build/yang-language-server/bin/yang-language-server failed.

From the developers tools:

/Users/pmontero/.vscode/extensions/typefox.yang-vscode-1.7.0/build/yang-language-server/bin/yang-language-server ENOENT: Error: spawn /Users/pmontero/.vscode/extensions/typefox.yang-vscode-1.7.0/build/yang-language-server/bin/yang-language-server ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:243 [Extension Host] rejected promise not handled within 1 second: Launching server using command /Users/pmontero/.vscode/extensions/typefox.yang-vscode-1.7.0/build/yang-language-server/bin/yang-language-server failed.
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:243
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1521 ERR Launching server using command /Users/pmontero/.vscode/extensions/typefox.yang-vscode-1.7.0/build/yang-language-server/bin/yang-language-server failed.

Extension version: 1.7.0
VS Code version: Code 1.39.1 (88f15d17dca836346e787762685a40bb5cce75a8, 2019-10-10T23:35:11.314Z)
OS version: Darwin x64 17.5.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (8 x 2700)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 3, 3, 2
Memory (System) 16.00GB (0.02GB free)
Process Argv
Screen Reader no
VM 0%

Using with Remote SSH Extension

How can we use this Remote SSH extension. I need some way to set the Java Path? I don't see any place in settings where I can configure Java Path

Neither global nor user snippets works for yang files when yangster is installed.

Latest vscode (1.65.2) and yang-vscode (2.0.6)

I have a snippet with a prefix set to leaf, when typing leaf I get this error "name must not be falsy: Error: name must not be falsy"

[2022-03-23 16:10:26.386] [renderer1] [info] [KeybindingService]: / Received  keydown event - modifiers: [], code: KeyL, keyCode: 76, key: l
[2022-03-23 16:10:26.387] [renderer1] [info] [KeybindingService]: | Converted keydown event - modifiers: [], code: KeyL, keyCode: 42 ('L')
[2022-03-23 16:10:26.388] [renderer1] [info] [KeybindingService]: | Resolving [KeyL]
[2022-03-23 16:10:26.388] [renderer1] [info] [KeybindingService]: \ From 1 keybinding entries, no when clauses matched the context.
[2022-03-23 16:10:26.436] [renderer1] [info] [KeybindingService]: / Received  keydown event - modifiers: [], code: KeyE, keyCode: 69, key: e
[2022-03-23 16:10:26.437] [renderer1] [info] [KeybindingService]: | Converted keydown event - modifiers: [], code: KeyE, keyCode: 35 ('E')
[2022-03-23 16:10:26.438] [renderer1] [info] [KeybindingService]: | Resolving [KeyE]
[2022-03-23 16:10:26.438] [renderer1] [info] [KeybindingService]: \ No keybinding entries.
[2022-03-23 16:10:26.493] [renderer1] [info] [KeybindingService]: / Received  keydown event - modifiers: [], code: KeyA, keyCode: 65, key: a
[2022-03-23 16:10:26.496] [renderer1] [info] [KeybindingService]: | Converted keydown event - modifiers: [], code: KeyA, keyCode: 31 ('A')
[2022-03-23 16:10:26.497] [renderer1] [info] [KeybindingService]: | Resolving [KeyA]
[2022-03-23 16:10:26.498] [renderer1] [info] [KeybindingService]: \ From 1 keybinding entries, no when clauses matched the context.
[2022-03-23 16:10:26.643] [renderer1] [info] [KeybindingService]: / Received  keydown event - modifiers: [], code: KeyF, keyCode: 70, key: f
[2022-03-23 16:10:26.643] [renderer1] [info] [KeybindingService]: | Converted keydown event - modifiers: [], code: KeyF, keyCode: 36 ('F')
[2022-03-23 16:10:26.644] [renderer1] [info] [KeybindingService]: | Resolving [KeyF]
[2022-03-23 16:10:26.644] [renderer1] [info] [KeybindingService]: \ From 1 keybinding entries, no when clauses matched the context.
[2022-03-23 16:10:26.998] [renderer1] [error] name must not be falsy: Error: name must not be falsy
	at Function.validate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:76:103993)
	at new n (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:76:103942)
	at new n (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:76:90384)
	at O (/Users/hniska/.vscode/extensions/typefox.yang-vscode-2.0.6/extension/pack/extension.js:1:152505)
	at Array.map (<anonymous>)
	at Object.asDocumentSymbols (/Users/hniska/.vscode/extensions/typefox.yang-vscode-2.0.6/extension/pack/extension.js:1:156580)
	at /Users/hniska/.vscode/extensions/typefox.yang-vscode-2.0.6/extension/pack/extension.js:1:34277
	at async f.provideDocumentSymbols (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:91158)

Feature: Global error checking

First of all, Thanks for this great extention.
I'd like to launch a global error checking on all my yang files in my workspace (without opening each file).
In order to have all the errors properly shown in the VSCode Problems view.
Is it possible ?
I try to make a new task in my workspace's task.json config file (with problemMatcher instruction) but i didn't find which command i could launch.
In this extension, which process/command executes the syntax validation ?

Thanks a lot!

Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$2

On starting the extension the following warning is issued

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$2 (file:/home/user/.vscode-server/extensions/typefox.yang-vscode-2.0.5/server/lib/guice-3.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Version: 1.51.1
Commit: e5a624b788d92b8d34d1392e4c4d9789406efe8f
Date: 2020-11-11T01:11:34.018Z (2 wks ago)
Electron: 9.3.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.6.0

Update to latest yang-lsp v0.6.0

yang-lsp v0.6.0:

  • fixed transitive dependencies to Guice: 5.0.1 (allows run with Java >=16)
  • update to lsp4j 0.12.0 (lsp 3.16)

We should release a new extension version after all dependencies are updated

All features except syntax highlighting do not work

Hello and thank you for this vs code extension for the yang language server.

Having installed your extension on WSL Ubuntu (see details on versions below), I can see the syntax highlighting (NB: I have disabled all other YANG extensions and reloaded VS code), but I cannot see any other feature.

FYI I cannot use your extension directly on Windows because some corporate computer policy is blocking Java.

Do you have any idea what might be the cause?

Software versions:

  • Windows version: Windows 10 21H2 build 19044.2728
  • WSL Ubuntu version: 20.04.5 TLS
  • JRE: openjdk-11-jdk, version: 11.0.18+10-0ubuntu1~20.04.1

Millions of getReferenceDescription errors

Whenever I make any changes to a YANG file, even if I just type a space, an error pops up in the Output tab for "Yang Language Server". This happens on literally every file change, so if I type in a few words, dozens of errors will be spewing into the Output tab of the panel. The panel opens automatically to the Output tab any time this happens too, so I can't just ignore this. It's extremely distracting to try to type while hundreds of errors are racing by right next to my editor.

The errors all look just like this:

[Error - 2:16:58 PM] java.lang.IllegalStateException: getReferenceDescriptions file:///home/tomas/Dropbox/REDACTED/foo.yang: java.lang.IllegalStateException: getReferenceDescriptions file:///home/tomas/Dropbox/REDACTED/foo.yang
	at org.eclipse.xtext.build.Indexer$ResolvedResourceDescription.getReferenceDescriptions(Indexer.java:182)
	at io.typefox.yang.ide.codelens.CodeLensService.lambda$computeCodeLenses$0(CodeLensService.java:119)
	at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:42)
	at com.google.common.collect.Iterators$8.transform(Iterators.java:817)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at java.lang.Iterable.forEach(Iterable.java:74)
	at io.typefox.yang.ide.codelens.CodeLensService.computeCodeLenses(CodeLensService.java:127)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$null$45(LanguageServerImpl.java:756)
	at org.eclipse.xtext.ide.server.WorkspaceManager.doRead(WorkspaceManager.java:283)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$codeLens$46(LanguageServerImpl.java:760)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$run$0(ReadRequest.java:37)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

I have had this problem before, but it went away. Now recently it has started happening again, so I'm assuming it is triggered by something specific in my YANG code, but I have no idea what.

I'm using YANG for Visual Studio Code 1.7.0 (typefox.yang-vscode)

Version: 1.43.2
Commit: 0ba0ca52957102ca3527cf479571617f0de6ed50
Date: 2020-03-24T07:52:11.516Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.5.7-arch1-1-audio-patched

Is there any more information I can provide?

Auto-completion function does not work

Hello.
I recently introduced this plugin to develop Yang with VScode.
The syntax highlighting is working, but I'm having trouble with auto-completion not working.
Please help me.
スクリーンショット 2020-05-12 12 24 25
スクリーンショット 2020-05-12 12 24 38

Yang autofill not working consistently

One of the greatest feature of yangster is, auto fill syntax when typing on VS Code for Yang files. But it works when first time extension installed, but if VS code is reloaded or reopen it stops working.

Only solution to uninstall the extension and install again.

Any consistent solution for this?

Cannot disable bad-import-yang-version

Thank you for making this extension!

I have YANG models that I am using with Cisco NSO (Network Services Orchestrator), and cannot disable bad-import-yang-version error.

I have set up my ~/.yang/yang.settings file like this:

{
  "yangPath": "/Path/to/ietf:/tailf/modules",
  "diagnostic": {
    "bad-import-yang-version": "ignore",
    "ambiguous-import": "ignore"
  }
}

I have also tried placing this same configuration into yang.settings at my project root.

Setting "ambiguous-import" to "ignore" works just fine, as those warnings are now disabled.

I currently have some "duplicate-name" errors in my YANG, and as an experiment, successfully changed/disabled those errors using yang.settings as well.

The bad-import-yang-version errors do not disappear until I explicitly put

module my-module {
    yang-version 1.1;

at the top of the module (which isn't usually necessary for Cisco NSO to infer the version).

Adding the explicit yang-version leaf at the top of the modules isn't a huge pain, but wanted to report this behavior. I am wondering if it is a bug, or if I should be using some other configuration.

Multi-root workspace support

This extension doesn't seem to support multi-root workspaces. If I have a workspace with multiple folders, I find that the Yang LS runs only in one of these folders (the one appearing first in the workspace file). It therefore doesn't parse the Yang modules in the remaining folders (unless I explicitly open them). This leads to errors like failing to find imported modules.

It seems like a fairly simply solution would be to run multiple instances of the LS, one per folder. Then the per-folder yang.settings can be used to specify the include path to handle dependencies between the folders. Of course, this might result in some modules being processed by both instances, so isn't ideal but is better than nothing.

It would be better if it could be handled using a single LS instance, but I can imagine this might require changes to the LS itself (to support multiple roots).

Formatting not honoring VS Code settings

We have YANG files that are already formatted using spaces with a tabSize of 2. The yangster VS Code extension is reformatting those files with a tabSize of 4 and none of the settings I've configured override the 4 space behavior.

I've tried settings for yang files

    "[yang]": {
        "editor.insertSpaces": true,
        "editor.tabSize": 2
    },

and global settings

    "editor.insertSpaces": true,
    "editor.tabSize": 2

We also use editorconfig which sets

# YANG
[*.yang]
indent_style = space
indent_size = 2

This might be an issue with yang-lsp.
There is code for insertSpaces and tabSize but it's unclear where those options are set (I assume it's intended to get those from the client, VS Code, but I don't know anything about the language server protocol).
yang-lsp/io.typefox.yang.ide/src/main/java/io/typefox/yang/ide/formatting/YangFormattingService.xtend

		if (options !== null) {
			if (options.insertSpaces) {
				indent = Strings.padEnd("", options.tabSize," ")
			}
		}

I appreciate any guidance you can provide.

autocomplete not functioning

On mac os x (High Sierra) with java version "1.8.0_151" autocomplete is not functioning. Is there a complete list of requirements in order to have this feature working?

Config?

Are there any configuration settings for this extension? I'd like to turn of the "# references" that are inserted in the editor.
image

Unable to import "well-known" modules

Hi there, first of all great tool, it helps me a lot!

I use it with Cisco NSO primarily, and most of my modules have a set of imports for things like ietf-yang-types, tailf-ncs, etc at the beginning, but yangster doesn't seem to be able to resolve those. They are underlined and hovering over them prints up "Couldn't resolve reference to AbstractModule 'ietf-yang-types'.(org.eclipse.xtext.diagnostics.Diagnostic.Linking)".

Is there any way to fix this or at least ignore these errors?

Thanks!

Save Yang Diagram

Can we have the option to save the yang diagram with good resolution? When the yang file is big we can not take a screenshot that fits in page

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.