Remove *.ts and *.js extension check code duplication#710
Remove *.ts and *.js extension check code duplication#710mjbvz wants to merge 8 commits intomicrosoft:masterfrom
Conversation
|
Hi @mjbvz, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
| using System.IO; | ||
|
|
||
| namespace Microsoft.NodejsTools { | ||
| static class NodejsFileExtensions { |
There was a problem hiding this comment.
Can you change the name of this to be something like NodejsFileTypeHelpers? Files named with "Extensions" tend to contain extension methods, so it's a bit overloaded.
|
There are also several more locations that are missed with this change that we may as well replace. 👍 after that! |
|
LGTM, but looks like there are conflicts now (might have been due to #730) - can you update and merge this in? |
|
Closing since the line ending change makes merging back in to messy. Will reapply the change and submit another PR. |
Defect
There are currently a number of places that implement logic for checking if a file is Javascript or Typescript based on file extension. This code is hard to read and can get out of sync.
Fix
Created two helper methods to implement these checks. Replace most of the old extension check logic with calls to these helpers instead.