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

Path Intellisense does not display files in the current folder #161

Closed
eltonlimaribeiro opened this issue May 5, 2020 · 13 comments
Closed
Labels

Comments

@eltonlimaribeiro
Copy link

When I type "./" the files in the current folder are not shown, but the folder above the project folder. How do I resolve?

@ChristianKohler
Copy link
Owner

Could you provide a more data?

@BWrong
Copy link

BWrong commented Oct 27, 2020

stay tsconfig.json That happens when you set "baseurl": "." / "

@stefcameron
Copy link

I'm experiencing something similar. In my repository (a monorepo with multiple packages), which is not TypeScript-based (just pure JS), we have a build process that generates typing definitions (a bunch of index.d.ts files).

So I added a tsconfig.json with compilerOptions.baseUrl = "." and some compilerOptions.path resolutions to help with path aliases used in Webpack.

But now, Path Intellisense picks-up on baseUrl and assumes everything is from there. I guess in TS land that makes sense, but in my case, it's really frustration since as soon as I type ./ to start entering a path, I'm already at the root directory of my repo instead of 3 directories deep where the file I'm importing into is located.

So basically, I'd want the extension to ignore the tsconfig.json in this case, since I only want it to help VSCode resolve typings, not file paths.

@BWrong
Copy link

BWrong commented Oct 9, 2021

It seems the author is not going to fix it, I have changed to Path Autocomplete

@stefcameron
Copy link

It seems the author is not going to fix it, I have changed to Path Autocomplete

@BWrong Thanks for the lead, this ^^^ looks like a great alternative!

@ChristianKohler
Copy link
Owner

@stefcameron Thanks for the good description and @BWrong for the hint.

Currently the extension reads the tsconfig and the baseUrl by default if it exists. I guess it is a sensible default for most TS projects.

In your case, what would be the best option? Only thing which currently comes to my mind is to add a setting to tell the extension to ignore the tsconfig 🤔

@stefcameron
Copy link

@stefcameron Thanks for the good description and @BWrong for the hint.

Currently the extension reads the tsconfig and the baseUrl by default if it exists. I guess it is a sensible default for most TS projects.

In your case, what would be the best option? Only thing which currently comes to my mind is to add a setting to tell the extension to ignore the tsconfig 🤔

I can't think of anything else that would work. Just because there's a tsconfig.json file in the repo doesn't necessarily mean it's a TS project. As I said earlier, we generate typings, but we don't author code in TS, and to verify those typings, we need to compile them, hence the need for tsconfig.json in our repo, but our repo is not authored in TS.

github-actions bot pushed a commit that referenced this issue Nov 22, 2021
# [2.5.0](v2.4.2...v2.5.0) (2021-11-22)

### Features

* **ignoreTsConfigBaseUrl:** implemented ([fb323d9](fb323d9)), closes [#161](#161)
@ChristianKohler
Copy link
Owner

🎉 This issue has been resolved in version 2.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@ChristianKohler
Copy link
Owner

Hey @stefcameron

Could you test if the new release 2.5.0 solves you issue?

You can add the following setting to disable the tsconfig baseurl mapping:

{
	"path-intellisense.ignoreTsConfigBaseUrl": false,
}

Thank you for your help.

@stefcameron
Copy link

@ChristianKohler Thanks for the new feature! I haven't forgotten about your request, just haven't been in a position to test it out just yet, but I'll let you know.

Just one remark, though, "path-intellisense.ignoreTsConfigBaseUrl": false, -- the double-negative is hard to process in my mind. It would've been more readable had it been, "path-intellisense.useTsConfigBaseUrl": false, and with the new option set to true by default so as not to change existing behavior for everyone else.

For my test, I will install the new version (2.5.0) and then set, "path-intellisense.ignoreTsConfigBaseUrl": true, and see if that works better.

@ChristianKohler
Copy link
Owner

Thank you @stefcameron

the double-negative is hard to process in my mind.

Good point. Agree. To bad that I‘ve already released it in that way :-/ I feel, creating a migration path for that would not be justified though..

For my test, I will install the new version (2.5.0) and then set, "path-intellisense.ignoreTsConfigBaseUrl": true, and see if that works better.

Thank you. Looking forward to hear if it helped.

@stefcameron
Copy link

@ChristianKohler I finally had some time to check this out, and it does work! Thank you.

But there's a typo in the documentation (the double-negative trap 😉 ):

{
	"path-intellisense.ignoreTsConfigBaseUrl": false,   // <- should be true, not false, to ignore
}

Good point. Agree. To bad that I‘ve already released it in that way :-/ I feel, creating a migration path for that would not be justified though..

Agreed since it's already published and now in use.

@ChristianKohler
Copy link
Owner

Thank you for checking it out @stefcameron 🙏

But there's a typo in the documentation (the double-negative trap 😉 )

🤦‍♂️ Ups. Fixed it. Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants