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

Extension - vscode-python: Crashing when retreiving 'packageJSON' #1139

Closed
bryphe opened this issue Dec 31, 2019 · 10 comments
Closed

Extension - vscode-python: Crashing when retreiving 'packageJSON' #1139

bryphe opened this issue Dec 31, 2019 · 10 comments
Labels
A-extension Area: Extension/plugin integration, vscode or VimL bug Something isn't working

Comments

@bryphe
Copy link
Member

bryphe commented Dec 31, 2019

After #1138 , the python extension is crashing here:
https://github.com/microsoft/vscode-python/blob/f3084f27d141f8792a04df629205d14bc7612de3/src/client/telemetry/index.ts#L62

It may be that our vscode-exthost is out-of-date or not giving the extension information in the expected way. We should check to see the extension ID being returned, and whether the packageJSON is available.

@bryphe bryphe added A-extension Area: Extension/plugin integration, vscode or VimL bug Something isn't working labels Dec 31, 2019
@thomas-haslwanter
Copy link

thomas-haslwanter commented Jan 6, 2020

I also could not install the Python VSIX extension, neither with the command-line option
"install-extension" (which did not do anything)
I also tried copying the VSIX-file there, to no avail.
Nor could I do it manually, with creating the "extensions" directory in the ONI2_CONFIG_DIR, and cloning https://github.com/Microsoft/vscode-python there. This effort resulted in the message "Extension activation failed" when opening a .PY-file

@CrossR
Copy link
Member

CrossR commented Jan 6, 2020

I also could not install the Python VSIX extension, neither with the command-line option
"install-extension" (which did not do anything)

I think this is due to two issues: No output from the command (which there is a PR for) and an absolute path to the VSIX currently being required (which I can hopefully fix tonight).

The second part (i.e. Extension activation failed) is due to the error in the issue title I think. If you run oni2 -f from the command line to see the debug log, you should get an error about TypeError: Cannot read property \'packageJSON\' of undefined\...., so you at least have the same error we have 😅

@thomas-haslwanter
Copy link

There has been some progress: the latest version of onivim (0.3.0) now installs the vsc-de-python extension. This is confirmed, when "--list-extensions" indicates "python".

However: I do not see any effect, such as tab-completion, finding the definition of variables or functions, etc.
Maybe I have to complete some "settings" somewhere?
Would be grateful for hints.

@Govinda-Fichtner
Copy link

I see the same behaviour that @thomas-haslwanter is describing on Mac OS X with Onivim 2 (0.3.0).

On the notification tab I see "Extension activation failed, run the 'Developer: Toogle Developer Tools' command for more information.

I cannot find that command in the search result list of commands.

@thomas-haslwanter
Copy link

Just wanted to report that the problem is still present with Onivim2 ver 0.4.0

@mr-sour
Copy link

mr-sour commented May 23, 2020

I was able to use a older version and it looks like that is working. I used ms-python.python-2020.1.58038.vsix The newer versions I couldn't get to work. And theres certain functionality that isn't available but I assume those are features the extension is trying to use not yet available in oni2. If someone wants a workaround try the older version.

➜  Downloads oni2 --install-extension ./ms-python.python-2020.5.80290.vsix 
Successfully installed extension: ./ms-python.python-2020.5.80290.vsix
# ^ this one installs but doesn't work the version below seemed to work just fine.
➜  Downloads oni2 --install-extension ./ms-python.python-2020.1.58038.vsix 
Successfully installed extension: ./ms-python.python-2020.1.58038.vsix

image

@bryphe
Copy link
Member Author

bryphe commented May 23, 2020

@mr-sour - that's great! Thanks for sharing.

I recently merged a PR to get past the retrieving packageJSON error: #1788 - however, at least for the new Python extensions, they rely on an API surface we haven't implemented yet - I'm working through that here: #1805

That's exciting that the earlier Python extension works, though - might've been before they started relying on the vscode.workspace.fs APIs to discover the interpreter. Means we're getting closer, though!

@bryphe
Copy link
Member Author

bryphe commented Jul 20, 2020

Several of the python blockers have been fixed now, in these PRs:
#1141
#1788 (package.json issue referenced in the title)
#2106
#2117

And I've added some documentation here: #2121

There is still one blocking bug - microsoft/vscode-python#12465 - but it's been fixed in master. Just waiting for the latest extension to roll up to open-vsx so I can revise the instructions.

This version of the extension seems to be working, in the meantime:
https://github.com/microsoft/vscode-python/releases/download/2020.5.86806/ms-python-release.vsix

I'll close this, since the original issue it's tracking has been fixed in #1788 - but please let me know if you're still seeing issues with python support 👍

@bryphe bryphe closed this as completed Jul 20, 2020
@kevinrohrbach
Copy link

Hello @bryphe
I've only just discovered this wonderful project and had to jump in straight away.
I installed the python extension as detailed in the documentation and when launching oni2 from the terminal it mostly works. I get highlighting, suggestions etc.

The only issue I'm having is that when I write code oni2 will not auto indent code. I've been unable to find any mention of this issue anywhere and I'm unsure if it's already been addressed, or simply not implemented yet.

Thanks

@bryphe
Copy link
Member Author

bryphe commented Feb 20, 2021

Hi @kevinrohrbach ,

Thanks for the kind words! I'm glad the highlighting and suggestions are working 👍

It looks like auto-indent is actually somewhat problematic - there are a few github issues logged against the vscode-python extension regarding auto-indent:

There was an extension built to try and fix these issues here: https://github.com/kbrose/vsc-python-indent - but unfortunately the API it uses isn't wired up to Onivim, yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-extension Area: Extension/plugin integration, vscode or VimL bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants