Skip to main content
Glama
nrwl

Nx MCP Server

Official
by nrwl
show-refresh-loading.ts1.53 kB
import { NxWorkspaceRefreshNotification } from '@nx-console/language-server-types'; import { Disposable, window } from 'vscode'; import { NxWorkspaceRefreshStartedNotification } from '@nx-console/language-server-types'; import { ProgressLocation } from 'vscode'; import { getNxlsClient } from './nxls-client'; const currentLoadingLocations: Set<string> = new Set(); export function showRefreshLoadingAtLocation( location: | ProgressLocation | { viewId: string; } ): Disposable { const client = getNxlsClient(); const locationString = JSON.stringify(location); const onNotificationDisposable = client.onNotification( NxWorkspaceRefreshStartedNotification, async () => { if (currentLoadingLocations.has(locationString)) { return; } currentLoadingLocations.add(locationString); const refreshPromise = new Promise<void>((resolve) => { const disposable = client.onNotification( NxWorkspaceRefreshNotification, () => { disposable?.dispose(); resolve(); } ); }); await window.withProgress( { location, cancellable: false, title: 'Refreshing Nx workspace', }, async () => { await refreshPromise; } ); currentLoadingLocations.delete(locationString); } ); return new Disposable(() => { currentLoadingLocations.delete(locationString); onNotificationDisposable.dispose(); }); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nrwl/nx-console'

If you have feedback or need assistance with the MCP directory API, please join our Discord server