@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
@@ -22,7 +22,8 @@ interface ActionPopupResultData {
22
22
  const INSTALL_URL = "https://github.com/eclipse-jdtls/eclipse.jdt.ls#installation";
23
23
  let javaLspError: { serverCommand: string; message: string } | null = null;
24
24
 
25
- function on_java_lsp_server_error(data: LspServerErrorData) : void {
25
+
26
+ editor.on("lsp_server_error", (data) => {
26
27
  if (data.language !== "java") return;
27
28
  javaLspError = { serverCommand: data.server_command, message: data.message };
28
29
  if (data.error_type === "not_found") {
@@ -30,11 +31,10 @@ function on_java_lsp_server_error(data: LspServerErrorData) : void {
30
31
  } else {
31
32
  editor.setStatus(`Java LSP error: ${data.message}`);
32
33
  }
33
- }
34
- registerHandler("on_java_lsp_server_error", on_java_lsp_server_error);
35
- editor.on("lsp_server_error", "on_java_lsp_server_error");
34
+ });
35
+
36
36
 
37
- function on_java_lsp_status_clicked(data: LspStatusClickedData) : void {
37
+ editor.on("lsp_status_clicked", (data) => {
38
38
  if (data.language !== "java" || !javaLspError) return;
39
39
  editor.showActionPopup({
40
40
  id: "java-lsp-help",
@@ -46,11 +46,10 @@ function on_java_lsp_status_clicked(data: LspStatusClickedData) : void {
46
46
  { id: "dismiss", label: "Dismiss (ESC)" },
47
47
  ],
48
48
  });
49
- }
50
- registerHandler("on_java_lsp_status_clicked", on_java_lsp_status_clicked);
51
- editor.on("lsp_status_clicked", "on_java_lsp_status_clicked");
49
+ });
50
+
52
51
 
53
- function on_java_lsp_action_result(data: ActionPopupResultData) : void {
52
+ editor.on("action_popup_result", (data) => {
54
53
  if (data.popup_id !== "java-lsp-help") return;
55
54
  switch (data.action_id) {
56
55
  case "copy_url":
@@ -63,6 +62,4 @@ function on_java_lsp_action_result(data: ActionPopupResultData) : void {
63
62
  javaLspError = null;
64
63
  break;
65
64
  }
66
- }
67
- registerHandler("on_java_lsp_action_result", on_java_lsp_action_result);
68
- editor.on("action_popup_result", "on_java_lsp_action_result");
65
+ });
@@ -46,9 +46,10 @@ let jsonLspError: { serverCommand: string; message: string } | null = null;
46
46
  /**
47
47
  * Handle LSP server errors for JSON
48
48
  */
49
- function on_json_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 JSON language errors
53
54
  if (data.language !== "json") {
54
55
  return;
@@ -70,18 +71,15 @@ function on_json_lsp_server_error(
70
71
  } else {
71
72
  editor.setStatus(`JSON LSP error: ${data.message}`);
72
73
  }
73
- }
74
- registerHandler("on_json_lsp_server_error", on_json_lsp_server_error);
75
-
76
- // Register hook for LSP server errors
77
- editor.on("lsp_server_error", "on_json_lsp_server_error");
74
+ });
78
75
 
79
76
  /**
80
77
  * Handle status bar click when there's a JSON LSP error
81
78
  */
82
- function on_json_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 JSON language clicks when there's an error
86
84
  if (data.language !== "json" || !jsonLspError) {
87
85
  return;
@@ -100,18 +98,15 @@ function on_json_lsp_status_clicked(
100
98
  { id: "dismiss", label: "Dismiss (ESC)" },
101
99
  ],
102
100
  });
103
- }
104
- registerHandler("on_json_lsp_status_clicked", on_json_lsp_status_clicked);
105
-
106
- // Register hook for status bar clicks
107
- editor.on("lsp_status_clicked", "on_json_lsp_status_clicked");
101
+ });
108
102
 
109
103
  /**
110
104
  * Handle action popup results for JSON LSP help
111
105
  */
112
- function on_json_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 !== "json-lsp-help") {
117
112
  return;
@@ -139,10 +134,6 @@ function on_json_lsp_action_result(
139
134
  default:
140
135
  editor.debug(`json-lsp: Unknown action: ${data.action_id}`);
141
136
  }
142
- }
143
- registerHandler("on_json_lsp_action_result", on_json_lsp_action_result);
144
-
145
- // Register hook for action popup results
146
- editor.on("action_popup_result", "on_json_lsp_action_result");
137
+ });
147
138
 
148
139
  editor.debug("json-lsp: Plugin loaded");
@@ -34,7 +34,8 @@ const INSTALL_COMMANDS = {
34
34
 
35
35
  let juliaLspError: { serverCommand: string; message: string } | null = null;
36
36
 
37
- function on_julia_lsp_server_error(data: LspServerErrorData): void {
37
+
38
+ editor.on("lsp_server_error", (data) => {
38
39
  if (data.language !== "julia") {
39
40
  return;
40
41
  }
@@ -53,11 +54,10 @@ function on_julia_lsp_server_error(data: LspServerErrorData): void {
53
54
  } else {
54
55
  editor.setStatus(`Julia LSP error: ${data.message}`);
55
56
  }
56
- }
57
- registerHandler("on_julia_lsp_server_error", on_julia_lsp_server_error);
58
- editor.on("lsp_server_error", "on_julia_lsp_server_error");
57
+ });
58
+
59
59
 
60
- function on_julia_lsp_status_clicked(data: LspStatusClickedData): void {
60
+ editor.on("lsp_status_clicked", (data) => {
61
61
  if (data.language !== "julia" || !juliaLspError) {
62
62
  return;
63
63
  }
@@ -74,11 +74,10 @@ function on_julia_lsp_status_clicked(data: LspStatusClickedData): void {
74
74
  { id: "dismiss", label: "Dismiss (ESC)" },
75
75
  ],
76
76
  });
77
- }
78
- registerHandler("on_julia_lsp_status_clicked", on_julia_lsp_status_clicked);
79
- editor.on("lsp_status_clicked", "on_julia_lsp_status_clicked");
77
+ });
78
+
80
79
 
81
- function on_julia_lsp_action_result(data: ActionPopupResultData): void {
80
+ editor.on("action_popup_result", (data) => {
82
81
  if (data.popup_id !== "julia-lsp-help") {
83
82
  return;
84
83
  }
@@ -104,8 +103,6 @@ function on_julia_lsp_action_result(data: ActionPopupResultData): void {
104
103
  default:
105
104
  editor.debug(`julia-lsp: Unknown action: ${data.action_id}`);
106
105
  }
107
- }
108
- registerHandler("on_julia_lsp_action_result", on_julia_lsp_action_result);
109
- editor.on("action_popup_result", "on_julia_lsp_action_result");
106
+ });
110
107
 
111
108
  editor.debug("julia-lsp: Plugin loaded");
@@ -50,7 +50,10 @@ let kotlinLspError: { serverCommand: string; message: string } | null = null;
50
50
  /**
51
51
  * Handle LSP server errors for Kotlin
52
52
  */
53
- function on_kotlin_lsp_server_error(data: LspServerErrorData): void {
53
+
54
+
55
+ // Register hook for LSP server errors
56
+ editor.on("lsp_server_error", (data) => {
54
57
  // Only handle Kotlin language errors
55
58
  if (data.language !== "kotlin") {
56
59
  return;
@@ -72,18 +75,15 @@ function on_kotlin_lsp_server_error(data: LspServerErrorData): void {
72
75
  } else {
73
76
  editor.setStatus(`Kotlin LSP error: ${data.message}`);
74
77
  }
75
- }
76
- registerHandler("on_kotlin_lsp_server_error", on_kotlin_lsp_server_error);
77
-
78
- // Register hook for LSP server errors
79
- editor.on("lsp_server_error", "on_kotlin_lsp_server_error");
78
+ });
80
79
 
81
80
  /**
82
81
  * Handle status bar click when there's a Kotlin LSP error
83
82
  */
84
- function on_kotlin_lsp_status_clicked(
85
- data: LspStatusClickedData
86
- ): void {
83
+
84
+
85
+ // Register hook for status bar clicks
86
+ editor.on("lsp_status_clicked", (data) => {
87
87
  // Only handle Kotlin language clicks when there's an error
88
88
  if (data.language !== "kotlin" || !kotlinLspError) {
89
89
  return;
@@ -104,18 +104,15 @@ function on_kotlin_lsp_status_clicked(
104
104
  { id: "dismiss", label: "Dismiss (ESC)" },
105
105
  ],
106
106
  });
107
- }
108
- registerHandler("on_kotlin_lsp_status_clicked", on_kotlin_lsp_status_clicked);
109
-
110
- // Register hook for status bar clicks
111
- editor.on("lsp_status_clicked", "on_kotlin_lsp_status_clicked");
107
+ });
112
108
 
113
109
  /**
114
110
  * Handle action popup results for Kotlin LSP help
115
111
  */
116
- function on_kotlin_lsp_action_result(
117
- data: ActionPopupResultData
118
- ): void {
112
+
113
+
114
+ // Register hook for action popup results
115
+ editor.on("action_popup_result", (data) => {
119
116
  // Only handle our popup
120
117
  if (data.popup_id !== "kotlin-lsp-help") {
121
118
  return;
@@ -153,10 +150,6 @@ function on_kotlin_lsp_action_result(
153
150
  default:
154
151
  editor.debug(`kotlin-lsp: Unknown action: ${data.action_id}`);
155
152
  }
156
- }
157
- registerHandler("on_kotlin_lsp_action_result", on_kotlin_lsp_action_result);
158
-
159
- // Register hook for action popup results
160
- editor.on("action_popup_result", "on_kotlin_lsp_action_result");
153
+ });
161
154
 
162
155
  editor.debug("kotlin-lsp: Plugin loaded");
@@ -22,7 +22,8 @@ interface ActionPopupResultData {
22
22
  const INSTALL_URL = "https://github.com/latex-lsp/texlab#installation";
23
23
  let latexLspError: { serverCommand: string; message: string } | null = null;
24
24
 
25
- function on_latex_lsp_server_error(data: LspServerErrorData) : void {
25
+
26
+ editor.on("lsp_server_error", (data) => {
26
27
  if (data.language !== "latex") return;
27
28
  latexLspError = { serverCommand: data.server_command, message: data.message };
28
29
  if (data.error_type === "not_found") {
@@ -30,11 +31,10 @@ function on_latex_lsp_server_error(data: LspServerErrorData) : void {
30
31
  } else {
31
32
  editor.setStatus(`LaTeX LSP error: ${data.message}`);
32
33
  }
33
- }
34
- registerHandler("on_latex_lsp_server_error", on_latex_lsp_server_error);
35
- editor.on("lsp_server_error", "on_latex_lsp_server_error");
34
+ });
35
+
36
36
 
37
- function on_latex_lsp_status_clicked(data: LspStatusClickedData) : void {
37
+ editor.on("lsp_status_clicked", (data) => {
38
38
  if (data.language !== "latex" || !latexLspError) return;
39
39
  editor.showActionPopup({
40
40
  id: "latex-lsp-help",
@@ -46,11 +46,10 @@ function on_latex_lsp_status_clicked(data: LspStatusClickedData) : void {
46
46
  { id: "dismiss", label: "Dismiss (ESC)" },
47
47
  ],
48
48
  });
49
- }
50
- registerHandler("on_latex_lsp_status_clicked", on_latex_lsp_status_clicked);
51
- editor.on("lsp_status_clicked", "on_latex_lsp_status_clicked");
49
+ });
50
+
52
51
 
53
- function on_latex_lsp_action_result(data: ActionPopupResultData) : void {
52
+ editor.on("action_popup_result", (data) => {
54
53
  if (data.popup_id !== "latex-lsp-help") return;
55
54
  switch (data.action_id) {
56
55
  case "copy_url":
@@ -63,6 +62,4 @@ function on_latex_lsp_action_result(data: ActionPopupResultData) : void {
63
62
  latexLspError = null;
64
63
  break;
65
64
  }
66
- }
67
- registerHandler("on_latex_lsp_action_result", on_latex_lsp_action_result);
68
- editor.on("action_popup_result", "on_latex_lsp_action_result");
65
+ });