@fresh-editor/fresh-editor 0.2.12 → 0.2.13
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.
- package/CHANGELOG.md +60 -0
- package/README.md +10 -0
- package/package.json +1 -1
- package/plugins/audit_mode.ts +79 -58
- package/plugins/check-types.sh +1 -0
- package/plugins/clangd-lsp.ts +9 -6
- package/plugins/clangd_support.ts +12 -8
- package/plugins/code-tour.ts +15 -10
- package/plugins/config-schema.json +40 -3
- package/plugins/csharp_support.ts +15 -10
- package/plugins/css-lsp.ts +9 -6
- package/plugins/diagnostics_panel.ts +25 -18
- package/plugins/examples/README.md +1 -2
- package/plugins/examples/async_demo.ts +28 -28
- package/plugins/examples/bookmarks.ts +34 -32
- package/plugins/examples/buffer_query_demo.ts +20 -20
- package/plugins/examples/hello_world.ts +46 -10
- package/plugins/examples/virtual_buffer_demo.ts +16 -12
- package/plugins/find_references.ts +7 -5
- package/plugins/git_blame.ts +13 -9
- package/plugins/git_explorer.ts +9 -6
- package/plugins/git_find_file.ts +7 -5
- package/plugins/git_grep.ts +3 -2
- package/plugins/git_gutter.ts +15 -10
- package/plugins/git_log.ts +27 -18
- package/plugins/go-lsp.ts +9 -6
- package/plugins/html-lsp.ts +9 -6
- package/plugins/java-lsp.ts +9 -6
- package/plugins/json-lsp.ts +9 -6
- package/plugins/latex-lsp.ts +9 -6
- package/plugins/lib/finder.ts +1 -0
- package/plugins/lib/fresh.d.ts +139 -14
- package/plugins/live_grep.ts +3 -2
- package/plugins/markdown_compose.ts +33 -23
- package/plugins/markdown_source.ts +15 -10
- package/plugins/marksman-lsp.ts +9 -6
- package/plugins/merge_conflict.ts +33 -22
- package/plugins/odin-lsp.ts +9 -6
- package/plugins/path_complete.ts +3 -2
- package/plugins/pkg.ts +70 -48
- package/plugins/python-lsp.ts +9 -6
- package/plugins/rust-lsp.ts +102 -6
- package/plugins/search_replace.ts +32 -21
- package/plugins/templ-lsp.ts +9 -6
- package/plugins/test_i18n.ts +3 -2
- package/plugins/theme_editor.i18n.json +28 -14
- package/plugins/theme_editor.ts +1230 -495
- package/plugins/typescript-lsp.ts +9 -6
- package/plugins/vi_mode.ts +487 -297
- package/plugins/welcome.ts +9 -6
- package/plugins/zig-lsp.ts +9 -6
package/plugins/welcome.ts
CHANGED
|
@@ -25,11 +25,12 @@ editor.registerCommand(
|
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
// Register commands with custom TypeScript callbacks
|
|
28
|
-
|
|
28
|
+
function plugin_say_hello() : void {
|
|
29
29
|
editor.insertAtCursor(editor.t("text.greeting") + "\n");
|
|
30
30
|
editor.setStatus(editor.t("status.greeting_inserted"));
|
|
31
31
|
editor.debug("Plugin callback executed: say_hello");
|
|
32
|
-
}
|
|
32
|
+
}
|
|
33
|
+
registerHandler("plugin_say_hello", plugin_say_hello);
|
|
33
34
|
|
|
34
35
|
editor.registerCommand(
|
|
35
36
|
"%cmd.say_hello",
|
|
@@ -38,12 +39,13 @@ editor.registerCommand(
|
|
|
38
39
|
null
|
|
39
40
|
);
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
function plugin_insert_time() : void {
|
|
42
43
|
const time = new Date().toLocaleTimeString();
|
|
43
44
|
editor.insertAtCursor(`Current time: ${time}\n`);
|
|
44
45
|
editor.setStatus(editor.t("status.time_inserted"));
|
|
45
46
|
editor.debug(`Plugin callback executed: insert_time at ${time}`);
|
|
46
|
-
}
|
|
47
|
+
}
|
|
48
|
+
registerHandler("plugin_insert_time", plugin_insert_time);
|
|
47
49
|
|
|
48
50
|
editor.registerCommand(
|
|
49
51
|
"%cmd.insert_time",
|
|
@@ -52,11 +54,12 @@ editor.registerCommand(
|
|
|
52
54
|
null
|
|
53
55
|
);
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
function plugin_insert_comment() : void {
|
|
56
58
|
editor.insertAtCursor(editor.t("text.comment") + "\n");
|
|
57
59
|
editor.setStatus(editor.t("status.comment_inserted"));
|
|
58
60
|
editor.debug("Plugin callback executed: insert_comment");
|
|
59
|
-
}
|
|
61
|
+
}
|
|
62
|
+
registerHandler("plugin_insert_comment", plugin_insert_comment);
|
|
60
63
|
|
|
61
64
|
editor.registerCommand(
|
|
62
65
|
"%cmd.insert_comment",
|
package/plugins/zig-lsp.ts
CHANGED
|
@@ -22,7 +22,7 @@ interface ActionPopupResultData {
|
|
|
22
22
|
const INSTALL_URL = "https://github.com/zigtools/zls#installation";
|
|
23
23
|
let zigLspError: { serverCommand: string; message: string } | null = null;
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
function on_zig_lsp_server_error(data: LspServerErrorData) : void {
|
|
26
26
|
if (data.language !== "zig") return;
|
|
27
27
|
zigLspError = { serverCommand: data.server_command, message: data.message };
|
|
28
28
|
if (data.error_type === "not_found") {
|
|
@@ -30,10 +30,11 @@ globalThis.on_zig_lsp_server_error = function (data: LspServerErrorData): void {
|
|
|
30
30
|
} else {
|
|
31
31
|
editor.setStatus(`Zig LSP error: ${data.message}`);
|
|
32
32
|
}
|
|
33
|
-
}
|
|
33
|
+
}
|
|
34
|
+
registerHandler("on_zig_lsp_server_error", on_zig_lsp_server_error);
|
|
34
35
|
editor.on("lsp_server_error", "on_zig_lsp_server_error");
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
function on_zig_lsp_status_clicked(data: LspStatusClickedData) : void {
|
|
37
38
|
if (data.language !== "zig" || !zigLspError) return;
|
|
38
39
|
editor.showActionPopup({
|
|
39
40
|
id: "zig-lsp-help",
|
|
@@ -45,10 +46,11 @@ globalThis.on_zig_lsp_status_clicked = function (data: LspStatusClickedData): vo
|
|
|
45
46
|
{ id: "dismiss", label: "Dismiss (ESC)" },
|
|
46
47
|
],
|
|
47
48
|
});
|
|
48
|
-
}
|
|
49
|
+
}
|
|
50
|
+
registerHandler("on_zig_lsp_status_clicked", on_zig_lsp_status_clicked);
|
|
49
51
|
editor.on("lsp_status_clicked", "on_zig_lsp_status_clicked");
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
function on_zig_lsp_action_result(data: ActionPopupResultData) : void {
|
|
52
54
|
if (data.popup_id !== "zig-lsp-help") return;
|
|
53
55
|
switch (data.action_id) {
|
|
54
56
|
case "copy_url":
|
|
@@ -61,5 +63,6 @@ globalThis.on_zig_lsp_action_result = function (data: ActionPopupResultData): vo
|
|
|
61
63
|
zigLspError = null;
|
|
62
64
|
break;
|
|
63
65
|
}
|
|
64
|
-
}
|
|
66
|
+
}
|
|
67
|
+
registerHandler("on_zig_lsp_action_result", on_zig_lsp_action_result);
|
|
65
68
|
editor.on("action_popup_result", "on_zig_lsp_action_result");
|