From bf04268a16a3ca5170c7881e259b4134e2f757a9 Mon Sep 17 00:00:00 2001 From: Jinbo Wang Date: Thu, 23 Nov 2023 15:16:40 +0800 Subject: [PATCH 1/2] Rephrase the menu names for new Java file --- .../com.microsoft.jdtls.ext.tp.target | 5 +---- package.nls.json | 8 ++++---- package.nls.zh-cn.json | 6 +++--- package.nls.zh-tw.json | 6 +++--- src/explorerCommands/new.ts | 2 +- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/jdtls.ext/com.microsoft.jdtls.ext.target/com.microsoft.jdtls.ext.tp.target b/jdtls.ext/com.microsoft.jdtls.ext.target/com.microsoft.jdtls.ext.tp.target index fe9ad64a..830e17e6 100644 --- a/jdtls.ext/com.microsoft.jdtls.ext.target/com.microsoft.jdtls.ext.tp.target +++ b/jdtls.ext/com.microsoft.jdtls.ext.target/com.microsoft.jdtls.ext.tp.target @@ -14,11 +14,8 @@ - - - - + diff --git a/package.nls.json b/package.nls.json index 19c20d8d..c876d1f8 100644 --- a/package.nls.json +++ b/package.nls.json @@ -22,15 +22,15 @@ "contributes.commands.java.view.package.copyFilePath": "Copy Path", "contributes.commands.java.view.package.copyRelativeFilePath": "Copy Relative Path", "contributes.commands.java.view.package.new": "New...", - "contributes.commands.java.view.package.newJavaClass": "Java Class", - "contributes.commands.java.view.package.newPackage": "Package", - "contributes.commands.java.view.package.newFile": "File", + "contributes.commands.java.view.package.newJavaClass": "Java Class...", + "contributes.commands.java.view.package.newPackage": "Package...", + "contributes.commands.java.view.package.newFile": "File...", "contributes.commands.java.view.package.newFolder": "Folder", "contributes.commands.java.view.package.renameFile": "Rename", "contributes.commands.java.view.package.moveFileToTrash": "Delete", "contributes.commands.java.view.package.deleteFilePermanently": "Delete Permanently", "contributes.submenus.javaProject.new": "New", - "contributes.commands.java.view.menus.file.newJavaClass": "New Java Class", + "contributes.commands.java.view.menus.file.newJavaClass": "New Java File", "configuration.java.dependency.showMembers": "Show the members in the explorer", "configuration.java.dependency.syncWithFolderExplorer": "Link Java Projects Explorer with the active editor", "configuration.java.dependency.autoRefresh": "Synchronize Java Projects explorer with changes", diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json index 4234ad53..ed5f3403 100644 --- a/package.nls.zh-cn.json +++ b/package.nls.zh-cn.json @@ -22,9 +22,9 @@ "contributes.commands.java.view.package.copyFilePath": "复制路径", "contributes.commands.java.view.package.copyRelativeFilePath": "复制相对路径", "contributes.commands.java.view.package.new": "创建...", - "contributes.commands.java.view.package.newJavaClass": "Java 类", - "contributes.commands.java.view.package.newPackage": "包", - "contributes.commands.java.view.package.newFile": "文件", + "contributes.commands.java.view.package.newJavaClass": "Java 类...", + "contributes.commands.java.view.package.newPackage": "包...", + "contributes.commands.java.view.package.newFile": "文件...", "contributes.commands.java.view.package.newFolder": "文件夹", "contributes.commands.java.view.package.renameFile": "重命名", "contributes.commands.java.view.package.moveFileToTrash": "删除", diff --git a/package.nls.zh-tw.json b/package.nls.zh-tw.json index fd27c378..94ac2499 100644 --- a/package.nls.zh-tw.json +++ b/package.nls.zh-tw.json @@ -20,9 +20,9 @@ "contributes.commands.java.view.package.copyFilePath": "複製路徑", "contributes.commands.java.view.package.copyRelativeFilePath": "複製相對路徑", "contributes.commands.java.view.package.new": "建立...", - "contributes.commands.java.view.package.newJavaClass": "Java 類別", - "contributes.commands.java.view.package.newPackage": "套件", - "contributes.commands.java.view.package.newFile": "檔案", + "contributes.commands.java.view.package.newJavaClass": "Java 類別...", + "contributes.commands.java.view.package.newPackage": "套件...", + "contributes.commands.java.view.package.newFile": "檔案...", "contributes.commands.java.view.package.newFolder": "資料夾", "contributes.commands.java.view.package.renameFile": "重新命名", "contributes.commands.java.view.package.moveFileToTrash": "刪除", diff --git a/src/explorerCommands/new.ts b/src/explorerCommands/new.ts index 509439db..bc835034 100644 --- a/src/explorerCommands/new.ts +++ b/src/explorerCommands/new.ts @@ -82,7 +82,7 @@ export async function newJavaClass(node?: DataNode): Promise { } const className: string | undefined = await window.showInputBox({ - placeHolder: "Input the class name", + placeHolder: "Enter the Java file name for class/interface/enum/record/@interface", ignoreFocusOut: true, validateInput: async (value: string): Promise => { const checkMessage: string = checkJavaQualifiedName(value); From 52f343aec3a5b77c40228e2ed945a714c1389a26 Mon Sep 17 00:00:00 2001 From: Jinbo Wang Date: Fri, 24 Nov 2023 09:54:09 +0800 Subject: [PATCH 2/2] fix test case --- test/ui/command.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ui/command.test.ts b/test/ui/command.test.ts index 083fd8ab..7894907a 100644 --- a/test/ui/command.test.ts +++ b/test/ui/command.test.ts @@ -121,7 +121,7 @@ describe("Command Tests", function() { assert.ok(quickPick, `Quickpick item "src/main/java" should be found`); await quickPick!.click(); inputBox = await InputBox.create(); - assert.ok(await inputBox.getPlaceHolder() === "Input the class name", `InputBox "Input the class name" should appear`); + assert.ok(await inputBox.getPlaceHolder() === "Enter the Java file name for class/interface/enum/record/@interface", `InputBox "Enter the Java file name" should appear`); await inputBox.setText("App2"); await inputBox.confirm(); await sleep(1000);