Add mjs/cjs and mts/cts to path based language mode checks

This commit is contained in:
Matt Bierner
2021-10-07 17:47:17 -07:00
parent 001c14610e
commit 710e0d4d9c

View File

@@ -51,9 +51,9 @@ export function isJsConfigOrTsConfigFileName(fileName: string): boolean {
}
export function doesResourceLookLikeATypeScriptFile(resource: vscode.Uri): boolean {
return /\.tsx?$/i.test(resource.fsPath);
return /\.(tsx?|mts|cts)$/i.test(resource.fsPath);
}
export function doesResourceLookLikeAJavaScriptFile(resource: vscode.Uri): boolean {
return /\.jsx?$/i.test(resource.fsPath);
return /\.(jsx?|mjs|cjs)$/i.test(resource.fsPath);
}