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

Python extension integration does not work with Code OSS / VSCodium #1318

Closed
rogermparent opened this issue Feb 14, 2022 · 3 comments
Closed
Labels
bug Something isn't working discussion

Comments

@rogermparent
Copy link
Contributor

rogermparent commented Feb 14, 2022

VSCodium is a pure open-source version of VSCode (think Chromium vs Google Chrome), and is the default version in some Linux distros' repositories (Arch-based for me). When switching to the mainline Microsoft VSCode, this Issue is not present.

After a recent update, I cannot get our extension to see dvc as available even though it can be run in the integrated terminal when automatically activated by the python extension.

I've managed to track this down to the ready promise within the ms-python.python throwing due to the following error:

stack trace: Error: Extension 'ms-python.python' CANNOT use API proposal: testObserver.
Its package.json#enabledApiProposals-property declares:  but NOT testObserver.
 The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api ms-python.python
	at E (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:91:64217)
	at Object.get testResults [as testResults] (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:107:33481)
	at w.activate (/home/roger/.vscode-oss/extensions/ms-python.python-2022.0.1814523869/out/client/extension.js:85:74805)
	at /home/roger/.vscode-oss/extensions/ms-python.python-2022.0.1814523869/out/client/extension.js:67:87919
	at Array.map (<anonymous>)
	at f.activateWorkspace (/home/roger/.vscode-oss/extensions/ms-python.python-2022.0.1814523869/out/client/extension.js:67:87910)
	at processTicksAndRejections (internal/process/task_queues.js:93:5)

If our await extension.ready call is either removed or wrapped in a try/catch block such that a rejection does not cancel the process of collection execution details, the extension again works in VSCodium. I don't know the ramifications of either of these.

As far as I can tell, there are two possible solutions to this problem:

  1. Implement the fix of wrapping ready in try/catch so our extension tries to get execution details even if ready rejects.
  2. Do not implement any fix and mention in the README that the Python extension integration is broken in VSCodium.

While I personally lean toward 1 or a derivative of it (maybe logging the error while continuing) because it fixes an issue that will seemingly become a problem for many Linux users and any other VSCodium users with little drawbacks, I understand if we decide as a group to lean toward 2 because it looks like a more proper way to use the Python extension's API.
With that said, I do think we should either implement a fix or document the incompatibility so at least VSCodium users who do their due diligence by reading the README aren't lost.

Curious to see what everyone else (@iterative/vs-code) thinks, I'm happy to do the implementation of either fix once we decide on one.

@rogermparent rogermparent added bug Something isn't working discussion labels Feb 14, 2022
@mattseddon
Copy link
Member

Option 3: make ms-python.python repo aware of the issue.
Option 4: wait to see if VSCodium catches up to VS Code.

Options are not mutually exclusive.

@mattseddon
Copy link
Member

mattseddon commented Feb 15, 2022

Seems like this is a known issue with VSCodium and the Python extension.

There is a rabbit hole that starts here: VSCodium/vscodium#940

Have a look here: https://github.com/VSCodium/vscodium/pull/935/files#diff-3f4fe07ebe4ba7ea65472755ddc67a72905bc98e55b5b84a2055c7e36b6f1054R105

And here: https://github.com/VSCodium/vscodium/blob/master/DOCS.md?plain=1#L92

We should not have to support this.

@rogermparent
Copy link
Contributor Author

rogermparent commented Feb 15, 2022

Closing since this is more of a niche issue than I originally thought, as the Python extension is severely crippled on VSCodium by not having PyLance and we already have features to work around it in workspace setup.

If this ever comes up for a user, they can find this Issue when searching "VSCodium".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants