Skip to content

[ty] Rank top-level module symbols above most other symbols#22465

Merged
BurntSushi merged 1 commit intomainfrom
ag/rank-module-names-higher
Jan 9, 2026
Merged

[ty] Rank top-level module symbols above most other symbols#22465
BurntSushi merged 1 commit intomainfrom
ag/rank-module-names-higher

Conversation

@BurntSushi
Copy link
Member

@BurntSushi BurntSushi commented Jan 8, 2026

This makes it so, e.g., os<CURSOR> will suggest the top-level stdlib
os module even if there is an os symbol elsewhere in your project.

The way this is done is somewhat overwrought, but it's done to avoid
suggesting top-level modules over other symbols already in scope.

Fixes astral-sh/ty#1852

@BurntSushi BurntSushi added server Related to the LSP server ty Multi-file analysis & type inference labels Jan 8, 2026
@BurntSushi BurntSushi force-pushed the ag/ranking-improvements branch from 6ff8447 to d9d8596 Compare January 9, 2026 13:58
@BurntSushi BurntSushi force-pushed the ag/rank-module-names-higher branch from 367a0e1 to f1328f9 Compare January 9, 2026 13:58
@BurntSushi BurntSushi force-pushed the ag/ranking-improvements branch from d9d8596 to 15cc74e Compare January 9, 2026 14:42
@BurntSushi BurntSushi force-pushed the ag/rank-module-names-higher branch from f1328f9 to 6dda55c Compare January 9, 2026 14:42
Base automatically changed from ag/ranking-improvements to main January 9, 2026 14:55
This makes it so, e.g., `os<CURSOR>` will suggest the top-level stdlib
`os` module even if there is an `os` symbol elsewhere in your project.

The way this is done is somewhat overwrought, but it's done to avoid
suggesting top-level modules over other symbols already in scope.

Fixes astral-sh/issues#1852
@BurntSushi BurntSushi force-pushed the ag/rank-module-names-higher branch from 6dda55c to 858d2a9 Compare January 9, 2026 14:56
@BurntSushi BurntSushi merged commit 10eb3d5 into main Jan 9, 2026
44 checks passed
@BurntSushi BurntSushi deleted the ag/rank-module-names-higher branch January 9, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server Related to the LSP server ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

completions: Prioritize builtin modules over symbols from third-party packages

2 participants