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

Fix Invalid type for len() #561 #562

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ricvillagrana
Copy link

This error is thrown because in some cases the len() argument is not a String and can lead to invalid type errors.

This is most likely to be a temporary fix.

This error is thrown because in some cases the len() argument is not an String and can lead to invalid type errors.
@kmoschcau
Copy link

kmoschcau commented Oct 10, 2024

This looks like it's trying to fix the same bug that #560 is trying to fix.

@mig-hub
Copy link

mig-hub commented Oct 29, 2024

For some reason when I use a file type that is not purely html, I seem to get this kind of error:

Error detected while processing function emmet#expandAbbr[1]..emmet#getFileType:
line   61:
E701: Invalid type for len()

Is this what this pull request is meant to fix?

In my case it is a svelte file. But I suppose it does the same on any file type that has file types inside file types like vue.

@kmoschcau
Copy link

kmoschcau commented Oct 30, 2024

@mig-hub have a look at #559 I filed before. I gave an explanation what the cause is in there. It also has an open PR to fix this problem. Though in your case, a closer look is needed to see if the fix is effective. You can install my fork instead and try if that fixes your problem.

@mig-hub
Copy link

mig-hub commented Oct 30, 2024

@kmoschcau, thank you so much for your answer. I have just installed your fork and I can confirm it fixes my issue.

For info, I installed it with VimPlug, I use nvim, and I definitely have nvim-treesitter installed as one of my plugins. Although it is placed after emmet — not sure if the order of plugins matter in some cases.

To make sure it works, I used it on a .erb template file that generates a .svelte file, and the svelte file has an HTML part. Treesitter successfully color the syntax of each HTML/JS/SCSS parts. And your fork worked fine where the original was failing except when using a pure HTML file with a clear single file type.

@volodymyr-vt
Copy link

Can we get this merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants