-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Description
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 openaiimport OpenAI from 'openai'; type Foo = OpenAI.Chat.Completion- cmd-click on "Completion"
- observe a dialog pop up, offering you the interface
Completionor the namespaceCompletion
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).