Skip to content

feat(language-core): add option to resolve hidden extensions#190

Merged
johnsoncodehk merged 1 commit intomasterfrom
resolveHiddenExtensions
May 31, 2024
Merged

feat(language-core): add option to resolve hidden extensions#190
johnsoncodehk merged 1 commit intomasterfrom
resolveHiddenExtensions

Conversation

@johnsoncodehk
Copy link
Member

Add resolveHiddenExtensions option to LanguagePlugin#typescript. When enabled, resolveModeName will attempt to add extra extensions to resolve's module name.

@johnsoncodehk johnsoncodehk marked this pull request as ready for review May 31, 2024 20:30
@johnsoncodehk johnsoncodehk merged commit 3231202 into master May 31, 2024
@johnsoncodehk johnsoncodehk deleted the resolveHiddenExtensions branch May 31, 2024 20:32
johnsoncodehk added a commit to johnsoncodehk/glint that referenced this pull request May 31, 2024
}
}
}
if (typescript.resolveHiddenExtensions && fileName.endsWith(`.d.ts`)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for understanding/posterity: I was confused about why we'd be checking .d.ts extension here, given that for an Ember .gts file, there wouldn't be a .d.ts file on disk. But the reason this works is that TS checks for xxx.js, xxx.ts, and then xxx.d.ts. We hook into the check for .d.ts and take that opportunity to check for extra file extensions (such as .gts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants