is it a design goal for rls to be abused as a code generator through it's autocomplete support?
e.g. selecting a random element from the autocomplete list including any snippet such as for loop or if conditions then filling in random parameters, would rls offer completion when it knows using some variable wouldnt violate borrow checking for example?
I assume that has to be resource hungry to somehow check every variable currently in scope for possible borrow checking violations and filter out the ones that will
I want to make a valid Rust random code generator
By code generator you mean source code generator (as opposed to machine code generator)?
rust-analyzer already have some facilities to generate source code, and the'll grow in the future
I think it's unlikely that we would hide completions if they e.g. violate borrow checking, even if we could do that (which we are a long way from). It's surprising, and often the desired fix would actually be elsewhere
@matklad Yes, that's what I mean. Thank you, I'll have a look, though, all the challenge is into making valid generation choices, even with access to an AST.
@Florian Diebold Okay. Thanks.