@fresh-editor/fresh-editor 0.2.25 → 0.3.1

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 (82) hide show
  1. package/CHANGELOG.md +216 -0
  2. package/README.md +6 -0
  3. package/package.json +1 -1
  4. package/plugins/astro-lsp.ts +6 -12
  5. package/plugins/audit_mode.i18n.json +14 -14
  6. package/plugins/audit_mode.ts +182 -146
  7. package/plugins/bash-lsp.ts +15 -22
  8. package/plugins/clangd-lsp.ts +15 -24
  9. package/plugins/clojure-lsp.ts +9 -12
  10. package/plugins/cmake-lsp.ts +9 -12
  11. package/plugins/code-tour.ts +15 -16
  12. package/plugins/config-schema.json +79 -6
  13. package/plugins/csharp_support.ts +25 -30
  14. package/plugins/css-lsp.ts +15 -22
  15. package/plugins/dart-lsp.ts +9 -12
  16. package/plugins/dashboard.ts +1903 -0
  17. package/plugins/devcontainer.i18n.json +1472 -0
  18. package/plugins/devcontainer.ts +2793 -0
  19. package/plugins/diagnostics_panel.ts +10 -17
  20. package/plugins/elixir-lsp.ts +9 -12
  21. package/plugins/erlang-lsp.ts +9 -12
  22. package/plugins/examples/bookmarks.ts +10 -16
  23. package/plugins/find_references.ts +5 -9
  24. package/plugins/flash.ts +577 -0
  25. package/plugins/fsharp-lsp.ts +9 -12
  26. package/plugins/git_explorer.ts +16 -20
  27. package/plugins/git_gutter.ts +65 -79
  28. package/plugins/git_log.i18n.json +14 -42
  29. package/plugins/git_log.ts +19 -9
  30. package/plugins/gleam-lsp.ts +9 -12
  31. package/plugins/go-lsp.ts +15 -22
  32. package/plugins/graphql-lsp.ts +9 -12
  33. package/plugins/haskell-lsp.ts +9 -12
  34. package/plugins/html-lsp.ts +15 -24
  35. package/plugins/java-lsp.ts +9 -12
  36. package/plugins/json-lsp.ts +15 -24
  37. package/plugins/julia-lsp.ts +9 -12
  38. package/plugins/kotlin-lsp.ts +15 -22
  39. package/plugins/latex-lsp.ts +9 -12
  40. package/plugins/lib/fresh.d.ts +603 -0
  41. package/plugins/lua-lsp.ts +15 -22
  42. package/plugins/markdown_compose.ts +132 -128
  43. package/plugins/markdown_source.ts +8 -10
  44. package/plugins/marksman-lsp.ts +9 -12
  45. package/plugins/merge_conflict.ts +15 -17
  46. package/plugins/nim-lsp.ts +9 -12
  47. package/plugins/nix-lsp.ts +9 -12
  48. package/plugins/nushell-lsp.ts +9 -12
  49. package/plugins/ocaml-lsp.ts +9 -12
  50. package/plugins/odin-lsp.ts +15 -22
  51. package/plugins/path_complete.ts +5 -6
  52. package/plugins/perl-lsp.ts +9 -12
  53. package/plugins/php-lsp.ts +15 -22
  54. package/plugins/pkg.ts +10 -21
  55. package/plugins/protobuf-lsp.ts +9 -12
  56. package/plugins/python-lsp.ts +15 -24
  57. package/plugins/r-lsp.ts +9 -12
  58. package/plugins/ruby-lsp.ts +15 -22
  59. package/plugins/rust-lsp.ts +18 -28
  60. package/plugins/scala-lsp.ts +9 -12
  61. package/plugins/schemas/theme.schema.json +126 -0
  62. package/plugins/search_replace.ts +10 -13
  63. package/plugins/solidity-lsp.ts +9 -12
  64. package/plugins/sql-lsp.ts +9 -12
  65. package/plugins/svelte-lsp.ts +9 -12
  66. package/plugins/swift-lsp.ts +9 -12
  67. package/plugins/tailwindcss-lsp.ts +9 -12
  68. package/plugins/templ-lsp.ts +9 -12
  69. package/plugins/terraform-lsp.ts +9 -12
  70. package/plugins/theme_editor.i18n.json +98 -14
  71. package/plugins/theme_editor.ts +156 -209
  72. package/plugins/toml-lsp.ts +15 -22
  73. package/plugins/tsconfig.json +100 -0
  74. package/plugins/typescript-lsp.ts +15 -24
  75. package/plugins/typst-lsp.ts +15 -22
  76. package/plugins/vi_mode.ts +77 -290
  77. package/plugins/vue-lsp.ts +9 -12
  78. package/plugins/yaml-lsp.ts +15 -22
  79. package/plugins/zig-lsp.ts +9 -12
  80. package/themes/high-contrast.json +2 -2
  81. package/themes/nord.json +4 -0
  82. package/themes/solarized-dark.json +4 -0
@@ -322,85 +322,17 @@ async function updateGitGutter(bufferId: number): Promise<void> {
322
322
  /**
323
323
  * Handle after file open - initialize git state and update indicators
324
324
  */
325
- function onGitGutterAfterFileOpen(args: {
326
- buffer_id: number;
327
- path: string;
328
- }): boolean {
329
- const bufferId = args.buffer_id;
330
- const filePath = args.path;
331
-
332
- if (!filePath || filePath === "") {
333
- return true;
334
- }
335
325
 
336
- // Initialize state for this buffer
337
- bufferStates.set(bufferId, {
338
- filePath,
339
- hunks: [],
340
- updating: false,
341
- });
342
-
343
- // Update immediately (no debounce for file open)
344
- updateGitGutter(bufferId);
345
-
346
- return true;
347
- }
348
- registerHandler("onGitGutterAfterFileOpen", onGitGutterAfterFileOpen);
349
326
 
350
327
  /**
351
328
  * Handle buffer activation - update if we have state but indicators might be stale
352
329
  */
353
- function onGitGutterBufferActivated(args: {
354
- buffer_id: number;
355
- }): boolean {
356
- const bufferId = args.buffer_id;
357
330
 
358
- // If we don't have state yet, try to initialize from buffer path
359
- if (!bufferStates.has(bufferId)) {
360
- const filePath = editor.getBufferPath(bufferId);
361
- if (filePath && filePath !== "") {
362
- bufferStates.set(bufferId, {
363
- filePath,
364
- hunks: [],
365
- updating: false,
366
- });
367
- updateGitGutter(bufferId);
368
- }
369
- }
370
- // If we already have state, the indicators should be current
371
- // (they update on file open and save)
372
-
373
- return true;
374
- }
375
- registerHandler("onGitGutterBufferActivated", onGitGutterBufferActivated);
376
331
 
377
332
  /**
378
333
  * Handle after file save - refresh indicators
379
334
  */
380
- function onGitGutterAfterSave(args: {
381
- buffer_id: number;
382
- path: string;
383
- }): boolean {
384
- const bufferId = args.buffer_id;
385
-
386
- // Update state with new path (in case of save-as)
387
- const state = bufferStates.get(bufferId);
388
- if (state) {
389
- state.filePath = args.path;
390
- } else {
391
- bufferStates.set(bufferId, {
392
- filePath: args.path,
393
- hunks: [],
394
- updating: false,
395
- });
396
- }
397
-
398
- // Update immediately after save (no debounce)
399
- updateGitGutter(bufferId);
400
335
 
401
- return true;
402
- }
403
- registerHandler("onGitGutterAfterSave", onGitGutterAfterSave);
404
336
 
405
337
  // Note: Git diff compares the file on disk, not the in-memory buffer.
406
338
  // Line indicators automatically track position changes via byte-position markers.
@@ -409,13 +341,7 @@ registerHandler("onGitGutterAfterSave", onGitGutterAfterSave);
409
341
  /**
410
342
  * Handle buffer closed - cleanup state
411
343
  */
412
- function onGitGutterBufferClosed(args: {
413
- buffer_id: number;
414
- }): boolean {
415
- bufferStates.delete(args.buffer_id);
416
- return true;
417
- }
418
- registerHandler("onGitGutterBufferClosed", onGitGutterBufferClosed);
344
+
419
345
 
420
346
  // =============================================================================
421
347
  // Commands
@@ -458,10 +384,70 @@ registerHandler("git_gutter_refresh", git_gutter_refresh);
458
384
  // Register event handlers
459
385
  // Note: No need to register after-insert/after-delete hooks - indicators
460
386
  // automatically track position changes via byte-position markers in the editor.
461
- editor.on("after_file_open", "onGitGutterAfterFileOpen");
462
- editor.on("buffer_activated", "onGitGutterBufferActivated");
463
- editor.on("after_file_save", "onGitGutterAfterSave");
464
- editor.on("buffer_closed", "onGitGutterBufferClosed");
387
+ editor.on("after_file_open", (args) => {
388
+ const bufferId = args.buffer_id;
389
+ const filePath = args.path;
390
+
391
+ if (!filePath || filePath === "") {
392
+ return true;
393
+ }
394
+
395
+ // Initialize state for this buffer
396
+ bufferStates.set(bufferId, {
397
+ filePath,
398
+ hunks: [],
399
+ updating: false,
400
+ });
401
+
402
+ // Update immediately (no debounce for file open)
403
+ updateGitGutter(bufferId);
404
+
405
+ return true;
406
+ });
407
+ editor.on("buffer_activated", (args) => {
408
+ const bufferId = args.buffer_id;
409
+
410
+ // If we don't have state yet, try to initialize from buffer path
411
+ if (!bufferStates.has(bufferId)) {
412
+ const filePath = editor.getBufferPath(bufferId);
413
+ if (filePath && filePath !== "") {
414
+ bufferStates.set(bufferId, {
415
+ filePath,
416
+ hunks: [],
417
+ updating: false,
418
+ });
419
+ updateGitGutter(bufferId);
420
+ }
421
+ }
422
+ // If we already have state, the indicators should be current
423
+ // (they update on file open and save)
424
+
425
+ return true;
426
+ });
427
+ editor.on("after_file_save", (args) => {
428
+ const bufferId = args.buffer_id;
429
+
430
+ // Update state with new path (in case of save-as)
431
+ const state = bufferStates.get(bufferId);
432
+ if (state) {
433
+ state.filePath = args.path;
434
+ } else {
435
+ bufferStates.set(bufferId, {
436
+ filePath: args.path,
437
+ hunks: [],
438
+ updating: false,
439
+ });
440
+ }
441
+
442
+ // Update immediately after save (no debounce)
443
+ updateGitGutter(bufferId);
444
+
445
+ return true;
446
+ });
447
+ editor.on("buffer_closed", (args) => {
448
+ bufferStates.delete(args.buffer_id);
449
+ return true;
450
+ });
465
451
 
466
452
  // Register commands
467
453
  editor.registerCommand(
@@ -32,9 +32,7 @@
32
32
  "status.move_to_diff": "Move cursor to a diff line",
33
33
 
34
34
  "panel.commits_header": "Commits:",
35
- "panel.no_commits": " No commits found",
36
- "panel.log_footer": "%{count} commits | Up/Down/j/k: navigate | RET: show | y: yank hash | r: refresh | q: quit",
37
- "panel.detail_footer": "Up/Down/j/k: navigate | RET: open file at line | q: back to log"
35
+ "panel.no_commits": " No commits found"
38
36
  },
39
37
  "cs": {
40
38
  "cmd.git_log": "Git Log",
@@ -69,9 +67,7 @@
69
67
  "status.move_to_diff": "Presunte kurzor na radek diffu",
70
68
 
71
69
  "panel.commits_header": "Commity:",
72
- "panel.no_commits": " Zadne commity nenalezeny",
73
- "panel.log_footer": "%{count} commitu | Nahoru/Dolu/j/k: navigace | RET: zobrazit | y: kopirovat hash | r: obnovit | q: ukoncit",
74
- "panel.detail_footer": "Nahoru/Dolu/j/k: navigace | RET: otevrit soubor na radku | q: zpet do logu"
70
+ "panel.no_commits": " Zadne commity nenalezeny"
75
71
  },
76
72
  "de": {
77
73
  "cmd.git_log": "Git-Protokoll",
@@ -106,9 +102,7 @@
106
102
  "status.move_to_diff": "Cursor auf eine Diff-Zeile bewegen",
107
103
 
108
104
  "panel.commits_header": "Commits:",
109
- "panel.no_commits": " Keine Commits gefunden",
110
- "panel.log_footer": "%{count} Commits | Auf/Ab/j/k: navigieren | RET: anzeigen | y: Hash kopieren | r: aktualisieren | q: beenden",
111
- "panel.detail_footer": "Auf/Ab/j/k: navigieren | RET: Datei bei Zeile oeffnen | q: zurueck zum Protokoll"
105
+ "panel.no_commits": " Keine Commits gefunden"
112
106
  },
113
107
  "es": {
114
108
  "cmd.git_log": "Registro Git",
@@ -143,9 +137,7 @@
143
137
  "status.move_to_diff": "Mueve el cursor a una linea de diff",
144
138
 
145
139
  "panel.commits_header": "Commits:",
146
- "panel.no_commits": " No se encontraron commits",
147
- "panel.log_footer": "%{count} commits | Arriba/Abajo/j/k: navegar | RET: mostrar | y: copiar hash | r: actualizar | q: salir",
148
- "panel.detail_footer": "Arriba/Abajo/j/k: navegar | RET: abrir archivo en linea | q: volver al registro"
140
+ "panel.no_commits": " No se encontraron commits"
149
141
  },
150
142
  "fr": {
151
143
  "cmd.git_log": "Journal Git",
@@ -180,9 +172,7 @@
180
172
  "status.move_to_diff": "Deplacez le curseur sur une ligne de diff",
181
173
 
182
174
  "panel.commits_header": "Commits:",
183
- "panel.no_commits": " Aucun commit trouve",
184
- "panel.log_footer": "%{count} commits | Haut/Bas/j/k: naviguer | RET: afficher | y: copier hash | r: actualiser | q: quitter",
185
- "panel.detail_footer": "Haut/Bas/j/k: naviguer | RET: ouvrir fichier a la ligne | q: retour au journal"
175
+ "panel.no_commits": " Aucun commit trouve"
186
176
  },
187
177
  "it": {
188
178
  "cmd.git_log": "Git Log",
@@ -215,9 +205,7 @@
215
205
  "status.move_to_diff_with_context": "Sposta il cursore su una riga di diff con contesto file",
216
206
  "status.move_to_diff": "Sposta il cursore su una riga di diff",
217
207
  "panel.commits_header": "Commit:",
218
- "panel.no_commits": " Nessun commit trovato",
219
- "panel.log_footer": "%{count} commit | Su/Giù/j/k: naviga | RET: mostra | y: copia hash | r: aggiorna | q: esci",
220
- "panel.detail_footer": "Su/Giù/j/k: naviga | RET: apri file alla riga | q: torna al log"
208
+ "panel.no_commits": " Nessun commit trovato"
221
209
  },
222
210
  "ja": {
223
211
  "cmd.git_log": "Gitログ",
@@ -252,9 +240,7 @@
252
240
  "status.move_to_diff": "カーソルを差分行に移動してください",
253
241
 
254
242
  "panel.commits_header": "コミット:",
255
- "panel.no_commits": " コミットが見つかりません",
256
- "panel.log_footer": "%{count}件のコミット | 上/下/j/k: 移動 | RET: 表示 | y: ハッシュをコピー | r: 更新 | q: 終了",
257
- "panel.detail_footer": "上/下/j/k: 移動 | RET: ファイルを行で開く | q: ログに戻る"
243
+ "panel.no_commits": " コミットが見つかりません"
258
244
  },
259
245
  "ko": {
260
246
  "cmd.git_log": "Git 로그",
@@ -289,9 +275,7 @@
289
275
  "status.move_to_diff": "커서를 diff 줄로 이동하세요",
290
276
 
291
277
  "panel.commits_header": "커밋:",
292
- "panel.no_commits": " 커밋을 찾을 수 없습니다",
293
- "panel.log_footer": "%{count}개 커밋 | 위/아래/j/k: 탐색 | RET: 표시 | y: 해시 복사 | r: 새로고침 | q: 종료",
294
- "panel.detail_footer": "위/아래/j/k: 탐색 | RET: 해당 줄에서 파일 열기 | q: 로그로 돌아가기"
278
+ "panel.no_commits": " 커밋을 찾을 수 없습니다"
295
279
  },
296
280
  "pt-BR": {
297
281
  "cmd.git_log": "Git Log",
@@ -326,9 +310,7 @@
326
310
  "status.move_to_diff": "Mova o cursor para uma linha de diff",
327
311
 
328
312
  "panel.commits_header": "Commits:",
329
- "panel.no_commits": " Nenhum commit encontrado",
330
- "panel.log_footer": "%{count} commits | Cima/Baixo/j/k: navegar | RET: mostrar | y: copiar hash | r: atualizar | q: sair",
331
- "panel.detail_footer": "Cima/Baixo/j/k: navegar | RET: abrir arquivo na linha | q: voltar ao log"
313
+ "panel.no_commits": " Nenhum commit encontrado"
332
314
  },
333
315
  "ru": {
334
316
  "cmd.git_log": "Git Log",
@@ -363,9 +345,7 @@
363
345
  "status.move_to_diff": "Peremesstite kursor na stroku diff",
364
346
 
365
347
  "panel.commits_header": "Kommity:",
366
- "panel.no_commits": " Kommity ne naydeny",
367
- "panel.log_footer": "%{count} kommitov | Vverkh/Vniz/j/k: navigatsiya | RET: pokazat' | y: kopirovat' khesh | r: obnovit' | q: vyyti",
368
- "panel.detail_footer": "Vverkh/Vniz/j/k: navigatsiya | RET: otkryt' fayl na stroke | q: nazad k logu"
348
+ "panel.no_commits": " Kommity ne naydeny"
369
349
  },
370
350
  "th": {
371
351
  "cmd.git_log": "Git Log",
@@ -400,9 +380,7 @@
400
380
  "status.move_to_diff": "เลื่อนเคอร์เซอร์ไปที่บรรทัด diff",
401
381
 
402
382
  "panel.commits_header": "คอมมิต:",
403
- "panel.no_commits": " ไม่พบคอมมิต",
404
- "panel.log_footer": "%{count} คอมมิต | ขึ้น/ลง/j/k: นำทาง | RET: แสดง | y: คัดลอกแฮช | r: รีเฟรช | q: ออก",
405
- "panel.detail_footer": "ขึ้น/ลง/j/k: นำทาง | RET: เปิดไฟล์ที่บรรทัด | q: กลับไปที่ log"
383
+ "panel.no_commits": " ไม่พบคอมมิต"
406
384
  },
407
385
  "uk": {
408
386
  "cmd.git_log": "Git Log",
@@ -437,9 +415,7 @@
437
415
  "status.move_to_diff": "Peremistit' kursor na ryadok diff",
438
416
 
439
417
  "panel.commits_header": "Komity:",
440
- "panel.no_commits": " Komity ne znaydeno",
441
- "panel.log_footer": "%{count} komitiv | Vhoru/Vnyz/j/k: navihatsiya | RET: pokazaty | y: kopiyuvaty khesh | r: onovyty | q: vyyty",
442
- "panel.detail_footer": "Vhoru/Vnyz/j/k: navihatsiya | RET: vidkryty fayl na ryadku | q: nazad do lohu"
418
+ "panel.no_commits": " Komity ne znaydeno"
443
419
  },
444
420
  "vi": {
445
421
  "cmd.git_log": "Git Log",
@@ -474,9 +450,7 @@
474
450
  "status.move_to_diff": "Di chuyển con trỏ đến dòng diff",
475
451
 
476
452
  "panel.commits_header": "Commit:",
477
- "panel.no_commits": " Không tìm thấy commit",
478
- "panel.log_footer": "%{count} commit | Lên/Xuống/j/k: điều hướng | RET: hiển thị | y: sao chép hash | r: làm mới | q: thoát",
479
- "panel.detail_footer": "Lên/Xuống/j/k: điều hướng | RET: mở tệp tại dòng | q: quay lại log"
453
+ "panel.no_commits": " Không tìm thấy commit"
480
454
  },
481
455
  "zh-CN": {
482
456
  "cmd.git_log": "Git日志",
@@ -511,8 +485,6 @@
511
485
  "status.move_to_diff": "请将光标移动到差异行",
512
486
 
513
487
  "panel.commits_header": "提交:",
514
- "panel.no_commits": " 未找到提交",
515
- "panel.log_footer": "%{count}个提交 | 上/下/j/k: 导航 | RET: 显示 | y: 复制哈希 | r: 刷新 | q: 退出",
516
- "panel.detail_footer": "上/下/j/k: 导航 | RET: 在行处打开文件 | q: 返回日志"
488
+ "panel.no_commits": " 未找到提交"
517
489
  }
518
490
  }
@@ -488,10 +488,10 @@ async function show_git_log(): Promise<void> {
488
488
  if (state.groupId !== null) {
489
489
  editor.focusBufferGroupPanel(state.groupId, "log");
490
490
  }
491
- editor.on("cursor_moved", "on_git_log_cursor_moved");
492
- editor.on("mouse_click", "on_git_log_toolbar_click");
493
- editor.on("resize", "on_git_log_resize");
494
- editor.on("buffer_closed", "on_git_log_buffer_closed");
491
+ editor.on("cursor_moved", on_git_log_cursor_moved);
492
+ editor.on("mouse_click", on_git_log_toolbar_click);
493
+ editor.on("resize", on_git_log_resize);
494
+ editor.on("buffer_closed", on_git_log_buffer_closed);
495
495
 
496
496
  editor.setStatus(
497
497
  editor.t("status.log_ready", { count: String(state.commits.length) })
@@ -504,10 +504,10 @@ registerHandler("show_git_log", show_git_log);
504
504
  * close button, which triggers `buffer_closed`). */
505
505
  function git_log_cleanup(): void {
506
506
  if (!state.isOpen) return;
507
- editor.off("cursor_moved", "on_git_log_cursor_moved");
508
- editor.off("mouse_click", "on_git_log_toolbar_click");
509
- editor.off("resize", "on_git_log_resize");
510
- editor.off("buffer_closed", "on_git_log_buffer_closed");
507
+ editor.off("cursor_moved", on_git_log_cursor_moved);
508
+ editor.off("mouse_click", on_git_log_toolbar_click);
509
+ editor.off("resize", on_git_log_resize);
510
+ editor.off("buffer_closed", on_git_log_buffer_closed);
511
511
  state.isOpen = false;
512
512
  state.groupId = null;
513
513
  state.logBufferId = null;
@@ -686,13 +686,23 @@ async function git_log_detail_open_file(): Promise<void> {
686
686
  registerHandler("git_log_detail_open_file", git_log_detail_open_file);
687
687
 
688
688
  // File-view mode so `q` closes the tab and returns to the group.
689
+ //
690
+ // j/k alias Up/Down as in the main git-log mode, and we inherit Normal
691
+ // bindings so arrows, PageUp/Down, Home/End, Ctrl+C copy, etc. still work
692
+ // in this read-only buffer — without `inheritNormalBindings`, unbound keys
693
+ // in a read-only mode fall through to the edit actions and trip the
694
+ // `editing_disabled` status message (see #566).
689
695
  editor.defineMode(
690
696
  "git-log-file-view",
691
697
  [
698
+ ["k", "move_up"],
699
+ ["j", "move_down"],
692
700
  ["q", "git_log_file_view_close"],
693
701
  ["Escape", "git_log_file_view_close"],
694
702
  ],
695
- true
703
+ true, // read-only
704
+ false, // allow_text_input
705
+ true, // inherit Normal-context bindings for unbound keys
696
706
  );
697
707
 
698
708
  function git_log_file_view_close(): void {
@@ -35,7 +35,8 @@ const INSTALL_COMMANDS = {
35
35
 
36
36
  let gleamLspError: { serverCommand: string; message: string } | null = null;
37
37
 
38
- function on_gleam_lsp_server_error(data: LspServerErrorData): void {
38
+
39
+ editor.on("lsp_server_error", (data) => {
39
40
  if (data.language !== "gleam") {
40
41
  return;
41
42
  }
@@ -54,11 +55,10 @@ function on_gleam_lsp_server_error(data: LspServerErrorData): void {
54
55
  } else {
55
56
  editor.setStatus(`Gleam LSP error: ${data.message}`);
56
57
  }
57
- }
58
- registerHandler("on_gleam_lsp_server_error", on_gleam_lsp_server_error);
59
- editor.on("lsp_server_error", "on_gleam_lsp_server_error");
58
+ });
59
+
60
60
 
61
- function on_gleam_lsp_status_clicked(data: LspStatusClickedData): void {
61
+ editor.on("lsp_status_clicked", (data) => {
62
62
  if (data.language !== "gleam" || !gleamLspError) {
63
63
  return;
64
64
  }
@@ -77,11 +77,10 @@ function on_gleam_lsp_status_clicked(data: LspStatusClickedData): void {
77
77
  { id: "dismiss", label: "Dismiss (ESC)" },
78
78
  ],
79
79
  });
80
- }
81
- registerHandler("on_gleam_lsp_status_clicked", on_gleam_lsp_status_clicked);
82
- editor.on("lsp_status_clicked", "on_gleam_lsp_status_clicked");
80
+ });
81
+
83
82
 
84
- function on_gleam_lsp_action_result(data: ActionPopupResultData): void {
83
+ editor.on("action_popup_result", (data) => {
85
84
  if (data.popup_id !== "gleam-lsp-help") {
86
85
  return;
87
86
  }
@@ -117,8 +116,6 @@ function on_gleam_lsp_action_result(data: ActionPopupResultData): void {
117
116
  default:
118
117
  editor.debug(`gleam-lsp: Unknown action: ${data.action_id}`);
119
118
  }
120
- }
121
- registerHandler("on_gleam_lsp_action_result", on_gleam_lsp_action_result);
122
- editor.on("action_popup_result", "on_gleam_lsp_action_result");
119
+ });
123
120
 
124
121
  editor.debug("gleam-lsp: Plugin loaded");
package/plugins/go-lsp.ts CHANGED
@@ -46,7 +46,10 @@ let goLspError: { serverCommand: string; message: string } | null = null;
46
46
  /**
47
47
  * Handle LSP server errors for Go
48
48
  */
49
- function on_go_lsp_server_error(data: LspServerErrorData) : void {
49
+
50
+
51
+ // Register hook for LSP server errors
52
+ editor.on("lsp_server_error", (data) => {
50
53
  // Only handle Go language errors
51
54
  if (data.language !== "go") {
52
55
  return;
@@ -68,18 +71,15 @@ function on_go_lsp_server_error(data: LspServerErrorData) : void {
68
71
  } else {
69
72
  editor.setStatus(`Go LSP error: ${data.message}`);
70
73
  }
71
- }
72
- registerHandler("on_go_lsp_server_error", on_go_lsp_server_error);
73
-
74
- // Register hook for LSP server errors
75
- editor.on("lsp_server_error", "on_go_lsp_server_error");
74
+ });
76
75
 
77
76
  /**
78
77
  * Handle status bar click when there's a Go LSP error
79
78
  */
80
- function on_go_lsp_status_clicked(
81
- data: LspStatusClickedData
82
- ): void {
79
+
80
+
81
+ // Register hook for status bar clicks
82
+ editor.on("lsp_status_clicked", (data) => {
83
83
  // Only handle Go language clicks when there's an error
84
84
  if (data.language !== "go" || !goLspError) {
85
85
  return;
@@ -98,18 +98,15 @@ function on_go_lsp_status_clicked(
98
98
  { id: "dismiss", label: "Dismiss (ESC)" },
99
99
  ],
100
100
  });
101
- }
102
- registerHandler("on_go_lsp_status_clicked", on_go_lsp_status_clicked);
103
-
104
- // Register hook for status bar clicks
105
- editor.on("lsp_status_clicked", "on_go_lsp_status_clicked");
101
+ });
106
102
 
107
103
  /**
108
104
  * Handle action popup results for Go LSP help
109
105
  */
110
- function on_go_lsp_action_result(
111
- data: ActionPopupResultData
112
- ): void {
106
+
107
+
108
+ // Register hook for action popup results
109
+ editor.on("action_popup_result", (data) => {
113
110
  // Only handle our popup
114
111
  if (data.popup_id !== "go-lsp-help") {
115
112
  return;
@@ -137,10 +134,6 @@ function on_go_lsp_action_result(
137
134
  default:
138
135
  editor.debug(`go-lsp: Unknown action: ${data.action_id}`);
139
136
  }
140
- }
141
- registerHandler("on_go_lsp_action_result", on_go_lsp_action_result);
142
-
143
- // Register hook for action popup results
144
- editor.on("action_popup_result", "on_go_lsp_action_result");
137
+ });
145
138
 
146
139
  editor.debug("go-lsp: Plugin loaded");
@@ -50,7 +50,8 @@ let graphqlLspError: { serverCommand: string; message: string } | null = null;
50
50
  /**
51
51
  * Handle LSP server errors for GraphQL
52
52
  */
53
- function on_graphql_lsp_server_error(data: LspServerErrorData): void {
53
+
54
+ editor.on("lsp_server_error", (data) => {
54
55
  if (data.language !== "graphql") {
55
56
  return;
56
57
  }
@@ -69,14 +70,13 @@ function on_graphql_lsp_server_error(data: LspServerErrorData): void {
69
70
  } else {
70
71
  editor.setStatus(`GraphQL LSP error: ${data.message}`);
71
72
  }
72
- }
73
- registerHandler("on_graphql_lsp_server_error", on_graphql_lsp_server_error);
74
- editor.on("lsp_server_error", "on_graphql_lsp_server_error");
73
+ });
75
74
 
76
75
  /**
77
76
  * Handle status bar click when there's a GraphQL LSP error
78
77
  */
79
- function on_graphql_lsp_status_clicked(data: LspStatusClickedData): void {
78
+
79
+ editor.on("lsp_status_clicked", (data) => {
80
80
  if (data.language !== "graphql" || !graphqlLspError) {
81
81
  return;
82
82
  }
@@ -94,14 +94,13 @@ function on_graphql_lsp_status_clicked(data: LspStatusClickedData): void {
94
94
  { id: "dismiss", label: "Dismiss (ESC)" },
95
95
  ],
96
96
  });
97
- }
98
- registerHandler("on_graphql_lsp_status_clicked", on_graphql_lsp_status_clicked);
99
- editor.on("lsp_status_clicked", "on_graphql_lsp_status_clicked");
97
+ });
100
98
 
101
99
  /**
102
100
  * Handle action popup results for GraphQL LSP help
103
101
  */
104
- function on_graphql_lsp_action_result(data: ActionPopupResultData): void {
102
+
103
+ editor.on("action_popup_result", (data) => {
105
104
  if (data.popup_id !== "graphql-lsp-help") {
106
105
  return;
107
106
  }
@@ -132,8 +131,6 @@ function on_graphql_lsp_action_result(data: ActionPopupResultData): void {
132
131
  default:
133
132
  editor.debug(`graphql-lsp: Unknown action: ${data.action_id}`);
134
133
  }
135
- }
136
- registerHandler("on_graphql_lsp_action_result", on_graphql_lsp_action_result);
137
- editor.on("action_popup_result", "on_graphql_lsp_action_result");
134
+ });
138
135
 
139
136
  editor.debug("graphql-lsp: Plugin loaded");
@@ -36,7 +36,8 @@ const INSTALL_COMMANDS = {
36
36
 
37
37
  let haskellLspError: { serverCommand: string; message: string } | null = null;
38
38
 
39
- function on_haskell_lsp_server_error(data: LspServerErrorData): void {
39
+
40
+ editor.on("lsp_server_error", (data) => {
40
41
  if (data.language !== "haskell") {
41
42
  return;
42
43
  }
@@ -55,11 +56,10 @@ function on_haskell_lsp_server_error(data: LspServerErrorData): void {
55
56
  } else {
56
57
  editor.setStatus(`Haskell LSP error: ${data.message}`);
57
58
  }
58
- }
59
- registerHandler("on_haskell_lsp_server_error", on_haskell_lsp_server_error);
60
- editor.on("lsp_server_error", "on_haskell_lsp_server_error");
59
+ });
60
+
61
61
 
62
- function on_haskell_lsp_status_clicked(data: LspStatusClickedData): void {
62
+ editor.on("lsp_status_clicked", (data) => {
63
63
  if (data.language !== "haskell" || !haskellLspError) {
64
64
  return;
65
65
  }
@@ -78,11 +78,10 @@ function on_haskell_lsp_status_clicked(data: LspStatusClickedData): void {
78
78
  { id: "dismiss", label: "Dismiss (ESC)" },
79
79
  ],
80
80
  });
81
- }
82
- registerHandler("on_haskell_lsp_status_clicked", on_haskell_lsp_status_clicked);
83
- editor.on("lsp_status_clicked", "on_haskell_lsp_status_clicked");
81
+ });
82
+
84
83
 
85
- function on_haskell_lsp_action_result(data: ActionPopupResultData): void {
84
+ editor.on("action_popup_result", (data) => {
86
85
  if (data.popup_id !== "haskell-lsp-help") {
87
86
  return;
88
87
  }
@@ -118,8 +117,6 @@ function on_haskell_lsp_action_result(data: ActionPopupResultData): void {
118
117
  default:
119
118
  editor.debug(`haskell-lsp: Unknown action: ${data.action_id}`);
120
119
  }
121
- }
122
- registerHandler("on_haskell_lsp_action_result", on_haskell_lsp_action_result);
123
- editor.on("action_popup_result", "on_haskell_lsp_action_result");
120
+ });
124
121
 
125
122
  editor.debug("haskell-lsp: Plugin loaded");
@@ -46,9 +46,10 @@ let htmlLspError: { serverCommand: string; message: string } | null = null;
46
46
  /**
47
47
  * Handle LSP server errors for HTML
48
48
  */
49
- function on_html_lsp_server_error(
50
- data: LspServerErrorData
51
- ): void {
49
+
50
+
51
+ // Register hook for LSP server errors
52
+ editor.on("lsp_server_error", (data) => {
52
53
  // Only handle HTML language errors
53
54
  if (data.language !== "html") {
54
55
  return;
@@ -70,18 +71,15 @@ function on_html_lsp_server_error(
70
71
  } else {
71
72
  editor.setStatus(`HTML LSP error: ${data.message}`);
72
73
  }
73
- }
74
- registerHandler("on_html_lsp_server_error", on_html_lsp_server_error);
75
-
76
- // Register hook for LSP server errors
77
- editor.on("lsp_server_error", "on_html_lsp_server_error");
74
+ });
78
75
 
79
76
  /**
80
77
  * Handle status bar click when there's an HTML LSP error
81
78
  */
82
- function on_html_lsp_status_clicked(
83
- data: LspStatusClickedData
84
- ): void {
79
+
80
+
81
+ // Register hook for status bar clicks
82
+ editor.on("lsp_status_clicked", (data) => {
85
83
  // Only handle HTML language clicks when there's an error
86
84
  if (data.language !== "html" || !htmlLspError) {
87
85
  return;
@@ -100,18 +98,15 @@ function on_html_lsp_status_clicked(
100
98
  { id: "dismiss", label: "Dismiss (ESC)" },
101
99
  ],
102
100
  });
103
- }
104
- registerHandler("on_html_lsp_status_clicked", on_html_lsp_status_clicked);
105
-
106
- // Register hook for status bar clicks
107
- editor.on("lsp_status_clicked", "on_html_lsp_status_clicked");
101
+ });
108
102
 
109
103
  /**
110
104
  * Handle action popup results for HTML LSP help
111
105
  */
112
- function on_html_lsp_action_result(
113
- data: ActionPopupResultData
114
- ): void {
106
+
107
+
108
+ // Register hook for action popup results
109
+ editor.on("action_popup_result", (data) => {
115
110
  // Only handle our popup
116
111
  if (data.popup_id !== "html-lsp-help") {
117
112
  return;
@@ -139,10 +134,6 @@ function on_html_lsp_action_result(
139
134
  default:
140
135
  editor.debug(`html-lsp: Unknown action: ${data.action_id}`);
141
136
  }
142
- }
143
- registerHandler("on_html_lsp_action_result", on_html_lsp_action_result);
144
-
145
- // Register hook for action popup results
146
- editor.on("action_popup_result", "on_html_lsp_action_result");
137
+ });
147
138
 
148
139
  editor.debug("html-lsp: Plugin loaded");