SpacetimeDB icon indicating copy to clipboard operation
SpacetimeDB copied to clipboard

Autocomplete broken in VSCode for `.find()` and similar functions

Open cloutiertyler opened this issue 1 year ago • 2 comments

It's broken in VSCode but presumably in Rust Analyzer more generally.

Reproduction steps:

Clone https://github.com/makscee/arena-of-ideas/tree/main/server

Open in VSCode with Rust Analyzer.

Go to any reducer with a player and type: ctx.db.arena_run().id().find(player.id);

It will compile, but it will not autocomplete find.

cloutiertyler avatar Nov 16 '24 19:11 cloutiertyler

related external ticket https://github.com/clockworklabs/SpacetimeDB/issues/1998

bfops avatar Nov 19 '24 20:11 bfops

The simplest way to reproduce is the following:

#[table(name = test_table)]
struct TestTable {
    #[primary_key]
    id: u64,
}

fn foo(ctx: &ReducerContext) {
    ctx.db.test_table().id()
}

If you type dot after the id() you expect to see update() find() delete() suggests, but you don't

What's interesting is that changing the type to String fixes this issue: image

makscee avatar Nov 27 '24 09:11 makscee