-
Notifications
You must be signed in to change notification settings - Fork 38
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
Emmet is not working as expected #19
Comments
Really weird, thanks for raising! |
@unlocomqx thx to your finding about
Is expanded into
So finding a parent works even across Svelte outer fragments which is great. Expanding if blocks etc. still works. Figuring out how to fix complex emmet patterns will be easy enough I hope. My approach revolves around updating
Notice that I overrode PsiFile in callback to always be HTML one. |
Brilliant |
I did some debugging and found that this line gets the Psi File with Svelte Language when cursor is inside a Svelte Fragment That file is used to instantiate CustomTemplateCallback in (is there a way to override that?) Then a dummy file is created using Svelte Language here In the next line PsiTreeUtil.findChildOfType can't find the tag and null is returned which prevents entering the if which contains a call to |
In #40 I've changed how whitespace is parsed. Now it's delegated to HTML side with notable exception of continuous whitespace between Svelte mustaches and first non-whitespace HTML character, it's required for current (bad) implementation of formatter to work. Anyway that fixed Emmet partially. Preview still does not work with the last character in a file. Add one space after Emmet shorthand and everything starts to work. Anyway you can expand shorthand and it works in both cases. Remaining unsolved issue is shorthand directly after Svelte mustache. I suspect this is connected to mentioned whitespace handling and by extension formatter. Edit. No it doesn't. Mustaches live in different PSI, that must be an issue. |
@unlocomqx in branch with lexer fixes document actually ends with XmlToken |
yeah it expands correctly but preview does not work for me as shown in screenshot |
Sry for the confusion, how do you get the preview to pop up? is it automatic? |
I was able to reproduce, |
As I expected, it's the same as this
|
Can this be because of this plugin? I'm using Goland.
I haven't found out when exaclty it doesn't work. It never works inside another tag. Sometimes it doesn't even work on the root level.
Changing the File type of
.svelte
files back to HTML makes everything work as expected again.The text was updated successfully, but these errors were encountered: