@@ -390,8 +390,8 @@ export class ExtensionCommandsFeature implements IFeature {
390
390
391
391
// since Windows is case-insensitive, we need to normalize it differently
392
392
var canFind = vscode . workspace . textDocuments . find ( doc => {
393
- var docPath ;
394
- if ( os . platform ( ) == "win32" ) {
393
+ var docPath , platform = os . platform ( ) ;
394
+ if ( platform == "win32" || platform == "darwin ") {
395
395
// for windows paths, they are normalized to be lowercase
396
396
docPath = doc . fileName . toLowerCase ( ) ;
397
397
} else {
@@ -424,8 +424,8 @@ export class ExtensionCommandsFeature implements IFeature {
424
424
425
425
// since Windows is case-insensitive, we need to normalize it differently
426
426
var canFind = vscode . workspace . textDocuments . find ( doc => {
427
- var docPath ;
428
- if ( os . platform ( ) == "win32" ) {
427
+ var docPath , platform = os . platform ( ) ;
428
+ if ( platform == "win32" || platform == "darwin ") {
429
429
// for windows paths, they are normalized to be lowercase
430
430
docPath = doc . fileName . toLowerCase ( ) ;
431
431
} else {
@@ -454,7 +454,8 @@ export class ExtensionCommandsFeature implements IFeature {
454
454
}
455
455
456
456
private normalizeFilePath ( filePath : string ) : string {
457
- if ( os . platform ( ) == "win32" ) {
457
+ var platform = os . platform ( ) ;
458
+ if ( platform == "win32" ) {
458
459
// Make sure the file path is absolute
459
460
if ( ! path . win32 . isAbsolute ( filePath ) )
460
461
{
@@ -474,7 +475,12 @@ export class ExtensionCommandsFeature implements IFeature {
474
475
filePath ) ;
475
476
}
476
477
477
- return filePath ;
478
+ //macOS is case-insensitive
479
+ if ( platform == "darwin" ) {
480
+ filePath = filePath . toLowerCase ( ) ;
481
+ }
482
+
483
+ return filePath ;
478
484
}
479
485
}
480
486
0 commit comments