diff --git a/README.md b/README.md index 9b20c89..23bafc6 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,9 @@ > 6477e9a 或更新版本的桌面端([1lck/Lithe-IDEA#1964](https://github.com/1lck/Lithe-IDEA/pull/1964)), > 在插件详情里安装 gopls 和 dlv 需要固定了 Core c550c2b 或更新版本、支持 `commandInstallers` 的桌面端 > ([1lck/Lithe-IDEA#1971](https://github.com/1lck/Lithe-IDEA/pull/1971))。1.0.1 起作为正式版本发布并收录到 Lithe Store; -> 没有这些能力的桌面端会从 Store 装到 0.0.1。 +> 没有这些能力的桌面端会从 Store 装到 0.0.1。语言服务器的 `indexingExclusions` 声明需要固定了包含 +> [Lithe-core-rust#68](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/68) 的 Core 的桌面端, +> 更早的桌面端不认识这个字段,会拒绝整份清单。 ## 功能 @@ -151,6 +153,10 @@ darwin 包同时支持 Apple Silicon 和 Intel Mac,windows 包同时支持 Win - 运行入口由 Lithe 从模型里的 `main` 包生成:每个带 `application` 标签的包一条,名称是导入路径的最后一段。 - gopls 由 Lithe 按 `languageServers` 的声明启动,插件设置通过 `workspaceConfiguration` 里的 `${setting:}` 传给它。 +- 用户排除在索引之外的目录(以及被排除的 Git 忽略目录),由 Lithe 按 `indexingExclusions` 的声明追加到 gopls + 读到的 `gopls.directoryFilters` 末尾:每个目录写成 `-<相对路径>`,工作区根目录写成 `-`;配置里没有 + `directoryFilters` 时从 gopls 的默认值 `-**/node_modules` 开始。目录名含 `*`、`?`、`[`、`]`、`{`、`}` + 的不写入,以免误排除别的目录。排除的目录变化时,正在运行的 gopls 会收到新的配置。 - Delve 由 Lithe 按 `debugAdapters` 的声明启动为 `dlv dap`。Delve 在标准输出打印 `DAP server listening at: <地址>`,Lithe 读到这一行后连接这个本机地址(`tcpAnnounced` 传输)。 调试的包由当前文件所在目录决定(`target.directory` 绑定到 Delve 的 `program`)。 diff --git a/docs/feature-matrix.md b/docs/feature-matrix.md index b189967..bc9e110 100644 --- a/docs/feature-matrix.md +++ b/docs/feature-matrix.md @@ -27,7 +27,8 @@ ## go-support-plugin **能力**:用用户自己的 `gopls` 提供代码智能,缺少 gopls 时可以在插件详情的能力卡片上安装;用声明式 `buildSystems` 识别 Go 模块,在构建窗口里列出包, -运行 `go build`、`go vet`、`go test` 和 `go run`,列出模块依赖;插件设置调整 `go` 路径和 gopls 选项。 +运行 `go build`、`go vet`、`go test` 和 `go run`,列出模块依赖;插件设置调整 `go` 路径和 gopls 选项; +`indexingExclusions` 让宿主把排除在索引之外的目录写进 gopls 的 `directoryFilters`。 没有设置 `go` 路径时,构建用 `toolDefinitions` 里的 `go` 工具定义解析 Go:项目固定的 Go、全局默认、`GOROOT`、 `PATH` 里的 `go`、在常见位置找到的最新安装。 @@ -44,7 +45,8 @@ 确认工具定义找到 `PATH` 里那个 go 的 GOROOT 和版本。 - `e2e/host/desktop/internal/workbench/official_go_plugin_e2e_test.go`:宿主端到端测试。 -**依赖的宿主能力**:`languageServers`(宿主启动 gopls 并转发 `workspace/configuration`)、`buildSystems` +**依赖的宿主能力**:`languageServers`(宿主启动 gopls 并转发 `workspace/configuration`;`indexingExclusions` +需要固定了 Lithe-core-rust#68 的桌面端,之前 gopls 的排除目录写死在 Core 里)、`buildSystems` (构建窗口识别实例、读取模型、运行命令任务和运行入口、运行测试)、`settings`(插件设置页和设置生效方式)、 `commandInstallers`(Lithe-core-rust#53,Core c550c2b;宿主在 1lck/Lithe-IDEA#1971 检测缺少的命令并提供安装按钮)。 宿主 [1lck/Lithe-IDEA@059d878d4](https://github.com/1lck/Lithe-IDEA/blob/059d878d4284e1a1fd218aeaa56c29d9753d4dfa/desktop/internal/pluginhost/pluginhost.go) diff --git a/io.github.lithe-idea.go-support/plugin.json b/io.github.lithe-idea.go-support/plugin.json index ef9e355..db53d73 100644 --- a/io.github.lithe-idea.go-support/plugin.json +++ b/io.github.lithe-idea.go-support/plugin.json @@ -161,6 +161,15 @@ "usePlaceholders": "${setting:usePlaceholders}", "hoverKind": "${setting:hoverKind}" } + }, + "indexingExclusions": { + "section": "gopls.directoryFilters", + "entry": "-${path}", + "rootEntry": "-", + "default": [ + "-**/node_modules" + ], + "pathSyntax": "glob" } } ],