vscode-styled-components icon indicating copy to clipboard operation
vscode-styled-components copied to clipboard

Indentation not working properly

Open jahirfiquitiva opened this issue 3 years ago • 1 comments

Describe the bug (including copyable syntax) Hey... I have some styled component code that is indented perfectly on Webstorm, but it isn't in VSCode while using this extension...

Screenshot This is what the formatted code looks like Shot 2021-07-13 at 11-38-49@2x - Styled

To Reproduce Try with this snippet

const TopSection = styled.div`
  display: flex;
  flex-direction: column;
  text-align: center;
  max-width: 468px;
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  padding: 52px
    ${({ isLimitedEdition }) => (isLimitedEdition ? '12px 40px' : '0 12px')};

  ${mediaQueries.medium} {
    max-width: ${({ isLimitedEdition }) =>
      isLimitedEdition ? '468px' : '612px'};
    padding: 64px 0
      ${({ isLimitedEdition }) => (isLimitedEdition ? '64px' : '32px')};
  }

  ${mediaQueries.large} {
    max-width: ${({ isLimitedEdition }) =>
      isLimitedEdition ? '468px' : '640px'};
    padding-bottom: ${({ isLimitedEdition }) =>
      isLimitedEdition ? '64px' : '40px'};
  }

  ${mediaQueries.xlarge} {
    padding-bottom: ${({ isLimitedEdition }) =>
      isLimitedEdition ? '64px' : '48px'};
  }
`

Expected behavior Code should be formatted or indented like this: Shot 2021-07-13 at 11-38-26@2x - Styled

Build environment (please complete the following information):

  • OS: macOS
  • VSCode Version: 1.58.0
  • Extension Version: 1.6.4

jahirfiquitiva avatar Jul 13 '21 17:07 jahirfiquitiva

@jahirfiquitiva it seems to be formatting fine for me, which formatter are you using? This extension doesn't deal with formatting, thats usually deferred to Prettier or the VSCode Typescript/javascript formatter

jasonwilliams avatar Jul 24 '21 14:07 jasonwilliams