openHAB VS Code Extension 0.3.0

vscode
Tags: #<Tag:0x00007f1837ee87d8>

(Kuba Wolanin) #1

What’s new

  • Introduced openHAB Things Explorer view in the sidebar!
    • Create Items directly from Thing’s channels.
    • Quick copy name and Thing UID directly from the sidebar
    • Quick access to the binding documentation
  • Insert into Sitemap feature in the openHAB Items view
  • Various Language Server Protocol fixes
  • New configuration parameters:
    • restCompletions - toggles completions from REST API
    • paperPath - defaults to paperui. Change it to ui if you’re using openHAB build from before 9th Jan 2017
    • paperInBrowser - if set to true, will open Paper UI in a browser instead of VSCode window
    • lspEnabled - if true, will enable communication with openHAB’s Language Server. Note that misc-lsp add-on needs to be installed.
    • lspPort - defaults to 5007, custom LSP port parameter (#42)
  • Fixed “switch” icon coloring (#18)
  • “Set openHAB host” button on error message (#42)
  • Breaking change: openhab.port parameter is now a number (e.g. 8080 instead of "8080").
    Please change it in your settings after upgrade.

Things Explorer demo

Sitemap Insert demo

Installation

This extension is available on the Visual Studio Marketplace -> https://marketplace.visualstudio.com/items?itemName=openhab.openhab

You can also install it manually:

  1. Download openhab-0.3.0.vsix on your hard drive
  2. Open command line in the same folder you downloaded the extension
  3. Type the following command:
code --install-extension openhab-0.3.0.vsix

This version will override the previous one.

  1. Open Visual Studio Code
  2. Open openhab configuration (openHAB-conf) folder as your workspace
  3. Open user settings (Ctrl/Cmd + Shift + S) and set "openhab.host" to your openHAB IP address
  4. Enjoy! :wink:

Eclipse Smart Home Designer tutorial?
Jetty update, Karaf 4.1.3 upgrade and full LSP support
(Christoph) #2

I get the following errors (openHAB 2.2.0 Build #1077 and Visual Studio Code 1.18.0):

  1. when I hover over an element:
[Error - 09:53:59] Request textDocument/hover failed.
  Message: Internal error, please look at the server's logs.
  Code: -32603 
2017-11-15 09:53:59.511 [ERROR] [eclipse.lsp4j.jsonrpc.RemoteEndpoint] - Internal error: java.lang.NullPointerException
java.util.concurrent.CompletionException: java.lang.NullPointerException
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273) [?:?]
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280) [?:?]
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:604) [?:?]
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577) [?:?]
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:442) [?:?]
	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.NullPointerException
	at org.eclipse.xtext.ide.server.WorkspaceManager.getProjectManager(WorkspaceManager.java:173) ~[?:?]
	at org.eclipse.xtext.ide.server.WorkspaceManager.doRead(WorkspaceManager.java:229) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$hover$23(LanguageServerImpl.java:539) ~[?:?]
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lambda$runRead$2(RequestManager.java:116) ~[?:?]
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602) ~[?:?]
	... 5 more
  1. when I start typing:
[Error - 10:00:07] Request textDocument/completion failed.
  Message: Internal error, please look at the server's logs.
  Code: -32603 
2017-11-15 10:00:07.734 [ERROR] [eclipse.lsp4j.jsonrpc.RemoteEndpoint] - Internal error: java.lang.NullPointerException
java.util.concurrent.CompletionException: java.lang.NullPointerException
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273) [?:?]
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280) [?:?]
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:604) [?:?]
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577) [?:?]
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:442) [?:?]
	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.NullPointerException
	at org.eclipse.xtext.ide.server.WorkspaceManager.getProjectManager(WorkspaceManager.java:173) ~[?:?]
	at org.eclipse.xtext.ide.server.WorkspaceManager.doRead(WorkspaceManager.java:229) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.completion(LanguageServerImpl.java:427) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$completion$13(LanguageServerImpl.java:406) ~[?:?]
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lambda$runRead$2(RequestManager.java:116) ~[?:?]
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602) ~[?:?]
	... 5 more


(Semperor) #3

I can’t give you enough thank you and :heart_eyes: for this work!


(Kuba Wolanin) #4

Hey @Syn, thanks for reporting!

I’ve encountered this issue as well and @sjka already provided a fix for that (See this comment).
We need to wait for a new openHAB Distro and ESH Build in order to fully leverage the Language Server Protocol support along with the completions (@Kai wink wink :wink: )

A workaround for now would be to temporarily disable LSP - hit Ctrl/Cmd + , in VSCode and set

"openhab.lspEnabled": false,
"openhab.restCompletions": true

Sorry for inconveniences! :slight_smile: LSP support is still in a heavy development both in ESH and here, so if you encounter any problems with it, please address them in the github issues.


(David Read) #5

Thank you so much for this. I’ve been using 0.2.0 for a while now.

I’ve just upgraded to 0.3.0 and I get an exception in the logs:

2017-11-15 12:03:38.946 [ERROR] [eclipse.lsp4j.jsonrpc.RemoteEndpoint] - Internal error: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:53) ~[209:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:105) [209:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:203) [209:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:139) [209:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:149) [209:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:77) [209:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:84) [209:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	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:1142) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
	at java.lang.Thread.run(Thread.java:745) [?:?]
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:51) ~[?:?]
	... 11 more
Caused by: java.lang.IllegalArgumentException: URI has an authority component
	at sun.nio.fs.UnixUriUtils.fromUri(UnixUriUtils.java:53) ~[?:?]
	at sun.nio.fs.UnixFileSystemProvider.getPath(UnixFileSystemProvider.java:98) ~[?:?]
	at java.nio.file.Paths.get(Paths.java:138) ~[?:?]
	at org.eclipse.xtext.ide.server.UriExtensions.toPath(UriExtensions.java:36) ~[?:?]
	at org.eclipse.xtext.ide.server.UriExtensions.toUri(UriExtensions.java:26) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getBaseDir(LanguageServerImpl.java:225) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.initialize(LanguageServerImpl.java:176) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:51) ~[?:?]
	... 11 more

Do I need to supply authorisation for lsp? Or am I misunderstanding the error.
I’m on openHABian, build #1077, on an RPI3.


(Kuba Wolanin) #6

Hey @DavidR see my response to @Syn: openHAB VS Code Extension 0.3.0

Also please check if it’s related to this issue: https://github.com/eclipse/smarthome/issues/4459

If not, it would be worth to rasie an issue on either Eclipse SmartHome or VSCode extension github.
@sjka does the runtime error David is experiencing look familiar to you?

Cheers,
Kuba


(David Read) #7

Yes, it does look like the same.
I’ll disable lsp in the settings for now.
Thanks.


(Simon Kaufmann) #8

“URI has an authority component” sounds different - as if the file location is invalid (from the perspective of a linux file system). Just a guess: Are you using VSCode on Windows and access the files via a samba share?


(David Read) #9

Yes I’m on Windows and samba shares. But I can read and write OK.
Let me know if more information will help.


(Kai Kreuzer) #10

I hear you and I must say that you and @sjka are a fantastic team! I just pushed the latest changes from ESH to openHAB and the latest distro #1081 includes them. I successfully tested content completion with extension 0.3.0 - it is really awesome!

Question: Is it possible to sort the entries by type? It feels a bit awkward to have all the item names being distributed throughout the proposal list, which makes it really hard to find methods on objects. When writing rules, available methods should imho be at the very top of the proposal list when calling content assist after a “.”.

@sjka I also found this in my log:

21:58:22.629 [ERROR] [.eclipse.lsp4j.jsonrpc.RemoteEndpoint] - Internal error: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: org/objectweb/asm/ClassReader
java.util.concurrent.CompletionException: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: org/objectweb/asm/ClassReader
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273) [?:?]
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280) [?:?]
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:604) [?:?]
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577) [?:?]
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:442) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
	at java.lang.Thread.run(Thread.java:745) [?:?]
Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/ClassReader
	at org.eclipse.xtext.xbase.ide.types.ClasspathTypeDescriptor.forJarEntry(ClasspathTypeDescriptor.java:150) ~[?:?]
	at org.eclipse.xtext.xbase.ide.types.ClasspathScanner.loadJarDescriptors(ClasspathScanner.java:229) ~[?:?]
	at org.eclipse.xtext.xbase.ide.types.ClasspathScanner.loadDescriptors(ClasspathScanner.java:154) ~[?:?]
	at org.eclipse.xtext.xbase.ide.types.ClasspathScanner.lambda$getDescriptors$1(ClasspathScanner.java:83) ~[?:?]

Might there still be some imports missing?


Sonos things are offline
(Nigel Evans) #11

Since the upgrade, I’m not getting the ‘OpenHab items’ pane populating. Tried overiding the language server settings, by adding

"openhab.lspEnabled": false,
 "openhab.restCompletions": true

I’m running lataest VS Code, and openHAB 2.2.0 Build #1080


(Mark) #12

After upgrading to 0.3.0 and OH 1081, I’m seeing this. I’m running vscode on a Mac and a Windows box accessing a samba share on my OH linux box.

2017-11-15 17:36:45.315 [WARN ] [eclipse.lsp4j.jsonrpc.RemoteEndpoint] - Notification threw an exception: {
  "jsonrpc": "2.0",
  "method": "textDocument/didOpen",
  "params": {
    "textDocument": {
      "uri": "file:///Volumes/openhab/openhab2/conf/rules/doorbell.rules",
      "languageId": "openhab",
      "version": 1,
      "text": "<<full-text-of-rule>>"
    }
  }
}java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:53) ~[190:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:126) [190:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:165) [190:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:136) [190:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:149) [190:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:77) [190:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:84) [190:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	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.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:51) ~[?:?]
	... 11 more
Caused by: java.lang.NullPointerException
	at org.eclipse.xtext.ide.server.WorkspaceManager.getProjectManager(WorkspaceManager.java:173) ~[?:?]
	at org.eclipse.xtext.ide.server.BuildManager.internalBuild(BuildManager.java:150) ~[?:?]
	at org.eclipse.xtext.ide.server.BuildManager.doBuild(BuildManager.java:125) ~[?:?]
	at org.eclipse.xtext.ide.server.WorkspaceManager.doBuild(WorkspaceManager.java:153) ~[?:?]
	at org.eclipse.xtext.ide.server.WorkspaceManager.didOpen(WorkspaceManager.java:202) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$didOpen$4(LanguageServerImpl.java:263) ~[?:?]
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.runWrite(RequestManager.java:71) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.didOpen(LanguageServerImpl.java:266) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:51) ~[?:?]
	... 11 more

(Simon Kaufmann) #13

Now @DavidR and @mhilbush are both having troubles with using VSCode via samba shares which smell like files cannot be located correctly. I fear this is something which is not yet properly covered by the language server protocol itself, so I opened eclipse/smarthome#4564 to further analyze, discuss and hopefully find a workaround for it.


(-) #14

Hi @sjka/@kubawolanin
I noticed that Kai had pushed a symlinks related update to the latest build (build 1082). However, I am also still getting the invocation error that @DavidR and @mhilbush reported.

2017-11-18 17:14:47.082 [WARN ] [rver.session.ServerConnectionService] - globalRequest(ServerConnectionService[ServerSessionImpl[openhab@/127.0.0.1:50802]])[tcpip-forward, want-reply=true] failed (BindException) to process: Address already in use
2017-11-18 17:14:48.039 [INFO ] [thome.model.lsp.internal.ModelServer] - Language Server started on port 5007
2017-11-18 17:16:22.359 [ERROR] [eclipse.lsp4j.jsonrpc.RemoteEndpoint] - Internal error: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:53) ~[250:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:105) [250:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:203) [250:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:139) [250:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:149) [250:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:77) [250:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:84) [250:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	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.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:51) ~[?:?]
	... 11 more
Caused by: java.lang.IllegalArgumentException: URI has an authority component
	at sun.nio.fs.UnixUriUtils.fromUri(UnixUriUtils.java:53) ~[?:?]
	at sun.nio.fs.UnixFileSystemProvider.getPath(UnixFileSystemProvider.java:98) ~[?:?]
	at java.nio.file.Paths.get(Paths.java:138) ~[?:?]
	at org.eclipse.xtext.ide.server.UriExtensions.toPath(UriExtensions.java:36) ~[?:?]
	at org.eclipse.xtext.ide.server.UriExtensions.toUri(UriExtensions.java:26) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getBaseDir(LanguageServerImpl.java:225) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.initialize(LanguageServerImpl.java:176) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:51) ~[?:?]
	... 11 more

PS Thanks for an absolutely superb tool!


(Mark) #15

You need to wait for an OH build that includes the next stable Eclipse Smart Home (ESH) build. 1082 still has the ESH build that has the URI mapping issue.


(-) #16

Thanks and I just saw that. I saw the “Support path mapping in Language Server” merge on ESH and in my excitement, didn’t check when was the last successful build on Cloudbees!


(Kai Kreuzer) #17

Good news, we have a new build and it even includes all the latest LSP fixes! Samba should work and content completion as well.
Another change is that the LSP support is now included by default, so no need to install it as a separate add-on anymore (I am sure, @kubawolanin will like this!).


(Dries) #18

Hi all,
I just upgraded to the latest build (#1084) and have the latest VS Code (+ OH extension) installed. When I start VS Code, I get:
image

In openhab.log, I see:

2017-11-19 10:05:55.369 [ERROR] [eclipse.lsp4j.jsonrpc.RemoteEndpoint] - Internal error: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:53) ~[104:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:105) [104:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:203) [104:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:139) [104:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:149) [104:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:77) [104:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:84) [104:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
	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.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:51) ~[?:?]
	... 11 more
Caused by: java.lang.IllegalArgumentException: URI has an authority component
	at sun.nio.fs.UnixUriUtils.fromUri(UnixUriUtils.java:53) ~[?:?]
	at sun.nio.fs.UnixFileSystemProvider.getPath(UnixFileSystemProvider.java:98) ~[?:?]
	at java.nio.file.Paths.get(Paths.java:138) ~[?:?]
	at org.eclipse.smarthome.model.lsp.internal.MappingUriExtensions.guessClientPath(MappingUriExtensions.java:94) ~[?:?]
	at org.eclipse.smarthome.model.lsp.internal.MappingUriExtensions.toUri(MappingUriExtensions.java:66) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getBaseDir(LanguageServerImpl.java:225) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.initialize(LanguageServerImpl.java:176) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:51) ~[?:?]
	... 11 more

I get that pretty consistently (everytime I start VS Code).

I must say I am new to VS Code. So it might not be related to the upgrade, but maybe something I am doing wrong…


VS Code openHAB Extension!
(SiHui) #19

Same here :joy:


(Kuba Wolanin) #20

@sjka I’m experiencing the same issues @Dries and @sihui does.