Skip to content

Commit 016e6b8

Browse files
authored
fix(lsp-zig.el): Update config (#4350)
* fix(lsp-zig.el): Update config * Shorten variables name * remove unused update server option
1 parent 18500c3 commit 016e6b8

File tree

1 file changed

+56
-69
lines changed

1 file changed

+56
-69
lines changed

clients/lsp-zig.el

+56-69
Original file line numberDiff line numberDiff line change
@@ -46,168 +46,157 @@ executable with variable `exec-path'."
4646
(const "messages")
4747
(const "verbose")))
4848

49-
(defcustom lsp-zig-check-for-update t
50-
"Whether to automatically check for new updates."
51-
:group 'lsp-zig
52-
:type 'boolean)
53-
54-
(defcustom lsp-zig-zls-enable-snippets t
49+
(defcustom lsp-zls-enable-snippets t
5550
"Enables snippet completions when the client also supports them."
5651
:group 'lsp-zig
5752
:type 'boolean)
5853

59-
(defcustom lsp-zig-zls-enable-argument-placeholders t
54+
(defcustom lsp-zig-enable-argument-placeholders t
6055
"Whether to enable function argument placeholder completions."
6156
:group 'lsp-zig
6257
:type 'boolean)
6358

64-
(defcustom lsp-zig-zls-enable-build-on-save nil
59+
(defcustom lsp-zig-enable-build-on-save nil
6560
"Whether to enable build-on-save diagnostics."
6661
:group 'lsp-zig
6762
:type 'boolean)
6863

69-
(defcustom lsp-zig-zls-build-on-save-step "install"
64+
(defcustom lsp-zig-build-on-save-step "install"
7065
"Select which step should be executed on build-on-save."
7166
:group 'lsp-zig
7267
:type 'string)
7368

74-
(defcustom lsp-zig-zls-enable-autofix nil
69+
(defcustom lsp-zig-enable-autofix nil
7570
"Whether to automatically fix errors on save.
7671
Currently supports adding and removing discards."
7772
:group 'lsp-zig
7873
:type 'boolean)
7974

80-
(defcustom lsp-zig-zls-semantic-tokens "partial"
75+
(defcustom lsp-zig-semantic-tokens "partial"
8176
"Traces the communication between Emacs and the language server."
8277
:group 'lsp-zig
8378
:type '(choice (const "off")
8479
(const "messages")
8580
(const "verbose")))
8681

87-
(defcustom lsp-zig-zls-enable-inlay-hints t
82+
(defcustom lsp-zig-enable-inlay-hints t
8883
"Enables inlay hint support when the client also supports it."
8984
:group 'lsp-zig
9085
:type 'boolean)
9186

92-
(defcustom lsp-zig-zls-inlay-hints-show-variable-type-hints t
87+
(defcustom lsp-zig-inlay-hints-show-variable-type-hints t
9388
"Enable inlay hints for variable type."
9489
:group 'lsp-zig
9590
:type 'boolean)
9691

97-
(defcustom lsp-zig-zls-inlay-hints-show-parameter-name t
92+
(defcustom lsp-zig-inlay-hints-show-parameter-name t
9893
"Enable inlay hints for parameter names."
9994
:group 'lsp-zig
10095
:type 'boolean)
10196

102-
(defcustom lsp-zig-zls-inlay-hints-exclude-single-argument t
97+
(defcustom lsp-zig-inlay-hints-exclude-single-argument t
10398
"Don't show inlay hints for single argument calls."
10499
:group 'lsp-zig
105100
:type 'boolean)
106101

107-
(defcustom lsp-zig-zls-inlay-hints-show-builtin t
102+
(defcustom lsp-zig-inlay-hints-show-builtin t
108103
"Don't show inlay hints for single argument calls."
109104
:group 'lsp-zig
110105
:type 'boolean)
111106

112-
(defcustom lsp-zig-zls-inlay-hints-hide-redundant-param-names nil
107+
(defcustom lsp-zig-inlay-hints-hide-redundant-param-names nil
113108
"Hides inlay hints when parameter name matches the identifier (e.g. foo: foo)."
114109
:group 'lsp-zig
115110
:type 'boolean)
116111

117-
(defcustom lsp-zig-zls-inlay-hints-hide-redundant-param-names-last-token nil
112+
(defcustom lsp-zig-inlay-hints-hide-redundant-param-names-last-token nil
118113
"Hides inlay hints when parameter name matches the last token of a parameter
119114
node (e.g. foo: bar.foo, foo: &foo)."
120115
:group 'lsp-zig
121116
:type 'boolean)
122117

123-
(defcustom lsp-zig-zls-warn-style nil
118+
(defcustom lsp-zig-warn-style nil
124119
"Enables warnings for style guideline mismatches."
125120
:group 'lsp-zig
126121
:type 'boolean)
127122

128-
(defcustom lsp-zig-zls-highlight-global-var-declarations nil
123+
(defcustom lsp-zig-highlight-global-var-declarations nil
129124
"Whether to highlight global var declarations."
130125
:group 'lsp-zig
131126
:type 'boolean)
132127

133-
(defcustom lsp-zig-zls-dangerous-comptime-experiments-do-not-enable nil
128+
(defcustom lsp-zig-dangerous-comptime-experiments-do-not-enable nil
134129
"When true, skips searching for references in std.
135130
Improves lookup speed for functions in user's code. Renaming and
136131
go-to-definition will continue to work as is."
137132
:group 'lsp-zig
138133
:type 'boolean)
139134

140-
(defcustom lsp-zig-zls-skip-std-references nil
135+
(defcustom lsp-zig-skip-std-references nil
141136
"hen true, skips searching for references in std.
142137
Improves lookup speed for functions in user's code. Renaming and
143138
go-to-definition will continue to work as is."
144139
:group 'lsp-zig
145140
:type 'boolean)
146141

147-
(defcustom lsp-zig-zls-prefer-ast-check-as-child-process t
142+
(defcustom lsp-zig-prefer-ast-check-as-child-process t
148143
"Favor using `zig ast-check` instead of ZLS's fork."
149144
:group 'lsp-zig
150145
:type 'boolean)
151146

152-
(defcustom lsp-zig-zls-record-session nil
147+
(defcustom lsp-zig-record-session nil
153148
"When true, zls will record all request is receives and write in into
154149
`record_session_path`, so that they can replayed with `zls replay`."
155150
:group 'lsp-zig
156151
:type 'boolean)
157152

158-
(defcustom lsp-zig-zls-record-session-path ""
153+
(defcustom lsp-zig-record-session-path ""
159154
"Output file path when `record_session` is set.
160155
The recommended file extension *.zlsreplay."
161156
:group 'lsp-zig
162157
:type 'string)
163158

164-
(defcustom lsp-zig-zls-replay-session-path ""
159+
(defcustom lsp-zig-replay-session-path ""
165160
"Used when calling `zls replay` for specifying the replay file.
166161
If no extra argument is given `record_session_path` is used as the default path."
167162
:group 'lsp-zig
168163
:type 'string)
169164

170-
(defcustom lsp-zig-zls-builtin-path ""
165+
(defcustom lsp-zig-builtin-path ""
171166
"Path to `builtin'; useful for debugging, automatically set if let null."
172167
:group 'lsp-zig
173168
:type 'string)
174169

175-
(defcustom lsp-zig-zls-zig-lib-path ""
170+
(defcustom lsp-zig-zig-lib-path ""
176171
"Zig library path.
177172
e.g. `/path/to/zig/lib/zig`, used to analyze std library imports."
178173
:group 'lsp-zig
179174
:type 'string)
180175

181-
(defcustom lsp-zig-zls-build-runner-path ""
176+
(defcustom lsp-zig-build-runner-path ""
182177
"Path to the `build_runner.zig` file provided by zls.
183178
null is equivalent to `${executable_directory}/build_runner.zig`."
184179
:group 'lsp-zig
185180
:type 'string)
186181

187-
(defcustom lsp-zig-zls-global-cache-path ""
182+
(defcustom lsp-zig-global-cache-path ""
188183
"Path to a directory that will be used as zig's cache.
189184
null is equivalent to `${KnownFolders.Cache}/zls`."
190185
:group 'lsp-zig
191186
:type 'string)
192187

193-
(defcustom lsp-zig-zls-build-runner-global-cache-path ""
188+
(defcustom lsp-zig-build-runner-global-cache-path ""
194189
"Path to a directory that will be used as the global cache path when executing
195190
a projects build.zig. null is equivalent to the path shown by `zig env`."
196191
:group 'lsp-zig
197192
:type 'string)
198193

199-
(defcustom lsp-zig-zls-completions-with-replace nil
194+
(defcustom lsp-zig-completions-with-replace nil
200195
"Completions confirm behavior.
201196
If `true', replace the text after the cursor."
202197
:group 'lsp-zig
203198
:type 'boolean)
204199

205-
(defcustom lsp-zig-zls-completion-label-details nil
206-
"When false, the function signature of completion results is hidden.
207-
Improves readability in some editors."
208-
:group 'lsp-zig
209-
:type 'boolean)
210-
211200
;;
212201
;;; Util
213202

@@ -294,37 +283,35 @@ and not the global storage."
294283
;;; Core
295284

296285
(lsp-register-custom-settings
297-
'(("zig.zls.trace.server" lsp-zig-trace-server)
298-
("zig.zls.checkForUpdate" lsp-zig-check-for-update)
299-
("zig.zls.path" lsp-zig-zls-executable)
300-
("zig.zls.enableSnippets" lsp-zig-zls-enable-snippets)
301-
("zig.zls.enableArgumentPlaceholders" lsp-zig-zls-enable-argument-placeholders)
302-
("zig.zls.enableBuildOnSave" lsp-zig-zls-enable-build-on-save)
303-
("zig.zls.buildOnSaveStep" lsp-zig-zls-build-on-save-step)
304-
("zig.zls.enableAutofix" lsp-zig-zls-enable-autofix)
305-
("zig.zls.semanticTokens" lsp-zig-zls-semantic-tokens)
306-
("zig.zls.enableInlayHints" lsp-zig-zls-enable-inlay-hints)
307-
("zig.zls.inlayHintsShowVariableTypeHints" lsp-zig-zls-inlay-hints-show-variable-type-hints)
308-
("zig.zls.inlayHintsShowParameterName" lsp-zig-zls-inlay-hints-show-parameter-name)
309-
("zig.zls.inlayHintsShowBuiltin" lsp-zig-zls-inlay-hints-show-builtin)
310-
("zig.zls.inlayHintsExcludeSingleArgument" lsp-zig-zls-inlay-hints-exclude-single-argument)
311-
("zig.zls.inlayHintsHideRedundantParamNames" lsp-zig-zls-inlay-hints-hide-redundant-param-names)
312-
("zig.zls.inlayHintsHideRedundantParamNamesLastToken" lsp-zig-zls-inlay-hints-hide-redundant-param-names-last-token)
313-
("zig.zls.warnStyle" lsp-zig-zls-warn-style)
314-
("zig.zls.highlightGlobalVarDeclarations" lsp-zig-zls-highlight-global-var-declarations)
315-
("zig.zls.dangerousComptimeExperimentsDoNotEnable" lsp-zig-zls-dangerous-comptime-experiments-do-not-enable)
316-
("zig.zls.skipStdReferences" lsp-zig-zls-skip-std-references)
317-
("zig.zls.preferAstCheckAsChildProcess" lsp-zig-zls-prefer-ast-check-as-child-process)
318-
("zig.zls.recordSession" lsp-zig-zls-record-session)
319-
("zig.zls.recordSessionPath" lsp-zig-zls-record-session-path)
320-
("zig.zls.replaySessionPath" lsp-zig-zls-replay-session-path)
321-
("zig.zls.builtinPath" lsp-zig-zls-builtin-path)
322-
("zig.zls.zigLibPath" lsp-zig-zls-zig-lib-path)
323-
("zig.zls.buildRunnerPath" lsp-zig-zls-build-runner-path)
324-
("zig.zls.globalCachePath" lsp-zig-zls-global-cache-path)
325-
("zig.zls.buildRunnerGlobalCachePath" lsp-zig-zls-build-runner-global-cache-path)
326-
("zig.zls.completionsWithReplace" lsp-zig-zls-completions-with-replace)
327-
("zig.zls.completionLabelDetails" lsp-zig-zls-completion-label-details)))
286+
'(("zls.trace.server" lsp-zig-trace-server)
287+
("zls.path" lsp-zig-zls-executable)
288+
("zls.enable_snippets" lsp-zls-enable-snippets t)
289+
("zls.enable_argument_placeholders" lsp-zig-enable-argument-placeholders t)
290+
("zls.enable_build_on_save" lsp-zig-enable-build-on-save t)
291+
("zls.build_on_save_step" lsp-zig-build-on-save-step)
292+
("zls.enable_autofix" lsp-zig-enable-autofix t)
293+
("zls.semantic_tokens" lsp-zig-semantic-tokens)
294+
("zls.enable_inlay_hints" lsp-zig-enable-inlay-hints t)
295+
("zls.inlay_hints_show_variable_type_hints" lsp-zig-inlay-hints-show-variable-type-hints t)
296+
("zls.inlay_hints_show_parameter_name" lsp-zig-inlay-hints-show-parameter-name t)
297+
("zls.inlay_hints_show_builtin" lsp-zig-inlay-hints-show-builtin t)
298+
("zls.inlay_hints_exclude_single_argument" lsp-zig-inlay-hints-exclude-single-argument t)
299+
("zls.inlay_hints_hide_redundant_param_names" lsp-zig-inlay-hints-hide-redundant-param-names t)
300+
("zls.inlay_hints_hide_redundant_param_names_last_token" lsp-zig-inlay-hints-hide-redundant-param-names-last-token t)
301+
("zls.warn_style" lsp-zig-warn-style t)
302+
("zls.highlight_global_var_declarations" lsp-zig-highlight-global-var-declarations t)
303+
("zls.dangerous_comptime_experiments_do_not_enable" lsp-zig-dangerous-comptime-experiments-do-not-enable t)
304+
("zls.skip_std_references" lsp-zig-skip-std-references t)
305+
("zls.prefer_ast_check_as_child_process" lsp-zig-prefer-ast-check-as-child-process t)
306+
("zls.record_session" lsp-zig-record-session t)
307+
("zls.record_session_path" lsp-zig-record-session-path)
308+
("zls.replay_session_path" lsp-zig-replay-session-path)
309+
("zls.builtin_path" lsp-zig-builtin-path)
310+
("zls.zig_lib_path" lsp-zig-zig-lib-path)
311+
("zls.build_runner_path" lsp-zig-build-runner-path)
312+
("zls.global_cache_path" lsp-zig-global-cache-path)
313+
("zls.build_runner_global_cache_path" lsp-zig-build-runner-global-cache-path)
314+
("zls.completion_label_details" lsp-zig-completions-with-replace t)))
328315

329316
(lsp-register-client
330317
(make-lsp-client

0 commit comments

Comments
 (0)