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

Broken Astro imports in Typescript files #21697

Open
1 task done
0xtimsb opened this issue Dec 8, 2024 · 0 comments
Open
1 task done

Broken Astro imports in Typescript files #21697

0xtimsb opened this issue Dec 8, 2024 · 0 comments
Labels
astro Astro.js framework support bug [core label] language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors tooling An umbrella label for language tools, linters, formatters, etc typescript TypeScript programming language support

Comments

@0xtimsb
Copy link
Member

0xtimsb commented Dec 8, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Even after installing the Astro extension, .ts files shows squiggly lines on Astro imports.

Error screenshot

Workaround

To fix this issue, you can there are few methods:

  1. Install @astrojs/ts-plugin
npm install @astrojs/ts-plugin --save-dev
  1. Update config:

By modifying your project's tsconfig.json file (source):

{
  "compilerOptions": {
    "plugins": [
      {
        "name": "@astrojs/ts-plugin"
      }
    ]
  }
}

or

Use vtsls (source):

Note: This still requires you to install plugin locally or globally.

{
  "lsp": {
    "vtsls": {
      "tsserver": {
        "globalPlugins": [
          {
            "name": "@astrojs/ts-plugin"
            // Location must be provided if @astrojs/ts-plugin is not installed locally
          }
        ]
      }
    }
  }
}

This requires significant manual configuration. Ideally, this should work out of the box when installing the Astro extension.

Environment

Zed: v0.165.3 (Zed Preview)
OS: Linux Wayland ubuntu 24.04
Memory: 31.1 GiB
Architecture: x86_64
GPU: Intel(R) Graphics (RPL-S) || Intel open-source Mesa driver || Mesa 24.0.9-0ubuntu0.2

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

@0xtimsb 0xtimsb added admin read bug [core label] labels Dec 8, 2024
@JosephTLyons JosephTLyons added typescript TypeScript programming language support language An umbrella label for all programming languages syntax behaviors language server An umbrella label for all language servers tooling An umbrella label for language tools, linters, formatters, etc astro Astro.js framework support and removed triage labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astro Astro.js framework support bug [core label] language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors tooling An umbrella label for language tools, linters, formatters, etc typescript TypeScript programming language support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants