insyncwithfoo / pyright-langserver-for-pycharm Goto Github PK
View Code? Open in Web Editor NEWPyright language server integration for PyCharm Professional
Home Page: https://insyncwithfoo.github.io/pyright-for-pycharm/
License: MIT License
Pyright language server integration for PyCharm Professional
Home Page: https://insyncwithfoo.github.io/pyright-for-pycharm/
License: MIT License
See sister #13.
First - thanks or creating this plugin!
I noticed that docstrings which use the restructured/"sphinx"
format is not rendered properly in the quick doc dialog. It would be nice if they where.
microsoft/pylance-release#5363 is maybe related? But the plugin could still render based on the raw text. Ideally the plugin would pass the docstring through pycharms own renderer which respect the project setting for docstring format, but I have no idea how hard that would be to implement
On CLion, ProjectRootManager.getInstance(project).projectSdk
returns null
.
Thank you for this! I have gotten it to work and it is awesome. Here are some of the issues I had getting started:
brew install pyright
(pip or conda would also work)/opt/homebrew/bin/pyright-langserver
(or the pip installationthe ruff plugin seems to conditionally use the language server if the user is on pycharm professional: https://github.com/koxudaxi/ruff-pycharm-plugin/blob/befe74aa4558a348c968f66b64e9374fe6b38a6b/resources/META-INF/plugin.xml#L9
No response
i work in a team where some users have community and some users have professional. i want to specify this plugin in the "required plugins" list for the project so that users are prompted to install it, but that won't work because depending on which version of pycharm they're using, they'll need to install a different plugin
The auto import says "Auto-Complete", whereas the native PyCharm import lists the path (e.g. src.utils). When importing something that can be imported from several files that's unpractical. When selecting it a box pops up that lists where the import is coming from but that's a way slower UX than seeing it directly in the autocomplete popup.
Put the import path directly in the autocomplete popup instead of "Auto-Import".
No response
No response
When I accept an autocompleted Literal
value it inserts an '
or "
at the end
Command = Literal['first', 'second']
s: Command = '' # accept the autocomplete with the caret inside the quotes - Result: 'first''
No response
None
See sister #19.
Pyright only supports pyrightconfig.json files at the root of an LSP workspace. I'd like pyright to recognize pyrightconfig.json
files in Source Root folders. This plugin currently uses ProjectWideLspServerDescriptor
:
I think we can instead inherit
LspServerDescriptor(project, PRESENTABLE_NAME, *project.modules.flatMap { m -> ModuleRootManager.getInstance(m).sourceRoots.asIterable() }.toTypedArray())
See #26.
Is it possible for this plugin to recognise other file extensions apart from just .py
and .pyi
to communicate with pyright-langserver
? If it were, a thin wrapper over pyright-python will allow use of this plugin for adventurous Pyright forks developed for non-Python languages.
Expose ability for user specification of files or file extensions in the Pyright LS
settings to communicate with pyright-langserver
.
No response
I was experimenting and managed to get Cython type checking, code completion, and code navigation working by pointing the Project executable
to a modified pyright-langserver
which launched vscode-cython.
The result worked surprisingly well, apart from the issue that Cython files themselves (.pyx
, .pxd
, .pxi
) weren't recognised by the LSP, so you could only get the benefits by writing Cython in .py
files. Cython syntax is, of course, illegal in Python, so IntelliJ IDEs will complain; it'd be great if it were possible to make this plugin recognise user-specified file extensions.
Note that include/exclude path settings in a pyright configuration file is not currently possible with vscode-cython, so if that's the only way to make this LSP plugin work, I apologise for posting this in the wrong place.
A way forward for IntelliJ's stagnant support of Cython would be much appreciated. Better Cython support in IntelliJ IDEs has been a feature in demand for years (see e.g. Cython support - CLion, which, unlike PyCharm, doesn't even have basic support).
In case anyone wanted to reproduce this:
vs-code-cython
into your platform's <VS Code extensions folder>
.npm run build:cli:dev
(instead of npm run build:extension
).pyright._utils::install_pyright
return pathlib.Path("<VS Code extensions folder>/vs-code-cython/cyright/packages/pyright")
my project uses pyright, but currently everyone in the team needs to manually configure the pycharm plugin themselves to work with our project
save the settings to a config file inside the .idea
folder, which can be committed so that others in my team automatically get the correct settings
No response
we use basedpyright (a fork of pyright), so we need to configure a different project executable. ideally this should only need to be done once and the config file can be committed, instead of each user having to configure it themselves
these settings are currently only configurable globally, but it would be useful if they could be configured in the project:
support the same settings available globally in the project as well
No response
i want to disable pycharm's awful type checking in favor of pyright's for my team, which ideally would include enabling hover and completion support from the language server. ideally my team shouldn't have to manually configure this themselves and i can instead just commit a config file
See sister #32.
See this comment. This issue is used to track the debugging progress.
See sister #15.
The plugin currently completes e.g. functions without adding parentheses. This is more in line with VSCode than Jetbrains IDEs.
Align it with how the native PyCharm autocomplete works. E.g. complete "my_func()" instead of "my_func"
No response
No response
For some reason {} Pyright
shows Terminated
status.
I am able to parse file directly using executable:
/Users/Silver/.pyenv/shims/pyright feeds/types.py
/Users/Silver/Projects/sandbox/jetstream/feeds/types.py
/Users/Silver/Projects/sandbox/jetstream/feeds/types.py:4:13 - information: Type of "x" is "Literal[4]"
0 errors, 0 warnings, 1 information
I believe I've followed the installation instructions.
my pyproject.toml
:
[tool.pyright]
include = ["."]
pythonVersion = "3.12"
typeCheckingMode = "strict"
I did:
No response
macOS
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.