8000 rope autoimport code action error. · Issue #647 · python-lsp/python-lsp-server · GitHub
[go: up one dir, main page]

Skip to content

rope autoimport code action error. #647

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

Open
loujiaye opened this issue May 19, 2025 · 0 comments
Open

rope autoimport code action error. #647

loujiaye opened this issue May 19, 2025 · 0 comments

Comments

@loujiaye
Copy link

I use emacs`s lsp-pylsp. When i want to use autoimport function, it suggests path with src.How can i right configurate.

Image

path tree

.
├── requirements.txt
├── src
│   ├── pycache
│   ├── app.py
│   ├── config
│   ├── data
│   ├── func
│   │   ├── init.py
│   │   ├── pycache
│   │   └── rule.py
│   ├── image2config
│   │   ├── init.py
│   │   └── page.py
│   ├── model
│   │   ├── pycache
│   │   ├── database.py
│   │   ├── device.py
│   │   ├── pagetree.py
│   │   └── project.py
│   ├── other
│   ├── resource
│   │   ├── copyposition.ui
│   │   ├── copypositiondialog.ui
│   │   ├── devicemanage.ui
│   │   ├── imagedisplay.ui
│   │   ├── imageedit.ui
│   │   ├── mainpage.ui
│   │   ├── pagedisplay.ui
│   │   ├── pageedit.ui
│   │   ├── positioncompare.ui
│   │   ├── positiondialog.ui
│   │   ├── projectdialog.ui
│   │   └── projectlist.ui
│   ├── ui
│   │   ├── init.py
│   │   ├── pycache
│   │   ├── devicemanageproxy.py
│   │   ├── imagedisplayproxy.py
│   │   ├── imageeditproxy.py
│   │   ├── mainpageproxy.py
│   │   ├── pagedisplayproxy.py
│   │   ├── pageeditproxy.py
│   │   ├── positiondialogproxy.py
│   │   ├── projectdialogproxy.py
│   │   └── projectlistproxy.py
│   └── util
│   ├── pycache
│   ├── func.py
│   └── imageutil.py
└── tests
└── util
├── pycache
├── func_test.py
└── imageutil_test.py

.dir-locals.el

((python-mode .
((lsp-pylsp-configuration
. (:python (:analysis (:extraPaths ["src"]))))
(lsp-pylsp-plugins-flake8-ignore . ["E111" "E121" "E114" "E501"])
(lsp-pylsp-plugins-jedi-environment . "/Users/tong/program/project/xianyu/venv")
(lsp-pylsp-plugins-jedi-completion-extra-paths . ["src"])
(lsp-pylsp-plugins-mypy-overrides . ["--python-executable" "/Users/tong/program/project/xianyu/venv/bin/python" t])
(lsp-disabled-clients . (pyright))
)))

pyproject.toml

[tool.pylsp]
plugins.jedi_completion = { enabled = true, extra_paths = ["src"] }
plugins.pylint = { enabled = true, args = ["--max-line-length=100"] }
plugins.autopep8 = { enabled = true }
plugins.black = { enabled = true }
plugins.rope = { enabled = true }

[tool.rope]
enabled = true
python_path = ["/Users/tong/program/project/xianyu/venv/bin/python"]
save_objectdb = true
split_imports = true
source_folders = ["src"] # 源码目录
ignored_paths = ["tests"] # 排除目录

[tool.jedi_completion]
cache_for = ['PySide6', 'PySide6.QtWidgets']
extra_paths = ["src"]

[tool.flake8]
enable-extensions = "D" # 启用 docstring 规则(flake8-docstrings)
exclude = ".git,pycache,venv,test" # 排除这些目录

[tool.pytest.ini_options]
addopts = "-s"
testpaths = ["tests"]
pythonpath = ["src"]

[tool.ruff]
src = ["src"]

[tool.mypy]
mypy_path = "src"
files = ["src", "tests"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0