openhab / openhab-vscode

VS Code extension for openHAB configuration files
https://marketplace.visualstudio.com/items?itemName=openhab.openhab
Eclipse Public License 2.0
159 stars 47 forks source link

auto highlight the hole code when click on ITEMS #210

Open Thorhammerk opened 3 years ago

Thorhammerk commented 3 years ago

Hi, when i click on an ITEMS in VSC, the complete code in the file is highlighted in blue. i haven't found a setting to disable this behaviour. is it possible to disable it?

Bildschirmfoto 2020-07-13 um 14 12 07

best regards

Confectrician commented 3 years ago

Can you propvide some more deteils? VSCode and Extension Verison, OPerating System and where you are clicking on the item. I can't reproduce that currently.

Thorhammerk commented 3 years ago

Hi,

sure, when i click on the ITEM directly, one click (not double click). sometimes this only occurs after you have worked with VSC for a few minutes. Have you tested it in a rule file?

AegisVP commented 3 years ago

I have the same issue. At some point I was able to stop this behavior in OpenHAB2 by removing "openhab.karafCommand" setting. Now, with OpenHAB3 this has no effect. It happens when I click on an Item in a rules file, select an Item (completely or partially). Selecting any other part of the code has no such behavior. Selecting Item methods (.state, .sendCommand, .previousState) has no such behavior. Hovering over an Item shows the value correctly and doesn't highlight the text either. Selecting variables has no such behavior.

Windows 10 20H2 VSCode 1.53.2 (system setup) OpenHAB extension 0.8.0

Confectrician commented 3 years ago

Thanks for the description i am facing this behavior too. Let's see if i can try to add some more debugging to this, so we can get more informatoin of whats happenign under the hood.

Confectrician commented 3 years ago

I am a bit lost to be honest. I am trying to reproduce this behavior while debugging, but it simply doesn't occur when i am doing it in a debug session.

AegisVP commented 3 years ago

Is there something I can do to help you?

I was having this issue only if I had LSP enabled. It got so annoying that I turned it off for now.

Confectrician commented 3 years ago

You already helped me with that. 🙂 I have turned off lsp in my vscode test environment too.

So maybe LSP is causing the problems. I will try to get a running LSP in my debug environment and see if that's the error cause. If so, i have to say that we are not able to solve this on short term unfortunately.

Confectrician commented 3 years ago

It is indeed related to the LSP server. Probably a wontfix for now, since LSP is more or less not maintained currently.

kingkoopa13 commented 1 year ago

I'm having this issue too. It seem to start happening after updating the extension in the last week. For now, could someone point out how I might turn off LSP as a workaround?