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

🐛 BUG: completions in components differ based on newlines and cursor position

Open vinnichase opened this issue 2 years ago • 2 comments

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

vinnichase avatar Nov 06 '23 14:11 vinnichase

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

Princesseuh avatar Nov 06 '23 21:11 Princesseuh

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

vinnichase avatar Nov 07 '23 13:11 vinnichase