-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add instructions for PyLance workaround. #935
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,6 +7,7 @@ | |||||
- [Extensions + Marketplace](#extensions-marketplace) | ||||||
- [How to use the VS Code Marketplace](#howto-vscode-marketplace) | ||||||
- [Proprietary Debugging Tools](#proprietary-debugging-tools) | ||||||
- [How to use the PyLance language server](#howto-pylance-language-server) | ||||||
- [Proprietary Extensions](#proprietary-extensions) | ||||||
- [Migrating from Visual Studio Code to VSCodium](#migrating) | ||||||
- [Sign in with GitHub](#signin-github) | ||||||
|
@@ -86,6 +87,37 @@ The debugger provided with Microsoft's [C# extension](https://github.com/OmniSha | |||||
|
||||||
A workaround exists to get debugging working in C# projects, by using Samsung's opensource [netcoredbg](https://github.com/Samsung/netcoredbg) package. See [this comment](https://github.com/VSCodium/vscodium/issues/82#issue-409806641) for instructions on how to set that up. | ||||||
|
||||||
### <a id="howto-pylance-language-server"></a>How to use the PyLance language server | ||||||
|
||||||
PyLance is Microsofts new [Python language server](https://devblogs.microsoft.com/python/announcing-pylance-fast-feature-rich-language-support-for-python-in-visual-studio-code/) which is one of the backend options for IntelliSense. This only works in the official VS Code builds. But there are two workarounds: | ||||||
|
||||||
**Option 1: Use the Jedi language server** | ||||||
Not much of a workaround, but one option is to not use PyLance and instead use the previous default: Jedi. This is done by adding the following line to `settings.json`. | ||||||
```json | ||||||
"python.languageServer": "Jedi", | ||||||
``` | ||||||
or through the UI under "Python: Language Server" | ||||||
|
||||||
**Option 2: Make PyLance think you are running the official builds** | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly insert Option 2: Use Pyright ? |
||||||
If you want to use PyLance server, it is very easy to convince PyLance that it is running in an official build. As presented in [Issue 892](https://github.com/VSCodium/vscodium/issues/892#issuecomment-957850440), you simply need to modify a single entry in `product.json`. | ||||||
|
||||||
`The file can be found here: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That extra ` may cause some issues:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these paths are already in the document, better reference this instead of adding it again |
||||||
* **Linux**: `/home/<user>/.config/VSCodium/product.json` | ||||||
* **MacOS**: `/Users/<user>/Library/Application Support/VSCodium/product.json` | ||||||
* **Windows**: `%APPDATA%\VSCodium\product.json` | ||||||
|
||||||
SebastianGrans marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
Modify the followning line: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "following" is misspelt:
Suggested change
|
||||||
```json | ||||||
"nameLong": "VSCodium", | ||||||
``` | ||||||
to | ||||||
```json | ||||||
"nameLong": "Visual Studio Code", | ||||||
``` | ||||||
|
||||||
Then restart Codium and PyLance should be working. | ||||||
|
||||||
|
||||||
### <a id="proprietary-extensions"></a>Proprietary Extensions | ||||||
|
||||||
Like the debuggers mentioned above, some extensions you may find in the marketplace (like the [Remote Development Extensions](https://code.visualstudio.com/docs/remote/remote-overview)) only function with the offical Visual Studio Code build. You can work around this by adding the extension's internal ID (found on the extension's page) to the `extensionAllowedProposedApi` property of the product.json in your VSCodium installation. For example: | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be more formal