Skip to content

Add common service for logging deprecated api usage#88585

Merged
mjbvz merged 4 commits into
microsoft:masterfrom
mjbvz:api-deprecation
Jan 14, 2020
Merged

Add common service for logging deprecated api usage#88585
mjbvz merged 4 commits into
microsoft:masterfrom
mjbvz:api-deprecation

Conversation

@mjbvz

@mjbvz mjbvz commented Jan 14, 2020

Copy link
Copy Markdown
Contributor

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

mjbvz commented Jan 14, 2020

Copy link
Copy Markdown
Contributor Author

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 {

@jrieken jrieken Jan 14, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

Comment thread src/vs/workbench/api/common/extHostApiDeprecationService.ts Outdated
@alexr00

alexr00 commented Jan 14, 2020

Copy link
Copy Markdown
Member

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

mjbvz commented Jan 14, 2020

Copy link
Copy Markdown
Contributor Author

@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

Matt Bierner added 3 commits January 14, 2020 12:25
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.

5 participants