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

How to use LanguageService for custom syntax in positional proc macros? #7441

Closed
jkelleyrtp opened this issue Jan 26, 2021 · 2 comments
Closed
Labels
S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@jkelleyrtp
Copy link
Contributor

I'm making a DSL for a library and would like to ship a LanguageService (+VSCode Ext) that provides highlighting/autocomplete while also allowing Rust in some positions. Something like:

html! {
<Button onclick=|click| {/* perform rust-completions here */} />
}

Right now, forwarding the request to the RA service doesn't provide any help because RA doesn't know how to process the proc macro. What strategy would you take to enable this sort of RA-powered assists in custom macros?

It's my first time in VScode extensions, so bear with me 🙂.

@Veykril
Copy link
Member

Veykril commented Jan 26, 2021

I think what you are interested in is what is being proposed in this issue here, #5389 This is still an open problem.

@flodiebold
Copy link
Member

I'm not sure what you're going for. Is this just a proc macro inside other Rust code? In that case, if the proc macro just passes through the code inside the {}, completions inside it should just work with rust-analyzer (as long as you enable proc-macro support). See also #7402 for some more information.

@lnicola lnicola added the S-unactionable Issue requires feedback, design decisions or is blocked on other work label Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

4 participants