I'm utilizing this language service together with the template decorator to provide custom element completions.
I however noticed that the scanner provided by languageService.createScanner(document.getText()); breaks when the html document has javascript escaped content inside the template literal.
e.g.
import { html } from "lit-html";
export const temp = html`
<example-project
@my-custom-event=${() => console.log("foo")}
pro
></example-project>
`
The scanner isn't analyzing the document like normal due to the line
@my-custom-event=${() => {}}
and specially due to the dollar sign escaping of this template literal.
When that line of code is added, the scanner only hits one token and that token is TokenType.EOS.
I'm not sure if it would be in the scope of this project but being able to support escaped js in template literals would ease the adoption of the scanner in my custom elements language server project.
If this is out of scope however, I might end up forking this scanner and expanding it. Unless there is already a fork implementing this somewhere.
Heya,
I'm utilizing this language service together with the template decorator to provide custom element completions.
I however noticed that the scanner provided by
languageService.createScanner(document.getText());
breaks when the html document has javascript escaped content inside the template literal.e.g.
The scanner isn't analyzing the document like normal due to the line
and specially due to the dollar sign escaping of this template literal.
When that line of code is added, the scanner only hits one token and that token is
TokenType.EOS
.I'm not sure if it would be in the scope of this project but being able to support escaped js in template literals would ease the adoption of the scanner in my custom elements language server project.
If this is out of scope however, I might end up forking this scanner and expanding it. Unless there is already a fork implementing this somewhere.
Happy to provide extra info if needed