MCPcopy Create free account
hub / github.com/Noumena-Network/code / buildIDEProperties

Function buildIDEProperties

src/utils/status.tsx:188–238  ·  view source on GitHub ↗
(mcpClients: MCPServerConnection[], ideInstallationStatus: IDEExtensionInstallationStatus | null = null, theme: ThemeName)

Source from the content-addressed store, hash-verified

186 }];
187}
188export function buildIDEProperties(mcpClients: MCPServerConnection[], ideInstallationStatus: IDEExtensionInstallationStatus | null = null, theme: ThemeName): Property[] {
189 const ideClient = mcpClients?.find(client => client.name === 'ide');
190 if (ideInstallationStatus) {
191 const ideName = toIDEDisplayName(ideInstallationStatus.ideType);
192 const pluginOrExtension = isJetBrainsIde(ideInstallationStatus.ideType) ? 'plugin' : 'extension';
193 if (ideInstallationStatus.error) {
194 return [{
195 label: 'IDE',
196 value: <Text>
197 {color('error', theme)(figures.cross)} Error installing {ideName}{' '}
198 {pluginOrExtension}: {ideInstallationStatus.error}
199 {'\n'}Please restart your IDE and try again.
200 </Text>
201 }];
202 }
203 if (ideInstallationStatus.installed) {
204 if (ideClient && ideClient.type === 'connected') {
205 if (ideInstallationStatus.installedVersion !== ideClient.serverInfo?.version) {
206 return [{
207 label: 'IDE',
208 value: `Connected to ${ideName} ${pluginOrExtension} version ${ideInstallationStatus.installedVersion} (server version: ${ideClient.serverInfo?.version})`
209 }];
210 } else {
211 return [{
212 label: 'IDE',
213 value: `Connected to ${ideName} ${pluginOrExtension} version ${ideInstallationStatus.installedVersion}`
214 }];
215 }
216 } else {
217 return [{
218 label: 'IDE',
219 value: `Installed ${ideName} ${pluginOrExtension}`
220 }];
221 }
222 }
223 } else if (ideClient) {
224 const ideName = getIdeClientName(ideClient) ?? 'IDE';
225 if (ideClient.type === 'connected') {
226 return [{
227 label: 'IDE',
228 value: `Connected to ${ideName} extension`
229 }];
230 } else {
231 return [{
232 label: 'IDE',
233 value: `${color('error', theme)(figures.cross)} Not connected to ${ideName}`
234 }];
235 }
236 }
237 return [];
238}
239export function buildMcpProperties(clients: MCPServerConnection[] = [], theme: ThemeName): Property[] {
240 const servers = clients.filter(client => client.name !== 'ide');
241 if (!servers.length) {

Callers 1

buildSecondarySectionFunction · 0.85

Calls 4

toIDEDisplayNameFunction · 0.85
isJetBrainsIdeFunction · 0.85
colorFunction · 0.85
getIdeClientNameFunction · 0.85

Tested by

no test coverage detected