Skip to content

Commit 63f23c5

Browse files
committed
Display converters only on js files
1 parent 5e4f7b6 commit 63f23c5

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"title": "Extract style to StyleSheet"
3939
},
4040
{
41-
"command": "react-toolkit.readFile",
41+
"command": "react-toolkit.convertToTS",
4242
"title": "Convert to Typescript"
4343
},
4444
{
@@ -56,10 +56,12 @@
5656
],
5757
"explorer/context": [
5858
{
59-
"command": "react-toolkit.readFile",
59+
"when": "resourceExtname == .js",
60+
"command": "react-toolkit.convertToTS",
6061
"group": "1_modification@1"
6162
},
6263
{
64+
"when": "resourceExtname == .js",
6365
"command": "react-toolkit.convertCjsToEsm",
6466
"group": "1_modification@2"
6567
}

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export function activate(context: vscode.ExtensionContext) {
55
console.log('Congratulations, your extension "react-toolkit" is now active!');
66

77
const commandExtractStyle = vscode.commands.registerCommand('react-toolkit.extractStyle', extractStyle);
8-
const commandReadFile = vscode.commands.registerCommand('react-toolkit.readFile', convertFileToTypescript);
8+
const commandReadFile = vscode.commands.registerCommand('react-toolkit.convertToTS', convertFileToTypescript);
99
const commandCjsToEsm = vscode.commands.registerCommand('react-toolkit.convertCjsToEsm', convertCjsToEsm);
1010

1111
context.subscriptions.push(commandExtractStyle);

0 commit comments

Comments
 (0)