@@ -137,17 +137,19 @@ function MainView:handle_edit()
137
137
local cursor = vim .api .nvim_win_get_cursor (0 )
138
138
local line = cursor [1 ]
139
139
140
- local type , context = self :get_line_info (line )
141
- if not type or not context then
140
+ local line_type , context = self :get_line_info (line )
141
+ if not line_type or not context then
142
142
return
143
143
end
144
144
local server_name = context .name
145
- if type == " server" then
145
+ if line_type == " server" then
146
146
local is_native = native .is_native_server (server_name )
147
+ local config
147
148
if is_native then
148
- return vim .notify (" Native servers cannot be edited" )
149
+ config = State .native_servers_config [server_name ] or {}
150
+ else
151
+ config = State .servers_config [server_name ] or {}
149
152
end
150
- local config = State .servers_config [server_name ] or {}
151
153
local text = utils .pretty_json (vim .json .encode ({
152
154
[server_name ] = config ,
153
155
}) or " " )
@@ -186,15 +188,27 @@ function MainView:handle_edit()
186
188
local new_name , new_config = next (result )
187
189
--- @cast new_name string
188
190
--- @cast new_config table
189
- local valid = validation .validate_server_config (new_name , new_config )
190
- if not valid .ok then
191
- vim .notify (valid .error .message , vim .log .levels .ERROR )
192
- return false
191
+
192
+ -- For native servers, we only need to validate basic structure
193
+ -- since they don't require command/url fields
194
+ if is_native then
195
+ if type (new_config ) ~= " table" then
196
+ vim .notify (" Config must be a table" , vim .log .levels .ERROR )
197
+ return false
198
+ end
199
+ -- Native servers only need basic config validation
200
+ return true
201
+ else
202
+ local valid = validation .validate_server_config (new_name , new_config )
203
+ if not valid .ok then
204
+ vim .notify (valid .error .message , vim .log .levels .ERROR )
205
+ return false
206
+ end
193
207
end
194
208
return true
195
209
end ,
196
210
})
197
- elseif (type == " customInstructions" ) and context then
211
+ elseif (line_type == " customInstructions" ) and context then
198
212
self :handle_custom_instructions (context )
199
213
end
200
214
end
@@ -212,7 +226,7 @@ function MainView:handle_delete()
212
226
local server_name = context .name
213
227
local is_native = native .is_native_server (server_name )
214
228
if is_native then
215
- return vim .notify (" Native servers cannot be deleted" )
229
+ return vim .notify (" Native servers cannot be deleted, only their configuration can be edited " )
216
230
end
217
231
218
232
-- Using vim.ui.select instead of vim.fn.confirm
0 commit comments