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

Suggestions not working in #each statement after inserting a dot #1990

Closed
YummYume opened this issue Apr 19, 2023 · 4 comments · Fixed by #2631
Closed

Suggestions not working in #each statement after inserting a dot #1990

YummYume opened this issue Apr 19, 2023 · 4 comments · Fixed by #2631
Labels
bug Something isn't working limitation Constraints of the existing architecture make this hard to fix

Comments

@YummYume
Copy link

YummYume commented Apr 19, 2023

Describe the bug

When using a #each statement and accessing an object's properties, the suggestions will stop working after inserting a dot. See the video below for a better explanation :

vscode-svelte-each-bug-2023-04-19_19.14.38.mp4

Intellisense is not working as expected after inserting a dot. But if I delete a letter or use CTRL + Space, I get my suggestion testArray as expected. I tested this in multiple scenarios and on a clean editor and it does it too.

What seems weird to me is that this only happens with #each statements, #if, #key and so on are fine. This is more of an annoyance than anything, I am just very used to having my suggestions after inserting a dot.

Reproduction

Using the following code :

<script lang="ts">
    const testObj = {
        testArray: [1, 2, 3],
    };
</script>

{#each testObj as array}
    {array}
{/each}

After inserting a dot, VSCode will not suggest testArray.

Expected behaviour

I would expect to get the usually suggested properties of my object.

System Info

  • OS: Kubuntu 22.04
  • IDE:
    • VSCode
    • Version: 1.77.3
    • Commit: 704ed70d4fd1c6bd6342c436f1ede30d1cff4710
    • Date: 2023-04-12T09:16:52.732Z
    • Electron: 19.1.11
    • Chromium: 102.0.5005.196
    • Node.js: 16.14.2
    • V8: 10.2.154.26-electron.0
    • OS: Linux x64 5.15.0-69-generic
    • Sandboxed: No

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

No response

@YummYume YummYume added the bug Something isn't working label Apr 19, 2023
@jasonlyu123
Copy link
Member

This is a limation we have. See #1302 (comment) for the reason. We have a workaround for property access but not for this specific situation. Becuase our workaround might have problems in this case.

@jasonlyu123 jasonlyu123 added the limitation Constraints of the existing architecture make this hard to fix label Apr 20, 2023
@YummYume
Copy link
Author

Hi @jasonlyu123, thanks for clarifying things. I suppose since it's a limitation, this can be closed and will (hopefully) be fixed somewhere in the future.

@Skycweb
Copy link

Skycweb commented May 20, 2023

I also encountered the same problem

@bugproof
Copy link

bugproof commented Sep 29, 2024

It also doesn't work inside of each

You can see that unless I close img element with /> it stops working completely. Sometimes even with the tag closed the intellisense doesn't pick up current iterated item.

Animation

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

Successfully merging a pull request may close this issue.

4 participants