@fresh-editor/fresh-editor 0.1.86 → 0.1.88
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 +47 -0
- package/README.md +4 -0
- package/package.json +1 -1
- package/plugins/README.md +1 -0
- package/plugins/audit_mode.ts +38 -34
- package/plugins/calculator.i18n.json +13 -13
- package/plugins/calculator.ts +6 -6
- package/plugins/clangd_support.i18n.json +26 -26
- package/plugins/config-schema.json +180 -116
- package/plugins/csharp_support.i18n.json +52 -52
- package/plugins/csharp_support.ts +214 -41
- package/plugins/examples/virtual_buffer_demo.ts +4 -4
- package/plugins/find_references.i18n.json +91 -91
- package/plugins/git_blame.ts +3 -3
- package/plugins/git_explorer.ts +3 -2
- package/plugins/git_log.i18n.json +182 -182
- package/plugins/git_log.ts +10 -10
- package/plugins/java-lsp.ts +65 -0
- package/plugins/latex-lsp.ts +65 -0
- package/plugins/lib/finder.ts +32 -32
- package/plugins/lib/fresh.d.ts +432 -17
- package/plugins/lib/panel-manager.ts +7 -7
- package/plugins/lib/search-utils.ts +13 -13
- package/plugins/lib/virtual-buffer-factory.ts +16 -14
- package/plugins/live_grep.i18n.json +39 -39
- package/plugins/markdown_compose.i18n.json +13 -13
- package/plugins/markdown_compose.ts +4 -4
- package/plugins/marksman-lsp.ts +65 -0
- package/plugins/merge_conflict.i18n.json +143 -143
- package/plugins/merge_conflict.ts +21 -21
- package/plugins/search_replace.i18n.json +143 -143
- package/plugins/search_replace.ts +6 -6
- package/plugins/templ-lsp.ts +65 -0
- package/plugins/theme_editor.i18n.json +3797 -3745
- package/plugins/theme_editor.ts +6 -5
- package/plugins/vi_mode.ts +2 -2
- package/plugins/zig-lsp.ts +65 -0
- package/themes/dracula.json +26 -5
- package/plugins/csharp-lsp.ts +0 -147
|
@@ -229,15 +229,15 @@ async function showResultsPanel(): Promise<void> {
|
|
|
229
229
|
const result = await editor.createVirtualBufferInSplit({
|
|
230
230
|
name: "*Search/Replace*",
|
|
231
231
|
mode: "search-replace-list",
|
|
232
|
-
|
|
232
|
+
readOnly: true,
|
|
233
233
|
entries: entries,
|
|
234
234
|
ratio: 0.6, // 60/40 split
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
panelId: "search-replace-panel",
|
|
236
|
+
showLineNumbers: false,
|
|
237
|
+
showCursors: true,
|
|
238
238
|
});
|
|
239
|
-
resultsBufferId = result.
|
|
240
|
-
resultsSplitId = result.
|
|
239
|
+
resultsBufferId = result.bufferId;
|
|
240
|
+
resultsSplitId = result.splitId ?? editor.getActiveSplitId();
|
|
241
241
|
|
|
242
242
|
panelOpen = true;
|
|
243
243
|
editor.debug(`Search/Replace panel opened with buffer ID ${resultsBufferId}`);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/// <reference path="./lib/fresh.d.ts" />
|
|
2
|
+
// Provides installation help when templ LSP is not found
|
|
3
|
+
const editor = getEditor();
|
|
4
|
+
|
|
5
|
+
interface LspServerErrorData {
|
|
6
|
+
language: string;
|
|
7
|
+
server_command: string;
|
|
8
|
+
error_type: string;
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface LspStatusClickedData {
|
|
13
|
+
language: string;
|
|
14
|
+
has_error: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface ActionPopupResultData {
|
|
18
|
+
popup_id: string;
|
|
19
|
+
action_id: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const INSTALL_URL = "https://templ.guide/quick-start/installation";
|
|
23
|
+
let templLspError: { serverCommand: string; message: string } | null = null;
|
|
24
|
+
|
|
25
|
+
globalThis.on_templ_lsp_server_error = function (data: LspServerErrorData): void {
|
|
26
|
+
if (data.language !== "templ") return;
|
|
27
|
+
templLspError = { serverCommand: data.server_command, message: data.message };
|
|
28
|
+
if (data.error_type === "not_found") {
|
|
29
|
+
editor.setStatus(`Templ LSP '${data.server_command}' not found. Click status bar for help.`);
|
|
30
|
+
} else {
|
|
31
|
+
editor.setStatus(`Templ LSP error: ${data.message}`);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
editor.on("lsp_server_error", "on_templ_lsp_server_error");
|
|
35
|
+
|
|
36
|
+
globalThis.on_templ_lsp_status_clicked = function (data: LspStatusClickedData): void {
|
|
37
|
+
if (data.language !== "templ" || !templLspError) return;
|
|
38
|
+
editor.showActionPopup({
|
|
39
|
+
id: "templ-lsp-help",
|
|
40
|
+
title: "Templ Language Server Not Found",
|
|
41
|
+
message: `Install templ for code completion and diagnostics. Visit ${INSTALL_URL}`,
|
|
42
|
+
actions: [
|
|
43
|
+
{ id: "copy_url", label: "Copy install URL" },
|
|
44
|
+
{ id: "disable", label: "Disable Templ LSP" },
|
|
45
|
+
{ id: "dismiss", label: "Dismiss (ESC)" },
|
|
46
|
+
],
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
editor.on("lsp_status_clicked", "on_templ_lsp_status_clicked");
|
|
50
|
+
|
|
51
|
+
globalThis.on_templ_lsp_action_result = function (data: ActionPopupResultData): void {
|
|
52
|
+
if (data.popup_id !== "templ-lsp-help") return;
|
|
53
|
+
switch (data.action_id) {
|
|
54
|
+
case "copy_url":
|
|
55
|
+
editor.setClipboard(INSTALL_URL);
|
|
56
|
+
editor.setStatus("Copied: " + INSTALL_URL);
|
|
57
|
+
break;
|
|
58
|
+
case "disable":
|
|
59
|
+
editor.disableLspForLanguage("templ");
|
|
60
|
+
editor.setStatus("Templ LSP disabled");
|
|
61
|
+
templLspError = null;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
editor.on("action_popup_result", "on_templ_lsp_action_result");
|