Skip to content
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

Add common service for logging deprecated api usage #88585

Merged
merged 4 commits into from
Jan 14, 2020

Conversation

mjbvz
Copy link
Contributor

@mjbvz mjbvz commented Jan 14, 2020

For #88391

Adds a new ExtHostApiDeprecationService. This service logs a warning and telemetry when a deprecated API is used.

Updates some of the more simple deprecated apis to use this new service

@mjbvz mjbvz self-assigned this Jan 14, 2020
@mjbvz
Copy link
Contributor Author

mjbvz commented Jan 14, 2020

This change doesn't cover deprecations for methods such as TextDocument.show() or constructors such as Task.

The reason is that I do not know how to get the calling extension information info in the implementation code

this._telemetryShape = rpc.getProxy(extHostProtocol.MainContext.MainThreadTelemetry);
}

public report(apiId: string, extension: IExtensionDescription, migrationSuggestion: string): void {
Copy link
Member

@jrieken jrieken Jan 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion to use ExtensionIdentifier only

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also want to log a warning message if the extension is in development mode. For that I believe it needs the full IExtensionDescription

@alexr00
Copy link
Member

alexr00 commented Jan 14, 2020

For the tasks constructor, I could mark the task as having been created using deprecated api, then in the extHostTaskService when reading tasks use IExtensionService to find the extension based on the task definition.

@mjbvz mjbvz added this to the January 2020 milestone Jan 14, 2020
@mjbvz
Copy link
Contributor Author

mjbvz commented Jan 14, 2020

@alexr00 I think you may also run a problem getting access to the deprecation service inside the task constructor. If you know some way to workaround this, feel free to give it a try

For microsoft#88391

Adds a new `ExtHostApiDeprecationService`. This service logs a warning and telemetry when a deprecated API is used.

Updates some of the more simple deprecated apis to use this new service
@mjbvz mjbvz merged commit 3883ebd into microsoft:master Jan 14, 2020
@mjbvz mjbvz deleted the api-deprecation branch January 14, 2020 23:27
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants