microsoft / microsoft/TypeScript

Destructured function does not show outline of inner function parameters

Aperta
#63,551 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Awaiting More Feedback Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

### 🔎 Search Terms

outline model

### 🕗 Version & Regression Information

- This changed between versions ______ and _______
- This changed in commit or PR _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
- I was unable to test this on prior versions because _______

### ⏯ Playground Link

_No response_

### 💻 Code

```ts
// Your code here
```

### 🙁 Actual behavior

Essentially for the code:

```
export const [var1, var2] = processLightDarkTokens({
a : {
b : {

}
},
c : {

}
});
```

The outline model returned by TypeScript does not show a, b and c. But for:

```
export const abc = processLightDarkTokens({
a : {
b : {

}
},
c : {

}
});
```

It does.

### 🙂 Expected behavior

I would expect a, b, and c to be visible in the outline model in both cases.

### Additional information about the issue

Hi, I am a developer on the VS Code team, and I recently received the following bug : https://github.com/microsoft/vscode/issues/241563. The bug is that the VS Code editor sticky scroll does not display the expected sticky lines. This happens because the outline model returned by the TypeScript server changes unexpectedly depending on if the function return variable is destructured or not. I attach a screen recording here to show the issue.

Essentially for the code:

```
export const [var1, var2] = processLightDarkTokens({
a : {
b : {

}
},
c : {

}
});
```

The outline does not show a, b and c. But for:

```
export const abc = processLightDarkTokens({
a : {
b : {

}
},
c : {

}
});
```

It does. Is this expected?

https://github.com/user-attachments/assets/1b425011-ae36-4b54-bb75-fc193a3246ba

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.

Direzione di ricerca

Inizia con il modello outline del server TypeScript e riproduci i due esempi di codice dell’issue, confrontando le voci prodotte per un ritorno destrutturato con quelle per una variabile denominata. Traccia il motivo per cui le voci annidate a, b e c vengono omesse nel caso destrutturato e considera conclusa l’issue quando entrambe le forme espongono queste voci in modo coerente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
devtools
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.