Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gavinchlam opened this issue Jun 16, 2023 · 5 comments
Open

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

gavinchlam opened this issue Jun 16, 2023 · 5 comments
Assignees

Comments

@gavinchlam
Copy link

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!

@dhuebner
Copy link
Member

This is really strange YangSyncDiagramLanguageServer throws this exception because the service doesn't offer ISemanticHighlightingCalculator implementation, but it is registered in YangIdeModule.xtend https://github.com/TypeFox/yang-lsp/blame/master/yang-lsp/io.typefox.yang.ide/src/main/java/io/typefox/yang/ide/YangIdeModule.xtend#L115
Looks like io.typefox.yang.ide is not available.

@gavinchlam Is that a complete Java log? Which Java version do you have installed?

@gavinchlam
Copy link
Author

gavinchlam commented Jul 14, 2023

This is really strange YangSyncDiagramLanguageServer throws this exception because the service doesn't offer ISemanticHighlightingCalculator implementation, but it is registered in YangIdeModule.xtend https://github.com/TypeFox/yang-lsp/blame/master/yang-lsp/io.typefox.yang.ide/src/main/java/io/typefox/yang/ide/YangIdeModule.xtend#L115 Looks like io.typefox.yang.ide is not available.

@gavinchlam Is that a complete Java log? Which Java version do you have installed?

Hi @dhuebner, today I tried to open a new blank yang file in VS code and start putting something on it, and immediately a bunch of errors popping out:

[Error - 1:55:54 PM] 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)
Jul 14, 2023 1:55:54 PM 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 - 1:55:55 PM] 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

I guess fundamentally something is not working well here. The Java version I installed is Java SE 11.0.18, and just to confirm, the VS code extension installed is version 2.2.

@dhuebner
Copy link
Member

@gavinchlam
I will try to reproduce it today. Thank you for your report!

@dhuebner
Copy link
Member

dhuebner commented Jul 14, 2023

@gavinchlam
I was able to reproduce your issue with a file that has an uppercase letter in the file extension, e.g. test.Yang. Seems like a Case sensitivity issue.
I'm not able to test it with Windows, so could you please confirm that you are using .yang as file extension and the physical file effectively has this extension?
I will try to make yang-lsp to accept any case file extensions or at least provide a better error message.

@gavinchlam
Copy link
Author

@dhuebner
Actually the moment I saved the file as a .yang file there aren't any errors prompting, and seems like whether it's "yang" or "Yang", it doesn't really matter. However, while I have syntax highlighting, key reference and problems reported if the syntax are not correct, I don't have auto-completion or suggestion. Do I have to enable anything? Meanwhile I will continue to monitor if there're still any errors coming out.

Thanks.

@dhuebner dhuebner self-assigned this Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants