mirror of https://github.com/astral-sh/ruff
[ty] Add evaluation test for auto-import including symbols in current module
This shouldn't happen. And indeed, currently, this results in a sub-optimal ranking.
This commit is contained in:
parent
9ce3fa3fe3
commit
2d4e0edee4
|
|
@ -1,4 +1,5 @@
|
|||
name,file,index,rank
|
||||
auto-import-skips-current-module,main.py,0,4
|
||||
fstring-completions,main.py,0,1
|
||||
higher-level-symbols-preferred,main.py,0,
|
||||
higher-level-symbols-preferred,main.py,1,1
|
||||
|
|
|
|||
|
|
|
@ -0,0 +1,2 @@
|
|||
[settings]
|
||||
auto-import = true
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
Kadabra = 1
|
||||
|
||||
# This is meant to reflect that auto-import
|
||||
# does *not* include completions for `Kadabra`.
|
||||
# That is, before a bug was fixed, completions
|
||||
# would offer two variants for `Kadabra`: one
|
||||
# for the current module (correct) and another
|
||||
# from auto-import that would insert
|
||||
# `from main import Kadabra` into this module
|
||||
# (incorrect).
|
||||
#
|
||||
# Since the incorrect one wasn't ranked above
|
||||
# the correct one, this task unfortunately
|
||||
# doesn't change the evaluation results. But
|
||||
# I've added it anyway in case it does in the
|
||||
# future (or if we change our evaluation metric
|
||||
# to something that incorporates suggestions
|
||||
# after the correct one).
|
||||
Kada<CURSOR: Kadabra>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
[project]
|
||||
name = "test"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = []
|
||||
|
|
@ -0,0 +1 @@
|
|||
AbraKadabra = 1
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
version = 1
|
||||
revision = 3
|
||||
requires-python = ">=3.13"
|
||||
|
||||
[[package]]
|
||||
name = "test"
|
||||
version = "0.1.0"
|
||||
source = { virtual = "." }
|
||||
Loading…
Reference in New Issue