You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue occur when all extensions are disabled?: Yes
VS Code Version: 1.81.1
OS Version: 13.4.1 (c)
Steps to Reproduce:
npm install openai
import OpenAI from 'openai'; type Foo = OpenAI.Chat.Completion
cmd-click on "Completion"
observe a dialog pop up, offering you the interface Completion or the namespace Completion
Desired behavior:
Jump directly to the definition of the interface Completion, since that is how it's being used there.
Context:
Libraries like stripe and openai use the pattern of shadowing interfaces with namespaces when describing large JSON objects generated from their OpenAPI specs.
This was a tradeoff made because the alternatives are worse: you'd otherwise have to generate long, Java-like names (eg; ChatCompletionChoiceMessageFunctionCall), try to come up with minimal names (which could easily clash with future objects, causing backwards-compatibility issues), move all sub-objects into other files (which'd quickly get unreadable), or define all objects inline (which makes it difficult-to-impossible to directly reference object types whose parents are nullable/optional, members of unions, etc).