-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Is it possible to recognise file extensions other than .py
and .pyi
?
#35
Comments
It is. Simple and straightforward, even. Here's how the language server knows that it should be enabled for Line 55 in 0e28e9a
Adding extensions is, obviously, trivial, but this should be made an optional choice. That is, a field should be added for users to configure the file extensions that they want their language server to run on. As a non-Cython user, I certainly don't want to let Pyright blow up the editor with tons of "syntax" errors in some That said, this will be supported, but only as a nice-to-have byproduct. I'll work on a PR in a few hours (whose build should be automatically uploaded via GitHub Actions). Since I never worked with Cython, I'm relying on you to test it. By the by, this issue is finely written. Thanks for that. |
I was searching in this repo for the string ".pyi", which is probably why I didn't find that line of code. It seems that supporting user-defined extensions would allow Python users to opt-in into running the plugin against Thank you! |
Feature or enhancement
Is it possible for this plugin to recognise other file extensions apart from just
.py
and.pyi
to communicate withpyright-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.Proposed solution
Expose ability for user specification of files or file extensions in the
Pyright LS
settings to communicate withpyright-langserver
.Alternatives considered
No response
Additional context
I was experimenting and managed to get Cython type checking, code completion, and code navigation working by pointing the
Project executable
to a modifiedpyright-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 ofnpm run build:extension
).pyright._utils::install_pyright
returnpathlib.Path("<VS Code extensions folder>/vs-code-cython/cyright/packages/pyright")
The text was updated successfully, but these errors were encountered: