Import path autocomplete doesn't work
Hi 👋
It behaves like it's just a string and not an import path. I have the latest version of Deno and Extension installed.
2 Replies
Hello there! 🦕
If the import path autocomplete isn't working as expected, there are a few things we can check based on the documentation:
1. Deno CLI Path: Ensure that the Deno CLI executable is correctly set in your environment's
PATH
, or set the Deno: Path manually in your editor settings to point to the Deno executable. If the path is relative, it should be resolved relative to the root of your workspace.
2. Import Suggestions: The Deno extension should offer suggestions to complete the import for local relative files and any cached remote files. If it's not doing so, make sure that the feature is not disabled in your settings. You can check the Deno > Suggest > Imports: Auto Discover setting to see if it's enabled.
3. Registry Auto-Completions: The extension supports registry auto-completions for remote modules. If the host/origin of the module is not configured, the extension will check if the server supports completion suggestions and prompt you to enable it. Make sure you haven't disabled this feature.
4. Caching Remote Modules: If the module is not in the cache, the extension won't automatically try to cache it unless it's a completion from a registry import suggestion. You might need to run deno cache
for the specific module or use the Deno: Cache Dependencies command in the command palette.
5. Configuration Settings: Check your settings.json
for the correct configuration related to import suggestions. For example, the deno.suggest.imports.hosts
setting should have the correct hosts configured to provide import completions.
If you've checked all these and it's still not working, you might want to try reloading your editor or restarting the Deno language server. If the issue persists, it could be helpful to look at theconsole for any errors that might indicate what's going wrong.
Remember, the extension and Deno need to understand how to find modules, so if you're trying to import from a remote URL that isn't configured as a registry, the extension will only provide modules that are already part of the workspace.
If you need more detailed assistance, could you provide more information about your setup or any error messages you're seeing? This will help in diagnosing the issue further.