mirror of
https://github.com/astral-sh/ruff
synced 2026-01-06 06:04:16 -05:00
This only applies to items that have a type associated with them. That is, things that are already in scope. For items that don't have a type associated with them (i.e., suggestions from auto-import), we still suggest them since we can't know if they're appropriate or not. It's not quite clear on how best to improve here for the auto-import case. (Short of, say, asking for the type of each such symbol. But the performance implications of that aren't known yet.) Note that because of auto-import, we were still suggesting `NotImplemented` even though astral-sh/ty#1262 specifically cites it as the motivating example that we *shouldn't* suggest. This was occuring because auto-import was including symbols from the `builtins` module, even though those are actually already in scope. So this PR also gets rid of those suggestions from auto-import. Overall, this means that, at least, `raise NotImpl` won't suggest `NotImplemented`. Fixes astral-sh/ty#1262
1.1 KiB
1.1 KiB
| 1 | name | file | index | rank |
|---|---|---|---|---|
| 2 | auto-import-skips-current-module | main.py | 0 | 1 |
| 3 | fstring-completions | main.py | 0 | 1 |
| 4 | higher-level-symbols-preferred | main.py | 0 | |
| 5 | higher-level-symbols-preferred | main.py | 1 | 1 |
| 6 | import-deprioritizes-dunder | main.py | 0 | 1 |
| 7 | import-deprioritizes-sunder | main.py | 0 | 1 |
| 8 | import-deprioritizes-type_check_only | main.py | 0 | 1 |
| 9 | import-deprioritizes-type_check_only | main.py | 1 | 1 |
| 10 | import-deprioritizes-type_check_only | main.py | 2 | 1 |
| 11 | import-deprioritizes-type_check_only | main.py | 3 | 2 |
| 12 | import-deprioritizes-type_check_only | main.py | 4 | 3 |
| 13 | import-keyword-completion | main.py | 0 | 1 |
| 14 | internal-typeshed-hidden | main.py | 0 | 4 |
| 15 | none-completion | main.py | 0 | 2 |
| 16 | numpy-array | main.py | 0 | |
| 17 | numpy-array | main.py | 1 | 1 |
| 18 | object-attr-instance-methods | main.py | 0 | 1 |
| 19 | object-attr-instance-methods | main.py | 1 | 1 |
| 20 | pass-keyword-completion | main.py | 0 | 1 |
| 21 | raise-uses-base-exception | main.py | 0 | 1 |
| 22 | scope-existing-over-new-import | main.py | 0 | 1 |
| 23 | scope-prioritize-closer | main.py | 0 | 2 |
| 24 | scope-simple-long-identifier | main.py | 0 | 1 |
| 25 | tstring-completions | main.py | 0 | 1 |
| 26 | ty-extensions-lower-stdlib | main.py | 0 | 8 |
| 27 | type-var-typing-over-ast | main.py | 0 | 3 |
| 28 | type-var-typing-over-ast | main.py | 1 | 278 |