@nx-lang/language

中文文档
0.10.0发布于 2026/11/02MITES Module零依赖构建来源已验证

Reusable TextMate grammar, language configuration, and snippets for the NX language.

原始使用文档
文档目录4 节
  1. Features
  2. Settings
  3. Links
  4. Editor assets for other editors: @nx-lang/language

NX Language

Language support for NX: a modern language for executable markup, built for dynamic, AI-native experiences. Open any .nx file to get highlighting, diagnostics as you type, hover information and completions.

type Task = { title:string  done:boolean = false }

let <TaskList tasks:Task+ /> =
  <ul>
    for task in tasks {
      <li checked={task.done}>{task.title}</li>
    }
  </ul>

New to NX? Start with Getting Started or try it without installing anything in the playground.

Features

  • Syntax highlighting for .nx files, and for ```nx code blocks in Markdown.
  • Diagnostics from the NX language server: syntax and type errors appear as you type.
  • Hover shows the declaration and type of what is under the cursor.
  • Completions for keywords, types, declarations, components, their properties and union cases.
  • Outline: types, functions, components and values show up in the Outline view and in Go to Symbol in Editor.
  • Snippets (type nx to list them) for elements, unions, if, for, match and braced values.
  • Comment toggling, bracket matching and auto-closing pairs.

The language server ships inside the extension, so there is nothing else to install. It is packaged for Windows (x64), macOS (Apple silicon) and Linux (x64).

Settings

SettingDefaultDescription
nx.server.pathemptyPath to an nx-lsp executable to use in place of the packaged one, for example a build of your own.

Editor assets for other editors: @nx-lang/language

The same grammar, language configuration and snippets are published to npm as @nx-lang/language, for web editors such as Monaco or Shiki. It needs no VS Code install.

pnpm add @nx-lang/language
import grammar from '@nx-lang/language/grammar';
import markdownCodeBlockGrammar from '@nx-lang/language/markdown-codeblock-grammar';
import languageConfiguration from '@nx-lang/language/language-configuration';
import snippets from '@nx-lang/language/snippets';
Import pathContents
@nx-lang/language/grammarThe NX TextMate grammar (source.nx)
@nx-lang/language/markdown-codeblock-grammarThe injection grammar for ```nx blocks in Markdown
@nx-lang/language/language-configurationComments, brackets and auto-closing pairs
@nx-lang/language/snippetsThe snippets

版本与发布记录

@nx-lang/language 共发布 10 个版本,首次发布于 2026/09/15;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.10.0latest2026/11/021 天前
0.9.02026/10/268 天前
0.8.02026/10/1816 天前
0.7.02026/10/1024 天前
0.6.02026/10/0628 天前
0.5.02026/09/291 个月前

关于 @nx-lang/language 的常见问题

@nx-lang/language 是什么?

可重用的TextMate语法、语言配置和NX语言的代码片段。

如何安装 @nx-lang/language?

在项目目录运行 npm install @nx-lang/language,或使用 pnpm add / yarn add / bun add。

@nx-lang/language 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/nx-lang__language 是否存在。

@nx-lang/language 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@nx-lang/language 可以商用吗?

@nx-lang/language 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@nx-lang/language 还在维护吗?

最新版本 0.10.0 发布于 2026/11/02(1 天前);至今共发布 10 个版本,其中过去 12 个月发布了 10 个;首次发布于 2026/09/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。