Repository navigation
docs(plugins): 写明后端决定启动方式的语言服务器在立即生效的设置变化时重新调用启动函数取配置 - #176
Merged
Merged
Conversation
This was referenced Nov 23, 2026
xiaoyumuxi
marked this pull request as ready for review
November 23, 2026 04:45
13 of 16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
后端决定启动方式(
launch.kind: "backend")的语言服务器,启动函数的应答可以自带workspaceConfiguration,例如 Python Support 1.0.0 起在应答里给 Pyrefly 发送「工具链」解析出的python.pythonPath和按设置换算出的 Pyrefly 设置。契约只写了“immediate设置变化时宿主用lsp.updateWorkspaceConfiguration推送新值”,没有写这个新值从哪来。桌面端因此总是发送清单里声明的展开,整体替换掉应答里的配置(1lck/Lithe-IDEA#2319)。这个 PR 只补文档,把桌面端修复采用的行为写进契约。Core 代码不变:
plugins.languageServers.decodeLaunch在应答不带workspaceConfiguration时本来就用声明的展开补上。改动
workspaceConfiguration的服务器,新值由启动函数重新给出,不用声明的展开。immediate设置变化时,宿主用这次启动的目录、工作区context和新的settings再调用一次function,同样解码,只发送计划里的workspaceConfiguration,其余部分等下次启动。所以这类函数每次启动可能被调用多次,安装或下载只应在缺少时进行。应答不带workspaceConfiguration时,宿主发送声明的展开,不再调用函数。reference/domains/languages.md(中英):工作区配置一段补同样的说明,后端启动表新增“设置立即生效”一行。reference/domains/settings.md(中英):immediate规则后补一句,后端决定启动方式的启动函数也会收到immediate设置,变化时只有它重新给出的workspaceConfiguration立即生效。languageServers0 内的说明补充)。宿主方法
对现有插件的影响
rustAnalyzer.launch的应答不带workspaceConfiguration,宿主不会再调用它(它可能执行rustup component add),行为不变。验证
node shared/plugins/scripts/verify-docs.mjs:通过。