MCPcopy Create free account
hub / github.com/WJX20/claude-code / addPluginScopeToLspServers

Function addPluginScopeToLspServers

src/utils/plugins/lspPluginIntegration.ts:298–315  ·  view source on GitHub ↗
(
  servers: Record<string, LspServerConfig>,
  pluginName: string,
)

Source from the content-addressed store, hash-verified

296 * This adds a prefix to server names to avoid conflicts between plugins
297 */
298export 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

Callers 2

getPluginLspServersFunction · 0.85

Calls 1

entriesMethod · 0.80

Tested by

no test coverage detected