language-tools

sveltejsMIT活跃维护

Svelte 官方语言服务器及配套编辑器扩展,为 Svelte 组件提供代码补全、类型检查和诊断等智能提示能力。

The Svelte Language Server, and official extensions which use it

[email protected]发布于 2026-11-01 18:03 UTC1,451star264fork同步于 2026-11-10 11:48 UTC

怎么上手

README 里没有找到可直接复制的安装命令

README 里没有找到可直接复制的安装命令,请到 README 或官方文档查看安装方式。

硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Svelte 官方语言服务器与编辑器扩展,为 .svelte 文件提供 LSP 级智能提示

Svelte 官方语言服务器及配套编辑器扩展,为 Svelte 组件提供代码补全、类型检查和诊断等智能提示能力。

核心能力

  • 实现 Language Server Protocol 供各类 IDE 接入
  • 仓库内托管官方 VSCode 扩展
  • 支持 .svelte 文件中的 HTML 与 JavaScript 混合语法
  • 可驱动其他 IDE 的 Svelte 插件

容易踩的坑

README 未给出安装命令,VSCode 用户需从 Marketplace 安装 svelte.svelte-vscode 扩展;其他 IDE 需自行接入 LSP 客户端

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本[email protected]
  1. [email protected]最新正式版2026-11-01 · 2026-11-01 18:03 UTC

    Patch Changes

    • fix: point component declaration maps to the original .svelte file instead of a non-existent .svelte.ts file (#3173)
  2. [email protected]2026-11-01 · 2026-11-01 18:03 UTC
    查看更新说明

    Patch Changes

    • Preserve TypeScript files listed in tsconfig.json when running with --tsgo. (#3146)

    • fix: update --tsgo-experimental-api for typescript 7.1 (#3168)

    • Report a tsconfig parse error instead of an internal error on --incremental and --tsgo runs when the tsconfig path is not normalized. (#3169)

    • fix: type the exports of src/hooks.server with --tsgo-experimental-api (#3154)

  3. [email protected]2026-11-01 · 2026-11-01 18:03 UTC
    查看更新说明

    Patch Changes

    • Hide imports and re-export aliases from document symbols to match VS Code's TypeScript outline. (#3113)

    • Show inlay hints inside a <script> tag that comes after other content in the file. (#3150)

    • fix: type the exports of src/hooks.server with --tsgo-experimental-api (#3154)

    • Updated dependencies [fda3f39]:

  4. [email protected]2026-10-16 · 2026-10-16 13:21 UTC
    查看更新说明

    Patch Changes

    • fix: prevent errors in language service reduced mode (#3110)

    • fix: recognise modern CSS properties such as corner-shape by updating vscode-css-languageservice (#3122)

    • fix: ensure config discovery when the workspace sits under a dot directory. (#3121)

    • fix: resolve symlinked packages when importing their .svelte files, so their types are not duplicated (#3119)

    • fix: fallback to prettier-plugin-svelte version 4 for Svelte 5 (#3117)

    • Hide generated snippet functions from document symbols so they do not appear in the editor outline. (#3114)

    • fix: align default tsconfig "include" logic with tsc/tsserver (#3110)

    • Updated dependencies [7e2f572, 1d367d0, 092af38, b9f3faa, 2394f19]:

  5. [email protected]2026-10-16 · 2026-10-16 13:21 UTC
    查看更新说明

    Patch Changes

    • perf: skip type-checking in emitDts (#3130)

    • fix: ignore noEmitOnError and isolatedDeclarations in emitDts (#3129)

    • perf: use a module resolution cache in emitDts, avoiding a full module resolution walk for every import of every file in the program (#3093)

    • fix: recognise the real <script> and <style> start tags when a matching token also appears inside the other tag (#3079)

    • fix: don't hide $props type argument error (#3126)

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    IDE docs and troubleshooting

    What is Svelte Language Tools?

    Svelte Language Tools contains a library implementing the Language Server Protocol (LSP). LSP powers the VSCode extension, which is also hosted in this repository. Additionally, LSP is capable of powering plugins for numerous other IDEs.

    A .svelte file would look something like this:

    <script>
        let count = $state(1);
    
        let doubled = $derived(count * 2);
        let quadrupled = $derived(doubled * 2);
    
        function handleClick() {
            count += 1;
        }
    </script>
    
    <button onclick="{handleClick}">Count: {count}</button>
    
    <p>{count} * 2 = {doubled}</p>
    <p>{doubled} * 2 = {quadrupled}</p>
    

    Which is a mix of HTMLx and vanilla JavaScript (but with additional runtime behavior coming from the svelte compiler).

    This repo contains the tools which provide editor integrations for Svelte files like this.

    Contributing

    Contributions are encouraged and always welcome. Read the contribution guide for more info and help us out!

    Supporting Svelte

    Svelte is an MIT-licensed open source project with its ongoing development made possible entirely by the support of awesome volunteers. If you'd like to support their efforts, please consider:

    Funds donated via Open Collective will be used for compensating expenses related to Svelte's development such as hosting costs. If sufficient donations are received, funds may also be used to support Svelte's development more directly.

    License

    MIT

    Credits

    • James Birtles for creating the foundation which this language server, and the extensions are built on
    • Vue's Vetur language server which heavily inspires this project
    • halfnelson for creating svelte2tsx
    • jasonlyu123 for his ongoing work in all areas of the language-tools