(snapshot)
| 286 | } |
| 287 | |
| 288 | function createItems(snapshot) { |
| 289 | const featureItems = getFeatureItems(); |
| 290 | const categories = { |
| 291 | general: strings["settings-category-general"], |
| 292 | installation: strings["settings-category-installation"], |
| 293 | advanced: strings["settings-category-advanced"], |
| 294 | features: strings["settings-category-features"], |
| 295 | }; |
| 296 | const items = [ |
| 297 | { |
| 298 | key: "enabled", |
| 299 | text: strings["lsp-enabled"], |
| 300 | checkbox: snapshot.merged.enabled !== false, |
| 301 | info: strings["settings-info-lsp-server-enabled"], |
| 302 | category: categories.general, |
| 303 | }, |
| 304 | ...(snapshot.isCustom |
| 305 | ? [ |
| 306 | { |
| 307 | key: "remove_custom_server", |
| 308 | text: strings["lsp-remove-custom-server"], |
| 309 | info: strings["settings-info-lsp-remove-custom-server"], |
| 310 | category: categories.general, |
| 311 | chevron: true, |
| 312 | }, |
| 313 | ] |
| 314 | : []), |
| 315 | { |
| 316 | key: "startup_timeout", |
| 317 | text: strings["lsp-startup-timeout"], |
| 318 | value: formatStartupTimeoutValue(snapshot.merged.startupTimeout), |
| 319 | info: strings["settings-info-lsp-startup-timeout"], |
| 320 | category: categories.advanced, |
| 321 | chevron: true, |
| 322 | }, |
| 323 | { |
| 324 | key: "edit_init_options", |
| 325 | text: strings["lsp-edit-initialization-options"], |
| 326 | value: Object.keys(snapshot.override.initializationOptions || {}).length |
| 327 | ? strings["lsp-configured"] |
| 328 | : strings["lsp-empty"], |
| 329 | info: strings["settings-info-lsp-edit-init-options"], |
| 330 | category: categories.advanced, |
| 331 | chevron: true, |
| 332 | }, |
| 333 | { |
| 334 | key: "view_init_options", |
| 335 | text: strings["lsp-view-initialization-options"], |
| 336 | info: strings["settings-info-lsp-view-init-options"], |
| 337 | category: categories.advanced, |
| 338 | chevron: true, |
| 339 | }, |
| 340 | ]; |
| 341 | |
| 342 | const installationItems = [ |
| 343 | { |
| 344 | key: "install_status", |
| 345 | text: formatStatusLabel(snapshot.installResult), |
no test coverage detected