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

update and fork #2

Merged
merged 1 commit into from
Nov 30, 2022
Merged

update and fork #2

merged 1 commit into from
Nov 30, 2022

Conversation

jasonwilliams
Copy link
Collaborator

  • hwb(), var() and calc() added to the css language server. This raises the completions body length to 160 in tests
  • Update dependencies

this raises the completions body length to 160 in tests
- Update dependencies
@karlhorky
Copy link

karlhorky commented Dec 9, 2022

So since these updates were released in styled-components.vscode-styled-components@1.7.6, I tested them out, to see if it would get rid of this aspect-ratio warning from the issue below:

203062667-df167413-8d1d-4741-8bc2-c6c0ccd89ce8

I first tried out my installed version styled-components.vscode-styled-components@1.7.5 with my new version of VS Code (1.74.0)... and... actually the error was already gone 🤔😳 (the error + warning below is actually a real typo, just to test that the error checking is working)

Screenshot 2022-12-09 at 18 06 40

Indeed, it also works with styled-components.vscode-styled-components@1.7.6:

Screenshot 2022-12-09 at 18 07 26


So maybe somehow the updates of dependencies in vscode-css-languageservice@6.2.1 already fixed it? (with the new release of VS Code 1.74.0 maybe?

@karlhorky
Copy link

karlhorky commented Dec 14, 2022

Ran into the problem with a different CSS property just now - accent-color doesn't appear to work, in either the normal styled-components.vscode-styled-components@1.7.5 Release version or the styled-components.vscode-styled-components@1.7.6 Pre-Release version (see below).

Maybe the property is too new and not yet in the vscode-css-languageservice data?

The error message is "Unknown property: 'accent-color".

Screenshot 2022-12-14 at 16 39 17

Screenshot 2022-12-14 at 16 38 50

@jasonwilliams
Copy link
Collaborator Author

jasonwilliams commented Dec 14, 2022

yeah CSS properties aren't handled here but maybe you can help me understand a bit more how this chain works.
My understanding is it was added already: microsoft/vscode-custom-data#33 but it hasn't made its way down to here, so maybe there's an issue somewhere.

We use https://github.com/microsoft/vscode-css-languageservice which pulls from https://github.com/microsoft/vscode-custom-data/tree/main/web-data and I can see it in there: https://github.com/microsoft/vscode-custom-data/blob/main/web-data/data/browsers.css-data.json#L19798

You may have to get the debugger out and have a look, directions for testing are here:
https://github.com/styled-components/vscode-styled-components/blob/main/CONTRIBUTING.md#intellisense

Once setup you should see data travelling from CSS language server -> typescript styled plugin -> VSCode. I would just follow the chain all the way to the root until you can see why it's not showing up.

Also, if you're able to make a new issue in VSCode repo about that, that would be helpful also

@karlhorky
Copy link

karlhorky commented Apr 5, 2023

Interesting, with VS Code 1.77.0 and styled-components.vscode-styled-components@1.7.5, the aspect-ratio warnings don't show up anymore.

But also, no warnings about invalid properties are showing up 😬 (see accent-coooler below), so maybe there's something wrong here generally:

Screenshot 2023-04-05 at 09 42 06

@jasonwilliams
Copy link
Collaborator Author

@karlhorky see styled-components/vscode-styled-components#387 (comment)

you should try vs 1.7.7 (you’re using 1.7.5)

@karlhorky
Copy link

karlhorky commented Apr 5, 2023

Yeah, I am on the Release version. I will wait until the new versions are no longer marked as Pre-Release to upgrade (as many users will)

@karlhorky
Copy link

karlhorky commented Apr 5, 2023

But yes, the 1.7.7 Pre-Release version does resolve the issue (see below). Downgrading again now to the Release version.

Screenshot 2023-04-05 at 10 24 34

@nyxb
Copy link

nyxb commented Aug 8, 2023

i have this problem:
image

@nyxb
Copy link

nyxb commented Aug 9, 2023

yeah but it has no effect.

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "allowImportingTsExtensions": true,
    "strictNullChecks": true,
    //  "noImplicitAny": false,
    "plugins": [
      {
        "name": "next"
      },
      {
        "name": "typescript-styled-plugin",
        "lint": {
          "validProperties": [
            "-webkit-background-clip",
            "vector-effect"
          ]
        }
      }
    ],
    "paths": {
      "@components/*": ["./src/components/*"],
      "@hooks/*": ["./src/hooks/*"],
      "@constants": ["./src/constants"],
      "@helpers/*": ["./src/helpers/*"],
      "@utils": ["./src/utils"],
      "@lib/*": ["./src/lib/*"],
      "@types": ["./types"],
      "@layouts/*": ["./src/layouts/*"],
      "@content": ["./src/content"],
      "@server/*": ["./src/server/*"],
      "@post-helpers/*": ["./src/post-helpers/*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "types/**/*.d.ts", "src/helpers/mdx-components.helpers.js", "src/helpers/mdx-components.helpers.js", "src/components/Playground/Toolbar/FormatButton.js"],
  "exclude": ["node_modules"]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants