rust-lang / rust-lang/rust-analyzer
Using a different language server for code inside a proc macro
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
I would like to write a language server for SQLite sql that will also work for SQL written in a particular proc macro:
// ...rust code
let users = my_proc_macro_for_sql! {
SELECT * FROM User
};
// ...rust code
Before I venture further, I wanted to ask if something like is even possible in a non-invasive manner.
Some approaches I thought of:
- Using https://code.visualstudio.com/api/language-extensions/embedded-languages
- This seems to indicate that rust-analyzer may need to add some kind of support for this. If so, is this something rust-analyzer interested in supporting? Maybe this is already supported? If not, I can attempt to make this contribution.
- A language server that targets
.rsfiles but only "activates" when there is a specific .toml file in the workspace and the.rsfile contains the proc macromy_proc_macro_for_sql!- This seems like it could potentially clash with rust analyzer and/or slow down ide needlessly
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the VS Code embedded-languages documentation and the issue's two proposed approaches. Investigate whether rust-analyzer can support SQLite SQL embedded in a proc macro without conflicting with another language server or adding needless activation overhead; done would require a clearly agreed implementation path and scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sqlite
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100