Skip to content

Autocomplete fails for image asset imports in JavaScript files #18173

@Moshyfawn

Description

@Moshyfawn

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Zed struggles to correctly resolve or autocomplete paths when importing image assets (e.g., .png) in JavaScript files.

Steps to reproduce

  1. Create a new JS project: npm create vite@latest test-js-assets-import -- --template vanilla
  2. Open the project in Zed
  3. Create an assets directory in the project root and add an image file (e.g., save the following screenshot in the assets directory):
JS asset import fail example
  1. In main.js, type import './assets/' and attempt to autocomplete the image file path (e.g. Command Palette > editor: show completions):
  2. Observe that Zed fails to show the image file path in the autocomplete list

Environment

Zed: v0.155.0 (Zed Nightly f8195c4)
OS: macOS 14.6.1
Memory: 18 GiB
Architecture: aarch64

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ai/edit predictionUmbrella label for Copilot, Supermaven, etc. inline completions (non-Zeta-specific)area:editorFeedback for code editing, formatting, editor iterations, etcarea:language serverAn umbrella label for all language serversarea:language server/server failureLanguage server doesn't work as expectedarea:languagesAn umbrella label for all programming languages syntax behaviorsarea:languages/javascriptJavaScript programming language supportbugDEPRECATED label: use issue type 'Bug' insteadstaleLabel used by `stale` action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions