| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 89265cd commit f2dea82
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -337,7 +337,11 @@ def pylsp_code_actions( | |||
| 337 | 337 | log.debug(f"textDocument/codeAction: {document} {range} {context}") | |
| 338 | 338 | code_actions = [] | |
| 339 | 339 | for diagnostic in context.get("diagnostics", []): | |
| 340 | - if "undefined name" not in diagnostic.get("message", "").lower(): | ||
| 340 | + matched_message = "undefined name" not in diagnostic.get("message", "").lower() | ||
| 341 | + # Provided by mypy | ||
| 342 | + matched_code = diagnostic.get("code", "") == "name-defined" | ||
| 343 | + | ||
| 344 | + if not matched_message and not matched_code: | ||
| 341 | 345 | continue | |
| 342 | 346 | ||
| 343 | 347 | word = get_name_or_module(document, diagnostic) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments