-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finalizing design of proposed API for python environments #19841
Conversation
dcffa32
to
b29e964
Compare
src/client/proposedApiTypes.ts
Outdated
* Carries environments found by the extension at the time of fetching the property. Note a refresh might be | ||
* going on so this may not be the complete list. | ||
*/ | ||
readonly environments: Environment[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be called all
? E.g today the fully qualified name is pythonExtApi.environment.environments
which is a bit funny. IMO environment.all
or something similar reads more fluent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also strongly suggesting to mark this a readonly-array via readonly Environment[]
so that extensions don't start to the remove/add elements. Guard the implementation via Object.freeze
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, agreed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great progress. Thanks! Left some nit and suggestions. A broader observation is to mark data that the API gives to consumers as readonly, like readonly-properties and readonly-arrays. That prevents accidential modifications of the API's state
I'm quite happy with how this has turned out, thanks for all the help! We eventually plan to publish this as a npm types package so it's easier for other extensions to access this. |
85fcc73
to
b5769ff
Compare
42356e3
to
7303339
Compare
…19841) Closes microsoft#19101 closes microsoft#18973 Co-authored-by: Karthik Nadig <[email protected]>
…vscode-python#19841) Closes microsoft/vscode-python#19101 closes #18973 Co-authored-by: Karthik Nadig <[email protected]>
Closes #19101 closes #18973