microsoft / microsoft/TypeScript

Content mapper duplicated inlay hints

Aperta
#64,050 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@andrewbranch ci sta già lavorando.

Dal 27/8/2026.

Needs Investigation
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

🔎 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:

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.