-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Missing subfolder path completions with wildcard typesVersions
#47952
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
Comments
I was about to raise this too. I was following https://2ality.com/2021/07/simple-monorepos.html#a-better-solution%3A-npm-workspaces-and-typescript-project-references I needed to have paths in a library instead of just one default export. @andrewbranch I know you worked on this feature, is this a bug? It looks like the resolution works but just not on auto complete? Long term we would use TypeScript's ESM support when that's released, but in the meantime we need to use Here is another example: autocomplete.mp4Here is a test case repository (shown in the video). |
Hey @jasonwilliams, that blog was also my starting point! 😁 |
typeVersions
typesVersions
@jasonwilliams your case is a separate issue. Does it work after there is already one import of projecta elsewhere in projectb? If not, that’s another separate issue. |
no it doesn't. And in the video you can see I have the top line, the second line still doesn't work. |
Since |
Hey @andrewbranch could you explain how both of our casing are different when we’re working from the same tutorial. It seems the issue is |
The way auto imports work and path completions work are just super different. Two different language features with completely different code paths. |
I've just tested this again with the I have set VSCode to use the workspace version and it made no difference. Is this expected @andrewbranch ? If i understand #47836 (comment) correctly we no longer need the "typeversions" hack as the completions are now coming from the exports mapping. Although that didn't make much different. UPDATE I've removed the asterisks in the pattern in exports (prev I can trigger auto complete here: UPDATE 2 I've just switched from |
Using Typescript 3.7 beta, I get the exact same issue with the |
Bug Report
Sub folders of a folder listed in
typeVersions
, do not resolve in VS Code's autocomplete. I originally believed the issue to be related to Support for NodeJS 12.7+ package exports.🔎 Search Terms
typeVersions
autocomplete
🕗 Version & Regression Information
This is using Visual Studio Code 1.64.2 and TypeScript 4.5.5. I believe this bug to not be a revision, and is not resolved in TypeScript 4.7.0.
⏯ Playground Link
Code required relationship between two projects, so used Github instead.
Github repo
💻 Code
We have an internal package, written in TS, transpiled to a sub folder called 'dest'. The package.json of the package looks like:
We're able to consume the package in our projects, like this:
This works. Our code is transpiled correctly. We get autocomplete on the import path, and typing on the imported whatever, within VS Code.
Until, we attempt to access a sub folder within the 'dest' folder. Within a subfolder, like:
In this instance, we get everything from above, except autocomplete on the import path. The file still resolves, and we get typing. Our build script still runs, the files is just invisible.
This is using Visual Studio Code 1.64.2 and TypeScript 4.5.5. Both project and package have the following tsconfig.json:
🙁 Actual behavior
Autocomplete does not resolve the scripts with the sub folder.
🙂 Expected behavior
Autocomplete should resolve the scripts within a sub folder.
The text was updated successfully, but these errors were encountered: