hass-pyscript-jupyter icon indicating copy to clipboard operation
hass-pyscript-jupyter copied to clipboard

Pyscript autocomplete doesn't work in VSCode

Open tms320 opened this issue 2 years ago • 3 comments

I have installed Pyscript integration to Home Assistant (it runs on Ubuntu machine). Then I installed HASS Pyscript kernel shim for Jupyter on my Windows machine (where VSCode installed). If I open the browser-based Jupyter client (using 'jupyter notebook' command) and create new notebook, the autocomplete of HASS objects works fine (using Tab key). For example: image image But in VSCode autocomplete for HASS objects doesn't work (I press Ctrl+Space key combination): image image What am I doing wrong?

tms320 avatar Dec 10 '22 15:12 tms320

Same issue here. No autocomplete within vscode. Anyone ever resolve this?

Gavin-Whitesitt avatar Aug 28 '23 06:08 Gavin-Whitesitt

Same here.

Anybody know how iPython/Juypiter receives all possible autocomplete values?

Devenda avatar Sep 25 '23 17:09 Devenda

I just spent some time on this, but gave up for now. There are two existing settings in VSCode which sound relevant:

  • jupyter.enableKernelCompletions: Enable code completions in Notebooks and Interactive Windows using results from the associated Jupyter Kernel.
  • jupyter.enableExtendedPythonKernelCompletions: Enables Jedi support for extended IntelliSense completions in running Python Jupyter kernels for Python (see this setting). This can greatly impact notebook cell execution performance. Use with caution.

The former seems to fit the ticket, but seems that turning it on causes VSCode uses an IPython magic command which Pyscript doesn't support:

Exception in <jupyter_60> line 54:
        %config Completer.use_jedi = False
        ^
    SyntaxError: invalid syntax (jupyter_60, line 54)

I tried a quick hack to skip this, but VSCode immediately starts hitting other strange issues:

NameError: name '__VSCODE_send_chat_message__' is not defined

I'm new to both Python and Jupyter, so not going to explore deeper right now. Jupyter Notebook/Lab seem to work great, but would be nice if someone could figure out VSCode too.

mikejhill avatar Sep 08 '24 22:09 mikejhill