Closed evoactivity closed 1 year ago
@evoactivity still getting issue:
import Component from '@glimmer/component';
import { precompileTemplate } from '@ember/template-compilation';
import Local from './local';
import TemplateOnlyComponent from '@/components/OnlyTemplate/component.hbs';
const calculateSummary = (a: number, b: number) => `${a}+${b}=${a + b}`;
export default class HelloWorld extends Component {
static template = precompileTemplate(
`
`,
{
isStrictMode: true,
scope: () => ({
Local,
calculateSummary,
TemplateOnlyComponent,
}),
}
);
}
Looking ok for me
I tried again today and now I see what you see.
I'll keep looking into this.
So I can get it to be this
but if I put a new line after the comma it breaks and I don't know why
I got a fix :)
This isn't a blocker but just maing a note.
The only thing that seems to be missing is prettier running on the embedded handlebars, I'm not sure what is missing to make that work or if that is something handled outside of the grammar.
It is registered as handlebars, but not sure if that is what triggers it.
@evoactivity may be from here: https://github.com/search?q=repo%3Alifeart%2Fvsc-ember-syntax%20handlebars&type=code
Also, may be a case here: https://github.com/lifeart/typescript-hbs-plugin/blob/main/src/embeddedSupport.ts#L152 https://github.com/lifeart/typescript-hbs-plugin/blob/main/src/virtual-document-provider.ts#L19 https://github.com/lifeart/typescript-hbs-plugin/blob/92e1caf5c62ba7a8e0d1124bed7ac566097ad213/src/html-template-language-service.ts#L171
I also don't get prettier running for hbs`<div></div>`
blocks, which I haven't touched. Ultimately prettier just sees them as strings. I guess we'd need a prettier plugin to mark those strings as embedded languages.
@evoactivity try to comment this line: https://github.com/lifeart/vsc-ember-syntax/blob/master/package.json#L36 (where we importing support scripts, to avoid side-effects caused by typescript-hbs-plugin)
Doesn't seem to make a difference.
fixes #35