pyscript icon indicating copy to clipboard operation
pyscript copied to clipboard

PyRight LSP

Open Hugo-Persson opened this issue 1 year ago • 9 comments

Foremost, I love this project. Really great work!

Is there any way to make pyright recognize the variables provided? I currently get a lot of annoying errors from my LSP. It would be really nice to not get errors and get completions.

For example: image

Hugo-Persson avatar Apr 11 '24 13:04 Hugo-Persson

Here's the cure for you: https://github.com/dmamelin/pyscript_autocomplete

ALERTua avatar Apr 11 '24 13:04 ALERTua

Thank you, I am going to try this!

Hugo-Persson avatar Apr 11 '24 13:04 Hugo-Persson

@ALERTua what is meant by this step? Copy the apps/pyscript_autocomplete folder to your PyScript directory.

Where is the apps folder?

Hugo-Persson avatar Apr 11 '24 14:04 Hugo-Persson

apps = /config/pyscript/apps

ALERTua avatar Apr 11 '24 14:04 ALERTua

@ALERTua I do not have this folder, I only have my scripts under config/pyscript/

My config looks like this:

pyscript:
  allow_all_imports: true
  hass_is_global: true
  apps:
    pyscript_autocomplete:

Hugo-Persson avatar Apr 11 '24 14:04 Hugo-Persson

then create it.

ALERTua avatar Apr 11 '24 14:04 ALERTua

But what should be copied:

Copy the apps/pyscript_autocomplete folder to your PyScript directory.

Hugo-Persson avatar Apr 11 '24 14:04 Hugo-Persson

I also do not have the service pyscript.autocomplete_generator service.

Hugo-Persson avatar Apr 11 '24 14:04 Hugo-Persson

Omg I am stupid, the files are in the repo

Hugo-Persson avatar Apr 11 '24 19:04 Hugo-Persson