ChristianKohler/PathIntellisense

Path Intellisense does not display files in the current folder

eltonlimaribeiro opened this issue ยท 13 comments

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

Could you provide a more data?

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

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.

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

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!

@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 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.

๐ŸŽ‰ This issue has been resolved in version 2.5.0 ๐ŸŽ‰

The release is available on GitHub release

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

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.

@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.

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.

@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.

Thank you for checking it out @stefcameron ๐Ÿ™

But there's a typo in the documentation (the double-negative trap ๐Ÿ˜‰ )

๐Ÿคฆโ€โ™‚๏ธ Ups. Fixed it. Thx.