@@ -198,7 +198,8 @@ internal static bool IsNodejsFile(string strFileName)
198198 {
199199 var ext = Path . GetExtension ( strFileName ) ;
200200
201- return StringComparer . OrdinalIgnoreCase . Equals ( ext , NodejsConstants . JavaScriptExtension ) ;
201+ return StringComparer . OrdinalIgnoreCase . Equals ( ext , NodejsConstants . JavaScriptExtension ) ||
202+ StringComparer . OrdinalIgnoreCase . Equals ( ext , NodejsConstants . JavaScriptJsxExtension ) ;
202203 }
203204
204205 internal override string GetItemType ( string filename )
@@ -209,7 +210,7 @@ internal override string GetItemType(string filename)
209210 Path . Combine ( this . ProjectHome , filename ) ;
210211
211212 var node = this . FindNodeByFullPath ( absFileName ) as NodejsFileNode ;
212- if ( node != null && node . ItemNode . ItemTypeName != null )
213+ if ( node ? . ItemNode ? . ItemTypeName != null )
213214 {
214215 return node . ItemNode . ItemTypeName ;
215216 }
@@ -271,7 +272,14 @@ protected override bool DisableCmdInCurrentMode(Guid commandGroup, uint command)
271272 return false ;
272273 }
273274
274- public override string [ ] CodeFileExtensions => new [ ] { NodejsConstants . JavaScriptExtension } ;
275+ private static readonly string [ ] codeFileExtensions = new [ ] {
276+ NodejsConstants . JavaScriptExtension ,
277+ NodejsConstants . JavaScriptJsxExtension ,
278+ NodejsConstants . TypeScriptExtension ,
279+ NodejsConstants . TypeScriptJsxExtension
280+ } ;
281+
282+ public override string [ ] CodeFileExtensions => codeFileExtensions ;
275283
276284 protected internal override FolderNode CreateFolderNode ( ProjectElement element )
277285 {
@@ -359,7 +367,8 @@ protected override NodeProperties CreatePropertiesObject()
359367 public override bool IsCodeFile ( string fileName )
360368 {
361369 var ext = Path . GetExtension ( fileName ) ;
362- return StringComparer . OrdinalIgnoreCase . Equals ( NodejsConstants . JavaScriptExtension ) ||
370+ return StringComparer . OrdinalIgnoreCase . Equals ( ext , NodejsConstants . JavaScriptExtension ) ||
371+ StringComparer . OrdinalIgnoreCase . Equals ( ext , NodejsConstants . JavaScriptJsxExtension ) ||
363372 TypeScriptHelpers . IsTypeScriptFile ( fileName ) ;
364373 }
365374
0 commit comments