coc-springboot 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +28 -17
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -3368,13 +3368,22 @@ var coc4 = __toESM(require("coc.nvim"));
3368
3368
  var path = __toESM(require("path"));
3369
3369
  var BOOT_UPGRADE = "BOOT_UPGRADE";
3370
3370
  var OTHER_REFACTORINGS = "NON_BOOT_UPGRADE";
3371
- var quickPick;
3372
3371
  var RECIPE_PICK_ACTIONS = [
3372
+ {
3373
+ id: "exit",
3374
+ label: "Close",
3375
+ description: "Exit the receipes picker without action",
3376
+ selected: false,
3377
+ picked: false,
3378
+ action: "exit",
3379
+ children: void 0
3380
+ },
3373
3381
  {
3374
3382
  id: "root",
3375
3383
  label: "Initial",
3376
3384
  description: "Navigate to the base list of receipes",
3377
3385
  selected: false,
3386
+ picked: false,
3378
3387
  action: "root",
3379
3388
  children: void 0
3380
3389
  },
@@ -3383,6 +3392,7 @@ var RECIPE_PICK_ACTIONS = [
3383
3392
  label: "Parent",
3384
3393
  description: "Navigate to the parent of this receipe",
3385
3394
  selected: false,
3395
+ picked: false,
3386
3396
  action: "parent",
3387
3397
  children: void 0
3388
3398
  }
@@ -3437,7 +3447,7 @@ async function showRefactorings(uri, filter) {
3437
3447
  if (recipeDescriptors.length) {
3438
3448
  coc4.commands.executeCommand("sts/rewrite/execute", uri.toString(true), recipeDescriptors, true);
3439
3449
  } else {
3440
- coc4.window.showErrorMessage("No recipes were selected from the list");
3450
+ coc4.window.showWarningMessage("No recipes were selected for application from the list");
3441
3451
  }
3442
3452
  }
3443
3453
  function convertToRecipeSelectionDescriptor(i) {
@@ -3458,14 +3468,13 @@ function convertToQuickPickItem(i, selected) {
3458
3468
  };
3459
3469
  }
3460
3470
  async function showCurrentPathQuickPick(itemsPromise, itemsPath) {
3461
- if (!quickPick) {
3462
- quickPick = await coc4.window.createQuickPick();
3463
- const columns = await coc4.nvim.eval("&columns");
3464
- quickPick.width = Math.ceil(columns * 0.7);
3465
- quickPick.matchOnDescription = true;
3466
- quickPick.canSelectMany = true;
3467
- }
3471
+ coc4.window.showInformationMessage("<tab> on item to toggle, <cr> for sub receipes list or action (close, initial, parent)");
3472
+ const quickPick = await coc4.window.createQuickPick();
3473
+ const columns = await coc4.nvim.eval("&columns");
3474
+ quickPick.width = Math.ceil(columns * 0.7);
3468
3475
  quickPick.title = "Loading Recipes";
3476
+ quickPick.matchOnDescription = true;
3477
+ quickPick.canSelectMany = true;
3469
3478
  quickPick.value = "";
3470
3479
  quickPick.items = [];
3471
3480
  quickPick.loading = true;
@@ -3483,15 +3492,15 @@ async function showCurrentPathQuickPick(itemsPromise, itemsPath) {
3483
3492
  if (itemsPath.length > 0) {
3484
3493
  currentItems = [...RECIPE_PICK_ACTIONS, ...currentItems];
3485
3494
  } else {
3486
- currentItems = [...currentItems];
3495
+ currentItems = [RECIPE_PICK_ACTIONS[0], ...currentItems];
3487
3496
  }
3488
3497
  setTimeout(() => {
3489
3498
  quickPick.title = "Select Recipes";
3490
3499
  quickPick.items = currentItems;
3491
3500
  quickPick.loading = false;
3492
- }, 175);
3501
+ }, 125);
3493
3502
  quickPick.onDidChangeSelection((selected) => {
3494
- if (selected.filter((i) => i.action === "root" || i.action === "parent").length > 0) {
3503
+ if (selected.filter((i) => !!i.action).length > 0) {
3495
3504
  return;
3496
3505
  }
3497
3506
  currentItems.forEach((i) => {
@@ -3504,14 +3513,16 @@ async function showCurrentPathQuickPick(itemsPromise, itemsPath) {
3504
3513
  });
3505
3514
  quickPick.onDidFinish((selectedItems) => {
3506
3515
  const index = quickPick.currIndex;
3507
- quickPick = null;
3508
- if (selectedItems && selectedItems.length > 0) {
3509
- resolve2(selectedItems);
3510
- coc4.window.showInformationMessage(`Applying ${selectedItems.length} items from the list of recipes `);
3516
+ const selected = selectedItems?.filter((i) => !i.action);
3517
+ if (selected && selected.length > 0) {
3518
+ resolve2(selected);
3519
+ coc4.window.showInformationMessage(`Applying ${selected.length} items from the list of recipes `);
3511
3520
  } else {
3512
3521
  if (index >= 0 && index < currentItems.length) {
3513
3522
  const item = currentItems[index];
3514
- if (item.action === "root") {
3523
+ if (item.action === "exit") {
3524
+ resolve2([]);
3525
+ } else if (item.action === "root") {
3515
3526
  showCurrentPathQuickPick(Promise.resolve(items), []).then(resolve2, reject);
3516
3527
  } else if (item.action === "parent") {
3517
3528
  itemsPath.pop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coc-springboot",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Coc spring boot language server extension client",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",