Repository navigation
feat: gopls 的索引排除改由清单声明 indexingExclusions - #17
Merged
Merged
Conversation
Lithe 原来在 Core 里按 provider 名字 go 写死 gopls.directoryFilters 的键和写法(Lithe-core-rust#68 删除)。现在由插件声明:排除的目录写成 -<相对路径>,工作区根目录写成 -,没有数组时从 gopls 默认值 -**/node_modules 开始,名字含 glob 通配符的目录不写入,与原来的行为一致。 README 的工作方式和兼容性说明、功能矩阵同步更新。旧桌面端不认识这个字段会拒绝整份清单,所以要等固定了包含 Lithe-core-rust#68 的 Core 的桌面端发布后再发版。 Refs 1lck/Lithe-IDEA#1856
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.
关联 Issue / Linked issue
改动说明 / What changes
Lithe 原来在 Core 里按 provider 名字
go写死 gopls 的索引排除:把用户排除在索引之外的目录写进gopls.directoryFilters。Lithe-core-rust#68 删除了这段特判,改成语言服务器在清单里声明indexingExclusions,Core 只按声明填充。本 PR 给 gopls 补上这份声明。plugin.json:languageServers[0]加-<相对路径>,工作区根目录写成-;配置里没有directoryFilters时从 gopls 的默认值-**/node_modules开始追加;目录名含* ? [ ] { }的不写入。用户自己设置的项保留在前面。README.md:“工作方式”加一条说明;“兼容性”写明这个字段需要固定了包含 Lithe-core-rust#68 的 Core 的桌面端。docs/feature-matrix.md:go-support-plugin的能力和依赖的宿主能力补上indexingExclusions。为什么是 Draft,什么时候可以合入
旧桌面端的
LanguageServerDeclaration拒绝不认识的字段(deny_unknown_fields),会拒绝带indexingExclusions的整份清单。所以顺序是:main;PINNED_CORE_REVISION升到合入后的 commit 并发布;e2e/host/lithe-host.json的revision升到第 2 步的桌面端 commit,跑一遍node scripts/e2e-host.mjs,升版本号写发布说明,然后 ready、合入、发版。第 2 步到第 3 步之间,gopls 拿不到排除目录,会照常索引被排除的目录;宿主仍然不向它发送这些目录里的文档、诊断和文件变化。
验证 / Verification
node scripts/package.mjsLITHE_CORE_RUST_DIR=<Lithe-core-rust#68 分支> LITHE_TEST_GO_PLUGIN_ARCHIVE=dist/go-support-1.0.1-darwin.zip node scripts/e2e-host.mjs --ref cad5656005288a7ef5897abd9d15494d2faf2fde(桌面端main,固定的 Core 957a349 正是 #68 的基点)TestOfficialGoPluginBuildsAndServesAModule:清单被接受,gopls 诊断和 gofumpt 设置照常生效)这次 e2e 的临时模块里没有被排除的目录,所以它证明的是“宿主接受这份清单、gopls 照常工作”;
directoryFilters填出来的内容由 Lithe-core-rust#68 的单元测试按同一份声明断言。e2e/host/lithe-host.json的固定版本没有改,因为还没有包含 #68 的桌面端 commit。Windows 没有在本机执行。