( servers: Record<string, LspServerConfig>, pluginName: string, )
| 296 | * This adds a prefix to server names to avoid conflicts between plugins |
| 297 | */ |
| 298 | export function addPluginScopeToLspServers( |
| 299 | servers: Record<string, LspServerConfig>, |
| 300 | pluginName: string, |
| 301 | ): Record<string, ScopedLspServerConfig> { |
| 302 | const scopedServers: Record<string, ScopedLspServerConfig> = {} |
| 303 | |
| 304 | for (const [name, config] of Object.entries(servers)) { |
| 305 | // Add plugin prefix to server name to avoid conflicts |
| 306 | const scopedName = `plugin:${pluginName}:${name}` |
| 307 | scopedServers[scopedName] = { |
| 308 | ...config, |
| 309 | scope: 'dynamic', // Use dynamic scope for plugin servers |
| 310 | source: pluginName, |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | return scopedServers |
| 315 | } |
| 316 | |
| 317 | /** |
| 318 | * Get LSP servers from a specific plugin with environment variable resolution and scoping |
no test coverage detected