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

Missing autocomplete suggestions for namespaced components in the template #2085

Closed
AdrianGonz97 opened this issue Jul 8, 2023 · 2 comments
Labels
bug Something isn't working limitation Constraints of the existing architecture make this hard to fix

Comments

@AdrianGonz97
Copy link
Member

Describe the bug

If we were to reexport components like so:

import Button from "./CardButton.svelte";
import Title from "./CardTitle.svelte";
import Description from "./CardDescription.svelte";

export default {
	Button,
	Title,
	Description,
};

and import them to be used as a namespace:

<script lang="ts">
	import Card from "./Card.svelte";
	import C from "./children";
</script>

<Card>
	<C.Title>Hello World</C.Title>
	<C.Description>
		Lorem Ipsum is simply dummy text of the printing and typesetting industry.
	</C.Description>
	<C.Button>Get started</C.Button>
</Card>

Then we wouldn't get any autocomplete suggestions when typing <C.>...

img


But! If we were to close the suggestions and reopen it again (so long as we have some valid starting letter), then we'd actually get the proper autocomplete suggestions.

img

Reproduction

git repo:

git clone https://github.com/AdrianGonz97/no-autocomplete-suggestions-on-namespaces-issue

Expected behaviour

Ideally, the provided suggestions would be the same as if we were to place the value in mustache tags, like so:

img

System Info

  • OS: WSL2 Ubuntu
  • IDE: VSCode

Which package is the issue about?

Svelte for VS Code extension, svelte-language-server

Additional Information, eg. Screenshots

No response

@AdrianGonz97 AdrianGonz97 added the bug Something isn't working label Jul 8, 2023
@jasonlyu123
Copy link
Member

Closing as duplicate of #776. This is a limitation we have now. If the template has a syntax error, only global completion will be shown. We have special treatment for mustaches, but the same technique is not applicable in a namespaced component.

@jasonlyu123 jasonlyu123 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 8, 2023
@jasonlyu123 jasonlyu123 added the limitation Constraints of the existing architecture make this hard to fix label Jul 8, 2023
@AdrianGonz97
Copy link
Member Author

@jasonlyu123 Thanks for the quick response, it's very much appreciated!

Might I make a suggestion about editing the title of that original issue to include "Namespace"? It would probably make it easier for people in the future that want to search for that issue 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working limitation Constraints of the existing architecture make this hard to fix
Projects
None yet
Development

No branches or pull requests

2 participants