-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Having both a .ts and .js file with the same name breaks intellisense #41012
Comments
Most likely the same issue as #40982. |
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
@andrewbranch , is this really the desired behaviour? I'm sure the code does what it's supposed to do. But the behaviour still makes no sense and can easily confuse developers. |
If anything, we should probably give you a configuration error in this case. Since jsconfig.json has |
This is somewhat similar to #40195 |
Okay, I see. That makes sense. I appreciate the elaboration - thank you :-) |
Having e.g. test.js and test.ts in the same project partially breaks intellisense.
Expected behavior:
Since
value
might be undefined , I would expect an error - just like we get when there is no test.ts present.Actual behavior:
Notice how test.ts is now present (it's just an empty file), and we no longer receive an error - but the intellisense partially works, as the tool tip reveals the type of
value
.Notice how it no longer knows that
value
might be undefined. It's like the validation rules for .ts files are being used for .js files all of a sudden.If we rename test.ts to test2.ts, then intellisense works again.
Content of jsconfig.json:
Tested with TypeScript 4.0.3 and TypeScript@Next (4.1.0-dev.20201009).
VSCode:
Version: 1.50.0
Commit: 93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3
Date: 2020-10-07T06:00:00.397Z (2 days ago)
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 17.7.0
The text was updated successfully, but these errors were encountered: