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

Style Helper: Hover Preview and Autocomplete Fail with Sass // Comments or Curly Braces in Comments #1046

Open
karlhorky opened this issue Jan 6, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@karlhorky
Copy link

karlhorky commented Jan 6, 2023

插件名/Extension:

您的本地环境信息/Your local environment information

  • 操作系统及其版本/System and Version: Ventura 13.1 (22C65)
  • Node version: 18.12.1
  • npm version: 8.19.3

您遇到的问题及复现步骤/What are your problems and how to reproduce them

1. When using Sass-style // comments, the hover preview does not appear:

Screenshot 2023-01-06 at 13 02 28

Code:

.bodyBold {
  display: flex;
  flex-direction: column;
  align-items: center;

  & h2 {
    // font-size: ${theme.fonts.averta.sizes.heading3};
    padding: 0 40px;
  }
}
// page.tsx
import styles from './page.module.scss';

export default function Login() {
  return (
    <div className={styles.bodyBold}>

2. Also autocomplete doesn't work with // Sass-style comments:

This instead shows className={}, which causes the code to break when selected.

Screenshot 2023-01-06 at 13 33 00

3. Hover previews also fail on usage of { or } in a comment:

Screenshot 2023-01-06 at 13 12 51

Screenshot 2023-01-06 at 13 13 02

.bodyBold {
  display: flex;
  flex-direction: column;
  align-items: center;

  & h2 {
    /* { */
    padding: 0 40px;
  }
}

4. Also autocomplete does not work with usage of { or } in a comment:

This instead shows className={}, which causes the code to break when selected.

Screenshot 2023-01-06 at 13 32 19

This however does work with other extensions such as React CSS modules (repo):

Screenshot 2023-01-06 at 13 01 34

Workaround 1: Both hover previews and autocompletion entries start working again when I remove the comment:

Screenshot 2023-01-06 at 13 02 47

Workaround 2: Convert to a CSS-style comment and Remove { and }

Screenshot 2023-01-06 at 13 12 19

您期待的正确结果/The right result you're looking forward to

The hover preview and autocomplete features should still work with:

  1. Usage of Sass-style // comments
  2. Usage of { and } in comments
@karlhorky karlhorky added the bug Something isn't working label Jan 6, 2023
@karlhorky karlhorky changed the title Style Helper: Hover Preview Fails with Sass // Comments Style Helper: Hover Preview Fails with Sass // Comments or Curly Braces in Comments Jan 6, 2023
@karlhorky karlhorky changed the title Style Helper: Hover Preview Fails with Sass // Comments or Curly Braces in Comments Style Helper: Hover Preview and Autocomplete Fail with Sass // Comments or Curly Braces in Comments Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant