@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.
Files changed (39) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +4 -0
  3. package/package.json +1 -1
  4. package/plugins/README.md +1 -0
  5. package/plugins/audit_mode.ts +38 -34
  6. package/plugins/calculator.i18n.json +13 -13
  7. package/plugins/calculator.ts +6 -6
  8. package/plugins/clangd_support.i18n.json +26 -26
  9. package/plugins/config-schema.json +180 -116
  10. package/plugins/csharp_support.i18n.json +52 -52
  11. package/plugins/csharp_support.ts +214 -41
  12. package/plugins/examples/virtual_buffer_demo.ts +4 -4
  13. package/plugins/find_references.i18n.json +91 -91
  14. package/plugins/git_blame.ts +3 -3
  15. package/plugins/git_explorer.ts +3 -2
  16. package/plugins/git_log.i18n.json +182 -182
  17. package/plugins/git_log.ts +10 -10
  18. package/plugins/java-lsp.ts +65 -0
  19. package/plugins/latex-lsp.ts +65 -0
  20. package/plugins/lib/finder.ts +32 -32
  21. package/plugins/lib/fresh.d.ts +432 -17
  22. package/plugins/lib/panel-manager.ts +7 -7
  23. package/plugins/lib/search-utils.ts +13 -13
  24. package/plugins/lib/virtual-buffer-factory.ts +16 -14
  25. package/plugins/live_grep.i18n.json +39 -39
  26. package/plugins/markdown_compose.i18n.json +13 -13
  27. package/plugins/markdown_compose.ts +4 -4
  28. package/plugins/marksman-lsp.ts +65 -0
  29. package/plugins/merge_conflict.i18n.json +143 -143
  30. package/plugins/merge_conflict.ts +21 -21
  31. package/plugins/search_replace.i18n.json +143 -143
  32. package/plugins/search_replace.ts +6 -6
  33. package/plugins/templ-lsp.ts +65 -0
  34. package/plugins/theme_editor.i18n.json +3797 -3745
  35. package/plugins/theme_editor.ts +6 -5
  36. package/plugins/vi_mode.ts +2 -2
  37. package/plugins/zig-lsp.ts +65 -0
  38. package/themes/dracula.json +26 -5
  39. 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
- read_only: true,
232
+ readOnly: true,
233
233
  entries: entries,
234
234
  ratio: 0.6, // 60/40 split
235
- panel_id: "search-replace-panel",
236
- show_line_numbers: false,
237
- show_cursors: true,
235
+ panelId: "search-replace-panel",
236
+ showLineNumbers: false,
237
+ showCursors: true,
238
238
  });
239
- resultsBufferId = result.buffer_id;
240
- resultsSplitId = result.split_id ?? editor.getActiveSplitId();
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");