microsoft / microsoft/TypeScript
Content mapper duplicated inlay hints
@andrewbranch 已经在做这个了。
开始于 2026年8月27日。
- 主要语言
- Go
- 星标
- 111k
- 派生
- 14.3k
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 132
描述
### 🔎 Search Terms
inlay hints
content-mapper
### 🕗 Version & Regression Information
I was unable to test this on prior versions because this is newly added
### ⏯ Playground Link
_No response_
### 💻 Code
### 🙁 Actual behavior
When a content mapper splits a statement into multiple spans, the inlay hints result is duplicated. In the inlay hints request, the request range is mapped into multiple ranges and calculated separately. Because the statement is in multiple spans, the hint for that statement is returned multiple times.
Four slash test failed case:
```go
package fourslash_test
import (
"testing"
"github.com/microsoft/TypeScript/tsc/internal/ls/lsutil"
"github.com/microsoft/TypeScript/tsc/internal/testutil"
"github.com/microsoft/TypeScript/tsc/internal/testutil/contentmappertest"
)
func TestContentMapperInlayHints(t *testing.T) {
t.Parallel()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
f, done := newContentMapperFourslash(t, `// @Filename: /app.lisp
(+ 1 2 "oops")
// @Filename: /main.ts
declare function add(a: number, b: number, c: string): number;
`, contentmappertest.LispMapper, ".lisp")
defer done()
f.GoToFile(t, "/app.lisp")
f.VerifyBaselineInlayHints(t, nil /*span*/, &lsutil.UserPreferences{InlayHints: lsutil.InlayHintsPreferences{IncludeInlayParameterNameHints: lsutil.IncludeInlayParameterNameHintsAll}})
}
```
### 🙂 Expected behavior
Probably need to deduplicate when multiple spans map to the inlay hint request range.
### Additional information about the issue
_No response_
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
评估
这个 Issue 还没有评估数据。