-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Symbol NavigationRelates to go-to-definition, find-all-references, highlighting/occurrences.Relates to go-to-definition, find-all-references, highlighting/occurrences.Help WantedYou can do thisYou can do this
Milestone
Description
🔎 Search Terms
I am part of the VS Code team. Recently we received the following issue in VS Code microsoft/vscode#268627 which asked why the editor sticky scroll in VS Code shows unexpected lines depending on the form of the exported variable. In TS files, the editor sticky scroll is normally based on the outline model from TypeScript. The user has given examples of code that produce different outline models. Consider the file below:
export const foo = {
foo: {
bar: {
baz: {
qux: {
quux: {
}
}
}
}
}
}
export default {
foo: {
bar: {
baz: {
qux: {
quux: {
}
}
}
}
}
}
export default ({
foo: {
bar: {
baz: {
qux: {
quux: {
}
}
}
}
}
})
type Type = typeof foo;
export default {
foo: {
bar: {
baz: {
qux: {
quux: {
}
}
}
}
}
} as Type;
export default {
foo: {
bar: {
baz: {
qux: {
quux: {
}
}
}
}
}
} satisfies Type;
You can see the outline models as shown in the outline view in VS Code. I was wondering why the last 4 cases don't produce the same outline model as the first two cases ?

🕗 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
// Your code here
🙁 Actual behavior
This is more a discussion issue than an actual issue
🙂 Expected behavior
This is more a discussion issue than an actual issue
Additional information about the issue
No response
otomadMartinJohns
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Symbol NavigationRelates to go-to-definition, find-all-references, highlighting/occurrences.Relates to go-to-definition, find-all-references, highlighting/occurrences.Help WantedYou can do thisYou can do this