Skip to content

Missing completions if cursor is at the end of the file #1392

@sharkdp

Description

@sharkdp

I recently added these tests: https://github.com/astral-sh/ruff/blob/8ca2b5555d47e211c04136637477c5227172d885/crates/ty_ide/src/completion.rs#L3899-L3946

They show that

def f[T: str](msg: T):
    msg.<CURSOR>

should show completions like upper and capitalize. This does work in the LSP with neovim. But it does not work with VS Code or in the playground:

neovim:
Image

VS Code:
Image

Playground:
Image

What's very weird is that I can see those completions if I make other random changes to the file. For example, if I add a comment in that function:

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcompletionsBugs or features relating to autocomplete suggestionsserverRelated to the LSP server

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions