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

Add instructions for PyLance workaround. #935

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not much of a workaround, but

This could be more formal

```json
"python.languageServer": "Pylance",
SebastianGrans marked this conversation as resolved.
Show resolved Hide resolved
```
or through the UI under "Python: Language Server"

**Option 2: Make PyLance think you are running the official builds**
Copy link
Collaborator

Choose a reason for hiding this comment

The 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:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That extra ` may cause some issues:

Suggested change
`The file can be found here:
The file can be found here:

Copy link
Collaborator

Choose a reason for hiding this comment

The 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**: `/usr/share/codium/resources/app/product.json`
* **MacOS**: `/Applications/VSCodium.app/Contents/Resources/app/product.json`
* **Windows**: `C:/Program Files (x86)/VSCodium/resources/app/product.json`

SebastianGrans marked this conversation as resolved.
Show resolved Hide resolved
Modify the followning line:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"following" is misspelt:

Suggested change
Modify the followning line:
Modify the following line:

```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:
Expand Down