Fix detecting default project when file is part for more than one project but not part of default configured project (eg because its output of that projet) - #38429
Conversation
…ject but not part of default configured project (eg because its output of that projet) Fixes #38366
|
TypeScript Bot (@typescript-bot) cherry pick this to release-3.9 |
|
TypeScript Bot (@typescript-bot) cherry-pick this to release-3.9 |
|
Heya Sheetal Nandi (@sheetalkamat), I've started to run the task to cherry-pick this into |
|
Hey Sheetal Nandi (@sheetalkamat), I've opened #38431 for you. |
Component commits: 6e3c1d1 Fix detecting default project when file is part for more than one project but not part of default configured project (eg because its output of that projet) Fixes microsoft#38366
| return project?.isSolution() ? | ||
| project.getDefaultChildProjectFromSolution(info) : | ||
| project; | ||
| project && projectContainsInfoDirectly(project, info) ? |
There was a problem hiding this comment.
Do the other callers of getConfigFileNameForFile and findConfiguredProjectByProjectName need this check too?
There was a problem hiding this comment.
No.. this is the change to determine default project for the file...
There was a problem hiding this comment.
I'm not sure I follow. Why is direct containment more important for the default project than for other projects?
There was a problem hiding this comment.
findConfiguredProjectByProjectName project finds the configured project by the given name and has nothing to do with scriptinfo.
Similary getConfigFileNameForFile finds config file name by traversing directories for tsconfig/jsconfig json files. Nothing else matters.
This function is what determines the default project for given script info and hence the additional logic
Andrew Casey (amcasey)
left a comment
There was a problem hiding this comment.
I don't understand why the change covers all the scenarios it needs to, but I believe it's correct in the scenario it does cover, so I'm fine with merging and discussing offline.
* upstream/master: Update user baselines Fix detecting default project when file is part for more than one project but not part of default configured project (eg because its output of that projet) (microsoft#38429) fix(37877): include in NavigationBar default exported child items (microsoft#38255) fix: add missing semi-colon to `__exportStar` unnamed function Update baselines. Add and use the 'intersperse' helper function. Don't add duplicates of JSDoc comments. Added tests for union types with identical doc comments. feat(38225): change diagnostic message for remove braces from arrow function body Add outlining spans for object destructuring elements
Fixes #38366