Skip to content

Outline model discussion #62609

@aiday-mar

Description

@aiday-mar

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

Image

🕗 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Symbol NavigationRelates to go-to-definition, find-all-references, highlighting/occurrences.Help WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions