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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 BUG: completions in components differ based on newlines and cursor position #683

Open
vinnichase opened this issue Nov 6, 2023 · 2 comments
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) ecosystem: compiler Issue is caused by a bug in the Astro compiler

Comments

@vinnichase
Copy link

vinnichase commented Nov 6, 2023

Describe the Bug

Completions for astro components are not consistent and vary depending on newlines and the cursor position.

Problem occurs in TypeScript project.

Example 1:

<Code code="{}" lang="json" theme="one-dark-pro" />

馃煝 Cursor position before closing tag:
Bildschirmfoto 2023-11-06 um 14 46 32
馃敶 Cursor Position one space before closing tag:
Bildschirmfoto 2023-11-06 um 14 46 23

Example 2:

<Code code="{}" lang="json" theme="one-dark-pro" inline={true} />

馃煝 Cursor Position one space before closing tag:
Bildschirmfoto 2023-11-06 um 14 45 25

Example 3:

<Code
    code="{}"
    lang="json"
    theme="one-dark-pro"
    inline={true}
/>

馃敶 Cursor Position in new line:
Bildschirmfoto 2023-11-06 um 14 45 04

Steps to Reproduce

  1. import { Code } from 'astro:components';
  2. Insert component in astro page
  3. Try 3 jsx attributes inline and place the cursor at different positions
  4. Try 4 jsx attributes inline
  5. Try 4 jsx attributes multiline
  6. Unexpected/inconsistent completions
@Princesseuh Princesseuh added bug - P4: important Violate documented behavior or significantly improves performance (priority) ecosystem: compiler Issue is caused by a bug in the Astro compiler - P3: minor bug An edge case that only affects very specific usage (priority) and removed - P4: important Violate documented behavior or significantly improves performance (priority) labels Nov 6, 2023
@Princesseuh
Copy link
Member

Princesseuh commented Nov 6, 2023

Hello! Thank you for reporting this issue. On what OS are you? I can't seems to be able to reproduce most of these, which I'm thinking could mean it's a Windows thing perhaps

@vinnichase
Copy link
Author

astro info        
Astro                    v3.4.3
Node                     v18.17.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   server
Adapter                  astro-sst
Integrations             @astrojs/tailwind

its in .astro files

@Princesseuh Princesseuh removed the bug label Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) ecosystem: compiler Issue is caused by a bug in the Astro compiler
Projects
None yet
Development

No branches or pull requests

2 participants