Skip to content

Tooling Language Server

Liu.Yandong.Hanks edited this page Aug 19, 2026 · 2 revisions

语言服务器

Language Server

工具链

Tooling

Language Server 是基于 stdio 的 LSP 服务器。它为 .as 文件提供语法与语义诊断、补全、悬停说明、跳转定义、引用、重命名、格式化和语义着色;具体客户端是否显示某项能力取决于该客户端的 LSP 支持。

The language server is a stdio-based LSP server. It provides syntax and semantic diagnostics, completion, hover documentation, go-to-definition, references, rename, formatting, and semantic highlighting for .as files. Whether a client exposes a feature depends on that client's LSP support.

启动

Starting the Server

项目当前将 Language Server 作为 Visual Studio 扩展的一部分发布。若自行集成,请使用已构建的可执行文件作为 stdio server,不要向它写入非 LSP 的日志文本。

The project currently ships the language server as part of the Visual Studio extension. For custom integration, run the built executable as a stdio server and do not write non-LSP log text to its standard output.

dotnet run --project language-tools/AuroraScript.LanguageServer/AuroraScript.LanguageServer.csproj

工作区行为

Workspace Behavior

服务器将已打开文件和工作区内的 .as 文件建立索引。@global(); 声明文件用于提供宿主全局符号的诊断、补全和跳转;它们不是可导入模块。

The server indexes open files and workspace .as files. @global(); declaration files supply diagnostics, completion, and navigation for host globals; they are not importable modules.

@global();

declare func HOST_ADD(left, right);
declare const HOST_NAME;

可见能力

Available Capabilities

  • 诊断:打开含错误的 .as 文件,让客户端显示诊断。
  • 补全:在 Array. 后请求补全。
  • 悬停:悬停 Path.join 查看签名与说明。
  • 定义跳转:在 import 名称或函数调用上跳转。
  • 格式化:调用客户端的 Format Document 命令。
  • Diagnostics: open an invalid .as file and let the client show diagnostics.
  • Completion: request completion after Array..
  • Hover: hover Path.join for its signature and description.
  • Definition: go to definition from an import name or function call.
  • Formatting: invoke the client's Format Document command.

相关页面:语言指南脚本 APIVisual Studio 扩展

Related pages: Language Guide, Script API, and Visual Studio extension.

Clone this wiki locally