language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Vscode does not auto import a component file with the name input.svelte

Open Nukiloco opened this issue 4 years ago • 6 comments

Describe the bug A clear and concise description of what the bug is. When having a file named input.svelte and then typing <Input> into any other component, vscode will not import it in. Vscode can auto import file names like button.svelte. Also by the way, input.svelte works if I manually import it in.

To Reproduce Steps to reproduce the behavior:

  1. Create a svelte component with the file name of input.svelte
  2. Type <Input> and it tab,
  3. It does not autocomplete.

For example a code snippet that is treated in a way you don't expect.

Expected behavior A clear and concise description of what you expected to happen.

<Input></Input>

Screenshots If applicable, add screenshots to help explain your problem.

System (please complete the following information):

  • OS: [e.g. Windows] Windows 10
  • IDE: [e.g. VSCode, Atom] VSCode
  • Plugin/Package: Svelte for VSCode

Nukiloco avatar Oct 06 '21 06:10 Nukiloco

Another thing to mention, after typing in <Input>, if you try to type in </ it will autocorrect instantly it to </div> instead.

Nukiloco avatar Oct 06 '21 07:10 Nukiloco

I can't reproduce it. Can you check if it happens in another directory?

jasonlyu123 avatar Oct 06 '21 08:10 jasonlyu123

I can't reproduce it. Can you check if it happens in another directory?

In some cases it does auto import it but it doesn't auto complete the tag. Aka the input component is in a folder called components I'm currently in a different folder right now which it can auto import the script but it doesn't auto complete the tags.

Nukiloco avatar Oct 06 '21 13:10 Nukiloco

Yes. it won't auto-complete the tag. We're using vscode-html-language-service for tag completion. Since the input tag doesn't have an end tag in HTML, it won't auto close it.

As for the auto import problem can you provide a reproducible? Also, do you have a jsonfig.json or tsconfig.json?

jasonlyu123 avatar Oct 07 '21 01:10 jasonlyu123

I have a tsconfig.json, and its not actually a default input tag, its a custom component that's called Input.

Nukiloco avatar Oct 07 '21 13:10 Nukiloco

Yes, I am aware of that and it's an unrelated issue. What I mean by "in HTML" is that vscode-html-language-service treat it as an HTML tag.

Can you check if the svelte files are included in the tsconfig? It would be nice to have a reproducible otherwise I can only guess what could have happened.

jasonlyu123 avatar Oct 08 '21 01:10 jasonlyu123

Closing due to inactivity.

dummdidumm avatar Dec 09 '22 15:12 dummdidumm