Skip to content

Commit c315164

Browse files
RasmusNygrenBurntSushi
authored andcommitted
[ty] Don't suggest keyword statements when only expressions are valid
There are cases where the python grammar enforces expressions after certain statements. In such cases we want to suppress irrelevant keywords from the auto-complete suggestions. E.g. `with a<CURSOR>`, suggesting `raise` here never makes sense because it is not valid by the grammar.
1 parent bb1955e commit c315164

2 files changed

Lines changed: 611 additions & 31 deletions

File tree

crates/ty_completion_eval/completion-evaluation-tasks.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import-deprioritizes-type_check_only,main.py,3,2
1515
import-deprioritizes-type_check_only,main.py,4,3
1616
import-keyword-completion,main.py,0,1
1717
internal-typeshed-hidden,main.py,0,2
18-
none-completion,main.py,0,2
18+
none-completion,main.py,0,1
1919
numpy-array,main.py,0,159
2020
numpy-array,main.py,1,1
2121
object-attr-instance-methods,main.py,0,1

0 commit comments

Comments
 (0)