Skip to main content
Glama
nrwl

Nx MCP Server

Official
by nrwl
editor-context.ts973 B
import { createContext } from '@lit-labs/context'; import { LitElement } from 'lit'; import { state } from 'lit/decorators.js'; import { ContextConsumer } from '@lit-labs/context'; export const editorContext = createContext<'vscode' | 'intellij'>( Symbol('editor'), ); export declare class EditorContextInterface { editor: 'vscode' | 'intellij'; } type Constructor<T> = new (...args: any[]) => T; export const EditorContext = <T extends Constructor<LitElement>>( superClass: T, ) => { class EditorContextElement extends superClass { @state() editor: 'vscode' | 'intellij'; constructor(...rest: any[]) { super(); // we can't use the @consume decorator due to mixin typing quirks new ContextConsumer(this, { context: editorContext, callback: (value) => { this.editor = value; }, subscribe: true, }); } } return EditorContextElement as Constructor<EditorContextInterface> & T; };

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