-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
cannot inject a language into an elixir string #695
Comments
There's probably some interface I need to implement or method I need to override that disallows injection in the default implementation. Probably something that keeps track of what counts as a "String" in the language and should allow injection. The comments are already marked as comments for the grammar definition, which is why that probably works. Can you give me specific steps for what you're trying to do, so I can replicate? |
I created an elixir project, created an elixir file and entered in two double quotes. I put my cursor within those quotes, pressed ALT+ENTER and IntelliJ did not offer me the language injection popup. I did the same after entering a comment, putting my cursor somewhere in the comment, pressing ALT+ENTER and it showed me the language injection popup. This isn't too important considering I'm gonna use ecto anyway, but something that should work. |
Going to close as it has been a long time and I'm not sure if this is relevant anymore. |
I would like this to be re-opened, since it is still relevant. I still can't inject another language into an Elixir string (for example SQL in a migration in I think |
I'm missing this feature too. Here's my example from an .ex file. I can't get language injection to work for the html in my multiline string: defp generate_body_html() do
~e"""
<html>
<head>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
</head>
<body>Hello World</body>
</html>
"""
|> Phoenix.HTML.safe_to_string()
end |
Would also love to get this working with the Surface def render(assigns) do
~H"""
<div class={{ "modal", "is-active": @show }}>
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">{{ @title }}</p>
</header>
<section class="modal-card-body">
<slot/>
</section>
<footer class="modal-card-foot" style="justify-content: flex-end">
<Button click={{ @hideEvent }}>Ok</Button>
</footer>
</div>
</div>
"""
end |
I see this still as relevant as this would improve the experience by quite a lot. |
+1 on this as well! I'm not familiar with java/kotlin or parsers for that matter, but this page seems related: https://plugins.jetbrains.com/docs/intellij/language-injection.html#implementation |
Each sigil is going to be a separate issue. Please stop piling every feature together. |
Oddly enough, I can inject a language into an elixir comment, but not a string. It works fine for other languages, so I think it is something wrong with this plugin.
The text was updated successfully, but these errors were encountered: