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

Auto Import Suggestions Do Not Work Unless Original Files are Open in Another Tab #761

Closed
Tiernebre opened this issue Dec 11, 2022 · 1 comment · Fixed by denoland/deno#17979

Comments

@Tiernebre
Copy link

Describe the bug

When using VSCode and using a variable that is exported from another file in the workspace, the Deno extension is not offering suggestions for auto completion of importing it unless I specifically have the file that contained the original export in it open in the VSCode window.

This occurs with specific error Cannot find name _. deno-ts(2304)

To Reproduce

  1. Create a new empty folder.
  2. Open this folder up in VSCode
  3. Initialize the Deno VSconfiguration (follow steps here)
  4. Create a new file called foo.ts.
  5. In foo.ts, write export const someSpecificFooFunction = () => 'Test!'
  6. Create a new file called baz.ts and open it in VSCode.
  7. Ensure that you do not have a tab open with foo.ts (close if it's still on your tab list).
  8. Start typing out someSpecificFooFunction() in baz.ts.
  9. Note that the editor correctly identifies that Cannot find name 'someSpecificFooFunction'.deno-ts(2304)
  10. Use VSCode's quick fix when hovering over the error, and note that the only solution is to declare it in the file.
  11. Open foo.ts in another tab on VSCode.
  12. Go back to baz.ts and open the VSCode quick fix again.
  13. Note that this time, the plugin was able to find the exported someSpecificFooFunction from foo.ts.

Expected behavior

When the specific error Cannot find name ''.deno-ts(2304) occurs, a quick fix solution that is able to discover the export existing in another local file should always be available without needing to have the original file open in a tab in the code editor.

Screenshots

2022-12-11.14-52-49.mp4

copy of my settings.json

{
    "deno.enable": true,
    "deno.unstable": true
}

Versions

vscode: 1.74.0 (using OSS version) deno: 1.28.3 extension: v3.14.1

@bartlomieju
Copy link
Member

Appears that denoland/deno#11190 is required to do this.

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 a pull request may close this issue.

3 participants