LSP-pyright
LSP-pyright copied to clipboard
How to add the current project path to "python.analysis.extraPaths", currently using version 1.3.1
before the version 1.3.1,it's auto include it
We do have some logics for python.analysis.extraPaths
but I don't think LSP-pyright have ever included the current project path. What we do for python.analysis.extraPaths
is to find Sublime Text API stubs and installed Python libraries for Sublime Text plugin hosts and that only happens when the user sets pyright.dev_environment
. That's totally unrelated to your description.
Since your description is pretty specific, how do you find LSP-pyright adds the current project path to python.analysis.extraPaths
? Or, maybe, what you are actually trying to achieve?
Didn't see Path
(plaintext search) in pyright's recent changelog either 🤔
In the previous version, my custom module could be imported normally, but in this latest version, my project's custom module cannot be recognized. So I want to ask if there is any special parameter indicating the current project path
In the previous version, my custom module could be imported normally, but in this latest version, my project's custom module cannot be recognized. So I want to ask if there is any special parameter indicating the current project path
Could you provide a minimal reproducer repository (or uploading a .zip
file) for test?
In the previous version, my custom module could be imported normally, but in this latest version, my project's custom module cannot be recognized. So I want to ask if there is any special parameter indicating the current project path在以前的版本中,我的自定义模块可以正常导入,但在这个最新版本中,我无法识别我的项目的自定义模块。所以我想问一下是否有任何特殊参数指示当前项目路径
Could you provide a minimal reproducer repository (or uploading a
.zip
file) for test?你能提供一个最小的复制器存储库(或上传.zip
文件)进行测试吗?
ok,I'll pack it up
It will be recognized in previous versions
I am not able to reproduce this with the latest released LSP-pyright. Could you share your LSP-pyright's settings?
Could your issue be reproduced in Sublime Text's safe mode without changing any LSP-pyright's settings?
// Settings in here override those in "LSP-pyright/LSP-pyright.sublime-settings"
{
"settings": {
"python.analysis.extraPaths": [
"F:\\miniconda3\\Lib",
"F:\\miniconda3\\Lib\\site-packages",
"./"
],
"python.analysis.autoSearchPaths": true,
"python.analysis.stubPath": "./typings",
"python.analysis.diagnosticMode": "workspace",
"python.analysis.diagnosticSeverityOverrides": {
"reportUnboundVariable": "none",
"reportGeneralTypeIssues": "information",
"reportOptionalMemberAccess": "none",
"reportUnusedImport": "warning"
},
"python.analysis.typeshedPaths": [
"."
],
"python.analysis.typeCheckingMode": "off",
"pyright.disableOrganizeImports": true,
"python.pythonPath": "F:\\miniconda3\\python.exe",
"python.venvPath": ".",
}
}
here
Still can't reproduce, even with the exact plugin settings.
// Settings in here override those in "LSP-pyright/LSP-pyright.sublime-settings"
{
"settings": {
"python.analysis.extraPaths": [
"C:\\Users\\jfcherng\\AppData\\Local\\Programs\\Python\\Python38\\Lib",
"C:\\Users\\jfcherng\\AppData\\Local\\Programs\\Python\\Python38\\Lib\\site-packages",
"./"
],
"python.analysis.autoSearchPaths": true,
"python.analysis.stubPath": "./typings",
"python.analysis.diagnosticMode": "workspace",
"python.analysis.diagnosticSeverityOverrides": {
"reportUnboundVariable": "none",
"reportGeneralTypeIssues": "information",
"reportOptionalMemberAccess": "none",
"reportUnusedImport": "warning"
},
"python.analysis.typeshedPaths": [
"."
],
"python.analysis.typeCheckingMode": "off",
"pyright.disableOrganizeImports": true,
"python.pythonPath": "C:\\Users\\jfcherng\\AppData\\Local\\Programs\\Python\\Python38\\python.exe",
"python.venvPath": ".",
}
}
Could your issue be reproduced in Sublime Text's safe mode without changing any LSP-pyright's settings?
This hasn't been answered yet.
Someone probably has the same issue: https://github.com/microsoft/pyright/issues/7016#issuecomment-2042476674 But it's claimed fixed in pyright 1.1.360, which is LSP-pyright 1.3.1 🤔
Someone probably has the same issue: microsoft/pyright#7016 (comment) But it's claimed fixed in pyright 1.1.360, which is LSP-pyright 1.3.1 🤔
What I use is LSP-pyright 1.3.1
@jfcherng How to roll back to the previous version or a specific version
@jfcherng How to roll back to the previous version or a specific version
I guess basically you want Package Control to not manage it.
"unmanaged_packages_ignore": [],
Or just overwrite language-server to an old version.
The status of version 1.3.2 is the same, and the reconfiguration is also the same, o(╥﹏╥)o
Have you found a working old version yet?
I don’t know how to roll back. After setting it up according to your method, it didn’t roll back to the previous version.
I don’t know how to roll back. After setting it up according to your method, it didn’t roll back to the previous version.
It prevents package control from managing (updating) it. It won't do rollback. It's you who have to do the rollback.
I don’t know how to roll back.
- Download the version you want. E.g., https://github.com/sublimelsp/LSP-pyright/archive/refs/tags/1.3.2.zip
- Decompress and put it like
Packages
└── LSP-pyright
├── commands.py
├── dependencies.json
├── language-server
│ ├── package.json
│ └── package-lock.json
├── ...
If you decompress it, it's LSP-pyright-1.3.2, you have to rename it as LSP-pyright and put it under Packages.
- Restart ST.
And if you are familiar with git, you will know you can do this with git and quickly switch among versions.
This version works very well, and can be retired as long as the upstream version is not resolved.
Say something else
Except for one package, lsp-basedpyright is also limited to this version. Is it because lsp is not set up properly or is it an upstream problem?
Just to confirm. LSP-pyright
1.3.0
and LSP LSP-basedpyright
1.1.0
both work for you and their next version failed, right?
Just to confirm.
LSP-pyright
1.3.0
and LSPLSP-basedpyright
1.1.0
both work for you and their next version failed, right?
yes。The latter two versions of these two plug-ins do not work normal, whether it is a clean system or a safe mode
LSP-basedpyright
By the way, I replaced package.json and package-lock.json in LSP-basedpyright 1.1.0 with the same files in 1.1.2, and the result is that it runs perfectly. It seems that it is not an upstream problem. Please help to see if there is a setting problem
Could you try this: https://github.com/sublimelsp/LSP-pyright/archive/refs/heads/fix/import-not-found.zip
I doubt it may be fixed by https://github.com/sublimelsp/LSP-pyright/commit/273a22c3c97ef7eb87c15e9e95a061b5d084c8e6. This is the only behavior change that I notice between v1.3.0 and v1.3.1: https://github.com/sublimelsp/LSP-pyright/compare/1.3.0...1.3.1
Could you try this: https://github.com/sublimelsp/LSP-pyright/archive/refs/heads/fix/import-not-found.zip
I doubt it may be fixed by 273a22c. This is the only behavior change that I notice between v1.3.0 and v1.3.1: 1.3.0...1.3.1
sorry,Still not working
Unfortunately, I still can't spot other behavior different between 1.3.0...1.3.1.