Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a different language server for code inside a proc macro #17186

Open
rajesh-rahul opened this issue May 5, 2024 · 0 comments
Open

Using a different language server for code inside a proc macro #17186

rajesh-rahul opened this issue May 5, 2024 · 0 comments
Labels
C-support Category: support questions

Comments

@rajesh-rahul
Copy link

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 .rs files but only "activates" when there is a specific .toml file in the workspace and the .rs file contains the proc macro my_proc_macro_for_sql!
    • This seems like it could potentially clash with rust analyzer and/or slow down ide needlessly
@rajesh-rahul rajesh-rahul added the C-support Category: support questions label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-support Category: support questions
Projects
None yet
Development

No branches or pull requests

1 participant