@fresh-editor/fresh-editor 0.3.0 → 0.3.2
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 +120 -2
- package/package.json +1 -1
- package/plugins/astro-lsp.ts +6 -12
- package/plugins/audit_mode.ts +106 -113
- package/plugins/bash-lsp.ts +15 -22
- package/plugins/clangd-lsp.ts +15 -24
- package/plugins/clojure-lsp.ts +9 -12
- package/plugins/cmake-lsp.ts +9 -12
- package/plugins/code-tour.ts +15 -16
- package/plugins/config-schema.json +49 -5
- package/plugins/csharp_support.ts +25 -30
- package/plugins/css-lsp.ts +15 -22
- package/plugins/dart-lsp.ts +9 -12
- package/plugins/dashboard.ts +118 -0
- package/plugins/devcontainer.i18n.json +84 -28
- package/plugins/devcontainer.ts +897 -170
- package/plugins/diagnostics_panel.ts +10 -17
- package/plugins/diff_nav.ts +20 -1
- package/plugins/elixir-lsp.ts +9 -12
- package/plugins/erlang-lsp.ts +9 -12
- package/plugins/examples/bookmarks.ts +10 -16
- package/plugins/find_references.ts +5 -9
- package/plugins/flash.ts +585 -0
- package/plugins/fsharp-lsp.ts +9 -12
- package/plugins/git_explorer.ts +16 -20
- package/plugins/git_gutter.ts +65 -79
- package/plugins/git_log.ts +8 -8
- package/plugins/gleam-lsp.ts +9 -12
- package/plugins/go-lsp.ts +15 -22
- package/plugins/graphql-lsp.ts +9 -12
- package/plugins/haskell-lsp.ts +9 -12
- package/plugins/html-lsp.ts +15 -24
- package/plugins/java-lsp.ts +9 -12
- package/plugins/json-lsp.ts +15 -24
- package/plugins/julia-lsp.ts +9 -12
- package/plugins/kotlin-lsp.ts +15 -22
- package/plugins/latex-lsp.ts +9 -12
- package/plugins/lib/fresh.d.ts +378 -0
- package/plugins/live_diff.i18n.json +450 -0
- package/plugins/live_diff.ts +946 -0
- package/plugins/lua-lsp.ts +15 -22
- package/plugins/markdown_compose.ts +78 -122
- package/plugins/markdown_source.ts +8 -10
- package/plugins/marksman-lsp.ts +9 -12
- package/plugins/merge_conflict.ts +15 -17
- package/plugins/nim-lsp.ts +9 -12
- package/plugins/nix-lsp.ts +9 -12
- package/plugins/nushell-lsp.ts +9 -12
- package/plugins/ocaml-lsp.ts +9 -12
- package/plugins/odin-lsp.ts +15 -22
- package/plugins/path_complete.ts +5 -6
- package/plugins/perl-lsp.ts +9 -12
- package/plugins/php-lsp.ts +15 -22
- package/plugins/pkg.ts +10 -21
- package/plugins/protobuf-lsp.ts +9 -12
- package/plugins/python-lsp.ts +15 -24
- package/plugins/r-lsp.ts +9 -12
- package/plugins/ruby-lsp.ts +15 -22
- package/plugins/rust-lsp.ts +18 -28
- package/plugins/scala-lsp.ts +9 -12
- package/plugins/schemas/theme.schema.json +66 -0
- package/plugins/search_replace.ts +10 -13
- package/plugins/solidity-lsp.ts +9 -12
- package/plugins/sql-lsp.ts +9 -12
- package/plugins/svelte-lsp.ts +9 -12
- package/plugins/swift-lsp.ts +9 -12
- package/plugins/tailwindcss-lsp.ts +9 -12
- package/plugins/templ-lsp.ts +9 -12
- package/plugins/terraform-lsp.ts +9 -12
- package/plugins/theme_editor.i18n.json +182 -14
- package/plugins/theme_editor.ts +152 -208
- package/plugins/toml-lsp.ts +15 -22
- package/plugins/tsconfig.json +101 -0
- package/plugins/typescript-lsp.ts +15 -24
- package/plugins/typst-lsp.ts +15 -22
- package/plugins/vi_mode.ts +77 -290
- package/plugins/vue-lsp.ts +9 -12
- package/plugins/yaml-lsp.ts +15 -22
- package/plugins/zig-lsp.ts +9 -12
- package/themes/dark.json +2 -0
- package/themes/dracula.json +2 -0
- package/themes/high-contrast.json +2 -0
- package/themes/light.json +2 -0
- package/themes/nord.json +2 -0
- package/themes/nostalgia.json +2 -0
- package/themes/solarized-dark.json +2 -0
|
@@ -411,6 +411,54 @@
|
|
|
411
411
|
"$ref": "#/$defs/ColorDef",
|
|
412
412
|
"default": "DarkGray"
|
|
413
413
|
},
|
|
414
|
+
"status_palette_fg": {
|
|
415
|
+
"description": "Command palette shortcut hint text color in status bar (falls back to status_bar_fg)",
|
|
416
|
+
"anyOf": [
|
|
417
|
+
{
|
|
418
|
+
"$ref": "#/$defs/ColorDef"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"type": "null"
|
|
422
|
+
}
|
|
423
|
+
],
|
|
424
|
+
"default": null
|
|
425
|
+
},
|
|
426
|
+
"status_palette_bg": {
|
|
427
|
+
"description": "Command palette shortcut hint background in status bar (falls back to status_bar_bg)",
|
|
428
|
+
"anyOf": [
|
|
429
|
+
{
|
|
430
|
+
"$ref": "#/$defs/ColorDef"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"type": "null"
|
|
434
|
+
}
|
|
435
|
+
],
|
|
436
|
+
"default": null
|
|
437
|
+
},
|
|
438
|
+
"status_lsp_on_fg": {
|
|
439
|
+
"description": "Status bar LSP indicator text color when LSP is running (falls back to status_bar_fg)",
|
|
440
|
+
"anyOf": [
|
|
441
|
+
{
|
|
442
|
+
"$ref": "#/$defs/ColorDef"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"type": "null"
|
|
446
|
+
}
|
|
447
|
+
],
|
|
448
|
+
"default": null
|
|
449
|
+
},
|
|
450
|
+
"status_lsp_on_bg": {
|
|
451
|
+
"description": "Status bar LSP indicator background when LSP is running (falls back to status_bar_bg)",
|
|
452
|
+
"anyOf": [
|
|
453
|
+
{
|
|
454
|
+
"$ref": "#/$defs/ColorDef"
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"type": "null"
|
|
458
|
+
}
|
|
459
|
+
],
|
|
460
|
+
"default": null
|
|
461
|
+
},
|
|
414
462
|
"prompt_fg": {
|
|
415
463
|
"description": "Command prompt text color",
|
|
416
464
|
"$ref": "#/$defs/ColorDef",
|
|
@@ -794,6 +842,24 @@
|
|
|
794
842
|
255,
|
|
795
843
|
255
|
|
796
844
|
]
|
|
845
|
+
},
|
|
846
|
+
"label_bg": {
|
|
847
|
+
"description": "Background color for jump labels (e.g. flash plugin labels).\nShould be visually distinct from `match_bg` so labels stand\nout against highlighted matches. Default: bright magenta.",
|
|
848
|
+
"$ref": "#/$defs/ColorDef",
|
|
849
|
+
"default": [
|
|
850
|
+
199,
|
|
851
|
+
78,
|
|
852
|
+
189
|
|
853
|
+
]
|
|
854
|
+
},
|
|
855
|
+
"label_fg": {
|
|
856
|
+
"description": "Foreground color for jump labels. Should be high contrast\nagainst `label_bg` so the single label letter is unambiguous\neven on small terminal cells. Default: white.",
|
|
857
|
+
"$ref": "#/$defs/ColorDef",
|
|
858
|
+
"default": [
|
|
859
|
+
255,
|
|
860
|
+
255,
|
|
861
|
+
255
|
|
862
|
+
]
|
|
797
863
|
}
|
|
798
864
|
}
|
|
799
865
|
},
|
|
@@ -1255,7 +1255,9 @@ registerHandler("start_search_replace", start_search_replace);
|
|
|
1255
1255
|
// Event handlers (resize updates width)
|
|
1256
1256
|
// =============================================================================
|
|
1257
1257
|
|
|
1258
|
-
|
|
1258
|
+
|
|
1259
|
+
|
|
1260
|
+
editor.on("resize", (data) => {
|
|
1259
1261
|
if (!panel) return;
|
|
1260
1262
|
// Try viewport first (gives actual split width), fall back to terminal width estimate
|
|
1261
1263
|
const vp = editor.getViewport();
|
|
@@ -1266,31 +1268,26 @@ function onSearchReplaceResize(data: { width: number; height: number }): void {
|
|
|
1266
1268
|
panel.viewportWidth = Math.floor(data.width * 0.4);
|
|
1267
1269
|
}
|
|
1268
1270
|
updatePanelContent();
|
|
1269
|
-
}
|
|
1270
|
-
registerHandler("onSearchReplaceResize", onSearchReplaceResize);
|
|
1271
|
-
|
|
1272
|
-
editor.on("resize", "onSearchReplaceResize");
|
|
1271
|
+
});
|
|
1273
1272
|
|
|
1274
1273
|
// Prompt handlers (in case prompts are opened externally for this panel - gracefully handle)
|
|
1275
|
-
|
|
1274
|
+
|
|
1275
|
+
editor.on("prompt_cancelled", (args) => {
|
|
1276
1276
|
if (!args.prompt_type.startsWith("search-replace-")) return true;
|
|
1277
1277
|
return true;
|
|
1278
|
-
}
|
|
1279
|
-
registerHandler("onSearchReplacePromptCancelled", onSearchReplacePromptCancelled);
|
|
1280
|
-
editor.on("prompt_cancelled", "onSearchReplacePromptCancelled");
|
|
1278
|
+
});
|
|
1281
1279
|
|
|
1282
1280
|
// If the panel's virtual buffer is closed externally (via the × button,
|
|
1283
1281
|
// the Close Buffer/Close Tab commands, or anything else), reset the
|
|
1284
1282
|
// plugin's internal state so the next invocation of `openPanel` creates
|
|
1285
1283
|
// a fresh buffer/split instead of trying to update a buffer that no
|
|
1286
1284
|
// longer exists (which silently no-ops and leaves the user with no UI).
|
|
1287
|
-
|
|
1285
|
+
|
|
1286
|
+
editor.on("buffer_closed", (args) => {
|
|
1288
1287
|
if (panel && args.buffer_id === panel.resultsBufferId) {
|
|
1289
1288
|
panel = null;
|
|
1290
1289
|
}
|
|
1291
|
-
}
|
|
1292
|
-
registerHandler("onSearchReplaceBufferClosed", onSearchReplaceBufferClosed);
|
|
1293
|
-
editor.on("buffer_closed", "onSearchReplaceBufferClosed");
|
|
1290
|
+
});
|
|
1294
1291
|
|
|
1295
1292
|
editor.registerCommand(
|
|
1296
1293
|
"%cmd.search_replace",
|
package/plugins/solidity-lsp.ts
CHANGED
|
@@ -47,7 +47,8 @@ let solidityLspError: { serverCommand: string; message: string } | null = null;
|
|
|
47
47
|
/**
|
|
48
48
|
* Handle LSP server errors for Solidity
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
|
|
51
|
+
editor.on("lsp_server_error", (data) => {
|
|
51
52
|
if (data.language !== "solidity") {
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
@@ -66,14 +67,13 @@ function on_solidity_lsp_server_error(data: LspServerErrorData): void {
|
|
|
66
67
|
} else {
|
|
67
68
|
editor.setStatus(`Solidity LSP error: ${data.message}`);
|
|
68
69
|
}
|
|
69
|
-
}
|
|
70
|
-
registerHandler("on_solidity_lsp_server_error", on_solidity_lsp_server_error);
|
|
71
|
-
editor.on("lsp_server_error", "on_solidity_lsp_server_error");
|
|
70
|
+
});
|
|
72
71
|
|
|
73
72
|
/**
|
|
74
73
|
* Handle status bar click when there's a Solidity LSP error
|
|
75
74
|
*/
|
|
76
|
-
|
|
75
|
+
|
|
76
|
+
editor.on("lsp_status_clicked", (data) => {
|
|
77
77
|
if (data.language !== "solidity" || !solidityLspError) {
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
@@ -90,14 +90,13 @@ function on_solidity_lsp_status_clicked(data: LspStatusClickedData): void {
|
|
|
90
90
|
{ id: "dismiss", label: "Dismiss (ESC)" },
|
|
91
91
|
],
|
|
92
92
|
});
|
|
93
|
-
}
|
|
94
|
-
registerHandler("on_solidity_lsp_status_clicked", on_solidity_lsp_status_clicked);
|
|
95
|
-
editor.on("lsp_status_clicked", "on_solidity_lsp_status_clicked");
|
|
93
|
+
});
|
|
96
94
|
|
|
97
95
|
/**
|
|
98
96
|
* Handle action popup results for Solidity LSP help
|
|
99
97
|
*/
|
|
100
|
-
|
|
98
|
+
|
|
99
|
+
editor.on("action_popup_result", (data) => {
|
|
101
100
|
if (data.popup_id !== "solidity-lsp-help") {
|
|
102
101
|
return;
|
|
103
102
|
}
|
|
@@ -123,8 +122,6 @@ function on_solidity_lsp_action_result(data: ActionPopupResultData): void {
|
|
|
123
122
|
default:
|
|
124
123
|
editor.debug(`solidity-lsp: Unknown action: ${data.action_id}`);
|
|
125
124
|
}
|
|
126
|
-
}
|
|
127
|
-
registerHandler("on_solidity_lsp_action_result", on_solidity_lsp_action_result);
|
|
128
|
-
editor.on("action_popup_result", "on_solidity_lsp_action_result");
|
|
125
|
+
});
|
|
129
126
|
|
|
130
127
|
editor.debug("solidity-lsp: Plugin loaded");
|
package/plugins/sql-lsp.ts
CHANGED
|
@@ -40,7 +40,8 @@ const INSTALL_COMMANDS = {
|
|
|
40
40
|
|
|
41
41
|
let sqlLspError: { serverCommand: string; message: string } | null = null;
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
|
|
44
|
+
editor.on("lsp_server_error", (data) => {
|
|
44
45
|
if (data.language !== "sql") {
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
@@ -59,11 +60,10 @@ function on_sql_lsp_server_error(data: LspServerErrorData): void {
|
|
|
59
60
|
} else {
|
|
60
61
|
editor.setStatus(`SQL LSP error: ${data.message}`);
|
|
61
62
|
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
editor.on("lsp_server_error", "on_sql_lsp_server_error");
|
|
63
|
+
});
|
|
64
|
+
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
editor.on("lsp_status_clicked", (data) => {
|
|
67
67
|
if (data.language !== "sql" || !sqlLspError) {
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
@@ -82,11 +82,10 @@ function on_sql_lsp_status_clicked(data: LspStatusClickedData): void {
|
|
|
82
82
|
{ id: "dismiss", label: "Dismiss (ESC)" },
|
|
83
83
|
],
|
|
84
84
|
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
editor.on("lsp_status_clicked", "on_sql_lsp_status_clicked");
|
|
85
|
+
});
|
|
86
|
+
|
|
88
87
|
|
|
89
|
-
|
|
88
|
+
editor.on("action_popup_result", (data) => {
|
|
90
89
|
if (data.popup_id !== "sql-lsp-help") {
|
|
91
90
|
return;
|
|
92
91
|
}
|
|
@@ -122,8 +121,6 @@ function on_sql_lsp_action_result(data: ActionPopupResultData): void {
|
|
|
122
121
|
default:
|
|
123
122
|
editor.debug(`sql-lsp: Unknown action: ${data.action_id}`);
|
|
124
123
|
}
|
|
125
|
-
}
|
|
126
|
-
registerHandler("on_sql_lsp_action_result", on_sql_lsp_action_result);
|
|
127
|
-
editor.on("action_popup_result", "on_sql_lsp_action_result");
|
|
124
|
+
});
|
|
128
125
|
|
|
129
126
|
editor.debug("sql-lsp: Plugin loaded");
|
package/plugins/svelte-lsp.ts
CHANGED
|
@@ -36,7 +36,8 @@ const INSTALL_COMMANDS = {
|
|
|
36
36
|
|
|
37
37
|
let svelteLspError: { serverCommand: string; message: string } | null = null;
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
|
|
40
|
+
editor.on("lsp_server_error", (data) => {
|
|
40
41
|
if (data.language !== "svelte") {
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
@@ -55,11 +56,10 @@ function on_svelte_lsp_server_error(data: LspServerErrorData): void {
|
|
|
55
56
|
} else {
|
|
56
57
|
editor.setStatus(`Svelte LSP error: ${data.message}`);
|
|
57
58
|
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
editor.on("lsp_server_error", "on_svelte_lsp_server_error");
|
|
59
|
+
});
|
|
60
|
+
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
editor.on("lsp_status_clicked", (data) => {
|
|
63
63
|
if (data.language !== "svelte" || !svelteLspError) {
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
@@ -77,11 +77,10 @@ function on_svelte_lsp_status_clicked(data: LspStatusClickedData): void {
|
|
|
77
77
|
{ id: "dismiss", label: "Dismiss (ESC)" },
|
|
78
78
|
],
|
|
79
79
|
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
editor.on("lsp_status_clicked", "on_svelte_lsp_status_clicked");
|
|
80
|
+
});
|
|
81
|
+
|
|
83
82
|
|
|
84
|
-
|
|
83
|
+
editor.on("action_popup_result", (data) => {
|
|
85
84
|
if (data.popup_id !== "svelte-lsp-help") {
|
|
86
85
|
return;
|
|
87
86
|
}
|
|
@@ -112,8 +111,6 @@ function on_svelte_lsp_action_result(data: ActionPopupResultData): void {
|
|
|
112
111
|
default:
|
|
113
112
|
editor.debug(`svelte-lsp: Unknown action: ${data.action_id}`);
|
|
114
113
|
}
|
|
115
|
-
}
|
|
116
|
-
registerHandler("on_svelte_lsp_action_result", on_svelte_lsp_action_result);
|
|
117
|
-
editor.on("action_popup_result", "on_svelte_lsp_action_result");
|
|
114
|
+
});
|
|
118
115
|
|
|
119
116
|
editor.debug("svelte-lsp: Plugin loaded");
|
package/plugins/swift-lsp.ts
CHANGED
|
@@ -37,7 +37,8 @@ const INSTALL_COMMANDS = {
|
|
|
37
37
|
|
|
38
38
|
let swiftLspError: { serverCommand: string; message: string } | null = null;
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
editor.on("lsp_server_error", (data) => {
|
|
41
42
|
if (data.language !== "swift") {
|
|
42
43
|
return;
|
|
43
44
|
}
|
|
@@ -56,11 +57,10 @@ function on_swift_lsp_server_error(data: LspServerErrorData): void {
|
|
|
56
57
|
} else {
|
|
57
58
|
editor.setStatus(`Swift LSP error: ${data.message}`);
|
|
58
59
|
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
editor.on("lsp_server_error", "on_swift_lsp_server_error");
|
|
60
|
+
});
|
|
61
|
+
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
editor.on("lsp_status_clicked", (data) => {
|
|
64
64
|
if (data.language !== "swift" || !swiftLspError) {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
@@ -78,11 +78,10 @@ function on_swift_lsp_status_clicked(data: LspStatusClickedData): void {
|
|
|
78
78
|
{ id: "dismiss", label: "Dismiss (ESC)" },
|
|
79
79
|
],
|
|
80
80
|
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
editor.on("lsp_status_clicked", "on_swift_lsp_status_clicked");
|
|
81
|
+
});
|
|
82
|
+
|
|
84
83
|
|
|
85
|
-
|
|
84
|
+
editor.on("action_popup_result", (data) => {
|
|
86
85
|
if (data.popup_id !== "swift-lsp-help") {
|
|
87
86
|
return;
|
|
88
87
|
}
|
|
@@ -113,8 +112,6 @@ function on_swift_lsp_action_result(data: ActionPopupResultData): void {
|
|
|
113
112
|
default:
|
|
114
113
|
editor.debug(`swift-lsp: Unknown action: ${data.action_id}`);
|
|
115
114
|
}
|
|
116
|
-
}
|
|
117
|
-
registerHandler("on_swift_lsp_action_result", on_swift_lsp_action_result);
|
|
118
|
-
editor.on("action_popup_result", "on_swift_lsp_action_result");
|
|
115
|
+
});
|
|
119
116
|
|
|
120
117
|
editor.debug("swift-lsp: Plugin loaded");
|
|
@@ -36,7 +36,8 @@ const INSTALL_COMMANDS = {
|
|
|
36
36
|
|
|
37
37
|
let tailwindLspError: { serverCommand: string; message: string } | null = null;
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
|
|
40
|
+
editor.on("lsp_server_error", (data) => {
|
|
40
41
|
if (data.language !== "tailwindcss") {
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
@@ -55,11 +56,10 @@ function on_tailwindcss_lsp_server_error(data: LspServerErrorData): void {
|
|
|
55
56
|
} else {
|
|
56
57
|
editor.setStatus(`Tailwind CSS LSP error: ${data.message}`);
|
|
57
58
|
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
editor.on("lsp_server_error", "on_tailwindcss_lsp_server_error");
|
|
59
|
+
});
|
|
60
|
+
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
editor.on("lsp_status_clicked", (data) => {
|
|
63
63
|
if (data.language !== "tailwindcss" || !tailwindLspError) {
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
@@ -77,11 +77,10 @@ function on_tailwindcss_lsp_status_clicked(data: LspStatusClickedData): void {
|
|
|
77
77
|
{ id: "dismiss", label: "Dismiss (ESC)" },
|
|
78
78
|
],
|
|
79
79
|
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
editor.on("lsp_status_clicked", "on_tailwindcss_lsp_status_clicked");
|
|
80
|
+
});
|
|
81
|
+
|
|
83
82
|
|
|
84
|
-
|
|
83
|
+
editor.on("action_popup_result", (data) => {
|
|
85
84
|
if (data.popup_id !== "tailwindcss-lsp-help") {
|
|
86
85
|
return;
|
|
87
86
|
}
|
|
@@ -112,8 +111,6 @@ function on_tailwindcss_lsp_action_result(data: ActionPopupResultData): void {
|
|
|
112
111
|
default:
|
|
113
112
|
editor.debug(`tailwindcss-lsp: Unknown action: ${data.action_id}`);
|
|
114
113
|
}
|
|
115
|
-
}
|
|
116
|
-
registerHandler("on_tailwindcss_lsp_action_result", on_tailwindcss_lsp_action_result);
|
|
117
|
-
editor.on("action_popup_result", "on_tailwindcss_lsp_action_result");
|
|
114
|
+
});
|
|
118
115
|
|
|
119
116
|
editor.debug("tailwindcss-lsp: Plugin loaded");
|
package/plugins/templ-lsp.ts
CHANGED
|
@@ -22,7 +22,8 @@ interface ActionPopupResultData {
|
|
|
22
22
|
const INSTALL_URL = "https://templ.guide/quick-start/installation";
|
|
23
23
|
let templLspError: { serverCommand: string; message: string } | null = null;
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
editor.on("lsp_server_error", (data) => {
|
|
26
27
|
if (data.language !== "templ") return;
|
|
27
28
|
templLspError = { serverCommand: data.server_command, message: data.message };
|
|
28
29
|
if (data.error_type === "not_found") {
|
|
@@ -30,11 +31,10 @@ function on_templ_lsp_server_error(data: LspServerErrorData) : void {
|
|
|
30
31
|
} else {
|
|
31
32
|
editor.setStatus(`Templ LSP error: ${data.message}`);
|
|
32
33
|
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
editor.on("lsp_server_error", "on_templ_lsp_server_error");
|
|
34
|
+
});
|
|
35
|
+
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
editor.on("lsp_status_clicked", (data) => {
|
|
38
38
|
if (data.language !== "templ" || !templLspError) return;
|
|
39
39
|
editor.showActionPopup({
|
|
40
40
|
id: "templ-lsp-help",
|
|
@@ -46,11 +46,10 @@ function on_templ_lsp_status_clicked(data: LspStatusClickedData) : void {
|
|
|
46
46
|
{ id: "dismiss", label: "Dismiss (ESC)" },
|
|
47
47
|
],
|
|
48
48
|
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
editor.on("lsp_status_clicked", "on_templ_lsp_status_clicked");
|
|
49
|
+
});
|
|
50
|
+
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
editor.on("action_popup_result", (data) => {
|
|
54
53
|
if (data.popup_id !== "templ-lsp-help") return;
|
|
55
54
|
switch (data.action_id) {
|
|
56
55
|
case "copy_url":
|
|
@@ -63,6 +62,4 @@ function on_templ_lsp_action_result(data: ActionPopupResultData) : void {
|
|
|
63
62
|
templLspError = null;
|
|
64
63
|
break;
|
|
65
64
|
}
|
|
66
|
-
}
|
|
67
|
-
registerHandler("on_templ_lsp_action_result", on_templ_lsp_action_result);
|
|
68
|
-
editor.on("action_popup_result", "on_templ_lsp_action_result");
|
|
65
|
+
});
|
package/plugins/terraform-lsp.ts
CHANGED
|
@@ -49,7 +49,8 @@ let terraformLspError: { serverCommand: string; message: string } | null = null;
|
|
|
49
49
|
/**
|
|
50
50
|
* Handle LSP server errors for Terraform
|
|
51
51
|
*/
|
|
52
|
-
|
|
52
|
+
|
|
53
|
+
editor.on("lsp_server_error", (data) => {
|
|
53
54
|
if (data.language !== "terraform") {
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
@@ -68,14 +69,13 @@ function on_terraform_lsp_server_error(data: LspServerErrorData): void {
|
|
|
68
69
|
} else {
|
|
69
70
|
editor.setStatus(`Terraform LSP error: ${data.message}`);
|
|
70
71
|
}
|
|
71
|
-
}
|
|
72
|
-
registerHandler("on_terraform_lsp_server_error", on_terraform_lsp_server_error);
|
|
73
|
-
editor.on("lsp_server_error", "on_terraform_lsp_server_error");
|
|
72
|
+
});
|
|
74
73
|
|
|
75
74
|
/**
|
|
76
75
|
* Handle status bar click when there's a Terraform LSP error
|
|
77
76
|
*/
|
|
78
|
-
|
|
77
|
+
|
|
78
|
+
editor.on("lsp_status_clicked", (data) => {
|
|
79
79
|
if (data.language !== "terraform" || !terraformLspError) {
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
@@ -94,14 +94,13 @@ function on_terraform_lsp_status_clicked(data: LspStatusClickedData): void {
|
|
|
94
94
|
{ id: "dismiss", label: "Dismiss (ESC)" },
|
|
95
95
|
],
|
|
96
96
|
});
|
|
97
|
-
}
|
|
98
|
-
registerHandler("on_terraform_lsp_status_clicked", on_terraform_lsp_status_clicked);
|
|
99
|
-
editor.on("lsp_status_clicked", "on_terraform_lsp_status_clicked");
|
|
97
|
+
});
|
|
100
98
|
|
|
101
99
|
/**
|
|
102
100
|
* Handle action popup results for Terraform LSP help
|
|
103
101
|
*/
|
|
104
|
-
|
|
102
|
+
|
|
103
|
+
editor.on("action_popup_result", (data) => {
|
|
105
104
|
if (data.popup_id !== "terraform-lsp-help") {
|
|
106
105
|
return;
|
|
107
106
|
}
|
|
@@ -137,8 +136,6 @@ function on_terraform_lsp_action_result(data: ActionPopupResultData): void {
|
|
|
137
136
|
default:
|
|
138
137
|
editor.debug(`terraform-lsp: Unknown action: ${data.action_id}`);
|
|
139
138
|
}
|
|
140
|
-
}
|
|
141
|
-
registerHandler("on_terraform_lsp_action_result", on_terraform_lsp_action_result);
|
|
142
|
-
editor.on("action_popup_result", "on_terraform_lsp_action_result");
|
|
139
|
+
});
|
|
143
140
|
|
|
144
141
|
editor.debug("terraform-lsp: Plugin loaded");
|