@fresh-editor/fresh-editor 0.3.0 → 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 (76) hide show
  1. package/CHANGELOG.md +66 -2
  2. package/package.json +1 -1
  3. package/plugins/astro-lsp.ts +6 -12
  4. package/plugins/audit_mode.ts +106 -113
  5. package/plugins/bash-lsp.ts +15 -22
  6. package/plugins/clangd-lsp.ts +15 -24
  7. package/plugins/clojure-lsp.ts +9 -12
  8. package/plugins/cmake-lsp.ts +9 -12
  9. package/plugins/code-tour.ts +15 -16
  10. package/plugins/config-schema.json +10 -0
  11. package/plugins/csharp_support.ts +25 -30
  12. package/plugins/css-lsp.ts +15 -22
  13. package/plugins/dart-lsp.ts +9 -12
  14. package/plugins/dashboard.ts +118 -0
  15. package/plugins/devcontainer.i18n.json +84 -28
  16. package/plugins/devcontainer.ts +897 -170
  17. package/plugins/diagnostics_panel.ts +10 -17
  18. package/plugins/elixir-lsp.ts +9 -12
  19. package/plugins/erlang-lsp.ts +9 -12
  20. package/plugins/examples/bookmarks.ts +10 -16
  21. package/plugins/find_references.ts +5 -9
  22. package/plugins/flash.ts +577 -0
  23. package/plugins/fsharp-lsp.ts +9 -12
  24. package/plugins/git_explorer.ts +16 -20
  25. package/plugins/git_gutter.ts +65 -79
  26. package/plugins/git_log.ts +8 -8
  27. package/plugins/gleam-lsp.ts +9 -12
  28. package/plugins/go-lsp.ts +15 -22
  29. package/plugins/graphql-lsp.ts +9 -12
  30. package/plugins/haskell-lsp.ts +9 -12
  31. package/plugins/html-lsp.ts +15 -24
  32. package/plugins/java-lsp.ts +9 -12
  33. package/plugins/json-lsp.ts +15 -24
  34. package/plugins/julia-lsp.ts +9 -12
  35. package/plugins/kotlin-lsp.ts +15 -22
  36. package/plugins/latex-lsp.ts +9 -12
  37. package/plugins/lib/fresh.d.ts +378 -0
  38. package/plugins/lua-lsp.ts +15 -22
  39. package/plugins/markdown_compose.ts +78 -122
  40. package/plugins/markdown_source.ts +8 -10
  41. package/plugins/marksman-lsp.ts +9 -12
  42. package/plugins/merge_conflict.ts +15 -17
  43. package/plugins/nim-lsp.ts +9 -12
  44. package/plugins/nix-lsp.ts +9 -12
  45. package/plugins/nushell-lsp.ts +9 -12
  46. package/plugins/ocaml-lsp.ts +9 -12
  47. package/plugins/odin-lsp.ts +15 -22
  48. package/plugins/path_complete.ts +5 -6
  49. package/plugins/perl-lsp.ts +9 -12
  50. package/plugins/php-lsp.ts +15 -22
  51. package/plugins/pkg.ts +10 -21
  52. package/plugins/protobuf-lsp.ts +9 -12
  53. package/plugins/python-lsp.ts +15 -24
  54. package/plugins/r-lsp.ts +9 -12
  55. package/plugins/ruby-lsp.ts +15 -22
  56. package/plugins/rust-lsp.ts +18 -28
  57. package/plugins/scala-lsp.ts +9 -12
  58. package/plugins/schemas/theme.schema.json +18 -0
  59. package/plugins/search_replace.ts +10 -13
  60. package/plugins/solidity-lsp.ts +9 -12
  61. package/plugins/sql-lsp.ts +9 -12
  62. package/plugins/svelte-lsp.ts +9 -12
  63. package/plugins/swift-lsp.ts +9 -12
  64. package/plugins/tailwindcss-lsp.ts +9 -12
  65. package/plugins/templ-lsp.ts +9 -12
  66. package/plugins/terraform-lsp.ts +9 -12
  67. package/plugins/theme_editor.i18n.json +70 -14
  68. package/plugins/theme_editor.ts +152 -208
  69. package/plugins/toml-lsp.ts +15 -22
  70. package/plugins/tsconfig.json +100 -0
  71. package/plugins/typescript-lsp.ts +15 -24
  72. package/plugins/typst-lsp.ts +15 -22
  73. package/plugins/vi_mode.ts +77 -290
  74. package/plugins/vue-lsp.ts +9 -12
  75. package/plugins/yaml-lsp.ts +15 -22
  76. package/plugins/zig-lsp.ts +9 -12
@@ -212,20 +212,18 @@ registerHandler("toggle_diagnostics_panel", toggle_diagnostics_panel);
212
212
  // Event Handlers
213
213
 
214
214
  // When diagnostics update, notify the provider
215
- function on_diagnostics_updated(_data: {
216
- uri: string;
217
- count: number;
218
- }): void {
215
+
216
+
217
+ // When a different buffer becomes active, update filter context
218
+
219
+
220
+ // Register event handlers
221
+ editor.on("diagnostics_updated", (_data) => {
219
222
  if (isOpen) {
220
223
  provider.notify();
221
224
  }
222
- }
223
- registerHandler("on_diagnostics_updated", on_diagnostics_updated);
224
-
225
- // When a different buffer becomes active, update filter context
226
- function on_diagnostics_buffer_activated(data: {
227
- buffer_id: number;
228
- }): void {
225
+ });
226
+ editor.on("buffer_activated", (data) => {
229
227
  if (!isOpen) return;
230
228
 
231
229
  // Skip virtual buffers (e.g. the diagnostics panel itself) — they have no
@@ -241,12 +239,7 @@ function on_diagnostics_buffer_activated(data: {
241
239
  provider.notify();
242
240
  finder.updateTitle(getTitle());
243
241
  }
244
- }
245
- registerHandler("on_diagnostics_buffer_activated", on_diagnostics_buffer_activated);
246
-
247
- // Register event handlers
248
- editor.on("diagnostics_updated", "on_diagnostics_updated");
249
- editor.on("buffer_activated", "on_diagnostics_buffer_activated");
242
+ });
250
243
 
251
244
  // Command Registration
252
245
  editor.registerCommand(
@@ -37,7 +37,8 @@ const INSTALL_COMMANDS = {
37
37
 
38
38
  let elixirLspError: { serverCommand: string; message: string } | null = null;
39
39
 
40
- function on_elixir_lsp_server_error(data: LspServerErrorData): void {
40
+
41
+ editor.on("lsp_server_error", (data) => {
41
42
  if (data.language !== "elixir") {
42
43
  return;
43
44
  }
@@ -56,11 +57,10 @@ function on_elixir_lsp_server_error(data: LspServerErrorData): void {
56
57
  } else {
57
58
  editor.setStatus(`Elixir LSP error: ${data.message}`);
58
59
  }
59
- }
60
- registerHandler("on_elixir_lsp_server_error", on_elixir_lsp_server_error);
61
- editor.on("lsp_server_error", "on_elixir_lsp_server_error");
60
+ });
61
+
62
62
 
63
- function on_elixir_lsp_status_clicked(data: LspStatusClickedData): void {
63
+ editor.on("lsp_status_clicked", (data) => {
64
64
  if (data.language !== "elixir" || !elixirLspError) {
65
65
  return;
66
66
  }
@@ -78,11 +78,10 @@ function on_elixir_lsp_status_clicked(data: LspStatusClickedData): void {
78
78
  { id: "dismiss", label: "Dismiss (ESC)" },
79
79
  ],
80
80
  });
81
- }
82
- registerHandler("on_elixir_lsp_status_clicked", on_elixir_lsp_status_clicked);
83
- editor.on("lsp_status_clicked", "on_elixir_lsp_status_clicked");
81
+ });
82
+
84
83
 
85
- function on_elixir_lsp_action_result(data: ActionPopupResultData): void {
84
+ editor.on("action_popup_result", (data) => {
86
85
  if (data.popup_id !== "elixir-lsp-help") {
87
86
  return;
88
87
  }
@@ -113,8 +112,6 @@ function on_elixir_lsp_action_result(data: ActionPopupResultData): void {
113
112
  default:
114
113
  editor.debug(`elixir-lsp: Unknown action: ${data.action_id}`);
115
114
  }
116
- }
117
- registerHandler("on_elixir_lsp_action_result", on_elixir_lsp_action_result);
118
- editor.on("action_popup_result", "on_elixir_lsp_action_result");
115
+ });
119
116
 
120
117
  editor.debug("elixir-lsp: Plugin loaded");
@@ -38,7 +38,8 @@ const INSTALL_COMMANDS = {
38
38
 
39
39
  let erlangLspError: { serverCommand: string; message: string } | null = null;
40
40
 
41
- function on_erlang_lsp_server_error(data: LspServerErrorData): void {
41
+
42
+ editor.on("lsp_server_error", (data) => {
42
43
  if (data.language !== "erlang") {
43
44
  return;
44
45
  }
@@ -57,11 +58,10 @@ function on_erlang_lsp_server_error(data: LspServerErrorData): void {
57
58
  } else {
58
59
  editor.setStatus(`Erlang LSP error: ${data.message}`);
59
60
  }
60
- }
61
- registerHandler("on_erlang_lsp_server_error", on_erlang_lsp_server_error);
62
- editor.on("lsp_server_error", "on_erlang_lsp_server_error");
61
+ });
62
+
63
63
 
64
- function on_erlang_lsp_status_clicked(data: LspStatusClickedData): void {
64
+ editor.on("lsp_status_clicked", (data) => {
65
65
  if (data.language !== "erlang" || !erlangLspError) {
66
66
  return;
67
67
  }
@@ -79,11 +79,10 @@ function on_erlang_lsp_status_clicked(data: LspStatusClickedData): void {
79
79
  { id: "dismiss", label: "Dismiss (ESC)" },
80
80
  ],
81
81
  });
82
- }
83
- registerHandler("on_erlang_lsp_status_clicked", on_erlang_lsp_status_clicked);
84
- editor.on("lsp_status_clicked", "on_erlang_lsp_status_clicked");
82
+ });
83
+
85
84
 
86
- function on_erlang_lsp_action_result(data: ActionPopupResultData): void {
85
+ editor.on("action_popup_result", (data) => {
87
86
  if (data.popup_id !== "erlang-lsp-help") {
88
87
  return;
89
88
  }
@@ -114,8 +113,6 @@ function on_erlang_lsp_action_result(data: ActionPopupResultData): void {
114
113
  default:
115
114
  editor.debug(`erlang-lsp: Unknown action: ${data.action_id}`);
116
115
  }
117
- }
118
- registerHandler("on_erlang_lsp_action_result", on_erlang_lsp_action_result);
119
- editor.on("action_popup_result", "on_erlang_lsp_action_result");
116
+ });
120
117
 
121
118
  editor.debug("erlang-lsp: Plugin loaded");
@@ -237,11 +237,13 @@ function bookmark_select() : void {
237
237
  registerHandler("bookmark_select", bookmark_select);
238
238
 
239
239
  // Handle bookmark selection confirmation
240
- function onBookmarkSelectConfirmed(args: {
241
- prompt_type: string;
242
- selected_index: number | null;
243
- input: string;
244
- }): boolean {
240
+
241
+
242
+ // Handle bookmark selection cancellation
243
+
244
+
245
+ // Register bookmark event handlers
246
+ editor.on("prompt_confirmed", (args) => {
245
247
  if (args.prompt_type !== "bookmark-select") {
246
248
  return true;
247
249
  }
@@ -259,23 +261,15 @@ function onBookmarkSelectConfirmed(args: {
259
261
  }
260
262
 
261
263
  return true;
262
- }
263
- registerHandler("onBookmarkSelectConfirmed", onBookmarkSelectConfirmed);
264
-
265
- // Handle bookmark selection cancellation
266
- function onBookmarkSelectCancelled(args: { prompt_type: string }) : boolean {
264
+ });
265
+ editor.on("prompt_cancelled", (args) => {
267
266
  if (args.prompt_type !== "bookmark-select") {
268
267
  return true;
269
268
  }
270
269
 
271
270
  editor.setStatus("Bookmark selection cancelled");
272
271
  return true;
273
- }
274
- registerHandler("onBookmarkSelectCancelled", onBookmarkSelectCancelled);
275
-
276
- // Register bookmark event handlers
277
- editor.on("prompt_confirmed", "onBookmarkSelectConfirmed");
278
- editor.on("prompt_cancelled", "onBookmarkSelectCancelled");
272
+ });
279
273
 
280
274
  // Register commands on plugin load
281
275
  editor.registerCommand(
@@ -80,10 +80,10 @@ async function loadLineContent(
80
80
  }
81
81
 
82
82
  // Handle lsp_references hook
83
- async function on_lsp_references(data: {
84
- symbol: string;
85
- locations: ReferenceLocation[];
86
- }): Promise<void> {
83
+
84
+
85
+ // Register the hook handler
86
+ editor.on("lsp_references", async (data) => {
87
87
  editor.debug(
88
88
  `Received ${data.locations.length} references for '${data.symbol}'`
89
89
  );
@@ -104,11 +104,7 @@ async function on_lsp_references(data: {
104
104
  load: async () => pendingRefs,
105
105
  },
106
106
  });
107
- }
108
- registerHandler("on_lsp_references", on_lsp_references);
109
-
110
- // Register the hook handler
111
- editor.on("lsp_references", "on_lsp_references");
107
+ });
112
108
 
113
109
  // Close function for command palette
114
110
  function close_references() : void {