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

Added Telemetry for CodeActions (part of refactoring preview) #152081

Merged
merged 2 commits into from
Jun 14, 2022

Conversation

justschen
Copy link
Contributor

Part of #151140

@VSCodeTriageBot VSCodeTriageBot added this to the June 2022 milestone Jun 14, 2022
@mjbvz mjbvz self-requested a review June 14, 2022 15:53
};
type ApplyCodeEventClassification = {
codeActionTitle: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The display label of the applied code action' };
codeActionKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind (refactor, quickfix) of the applied code action' };
codeActionIsPreferred: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Was the code action marked as being a preferred action?' };
context?: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of action used to trigger apply code action.' };
Copy link
Collaborator

Choose a reason for hiding this comment

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

context is pretty generic. Maybe reason?

}
}

export enum applyCodeActionReason {
Copy link
Collaborator

Choose a reason for hiding this comment

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

[nit] We typically start enum names with uppercase

export async function applyCodeAction(
accessor: ServicesAccessor,
item: CodeActionItem,
options?: { preview?: boolean; editor?: ICodeEditor }
options?: { preview?: boolean; editor?: ICodeEditor },
codeActionReason?: applyCodeActionReason,
Copy link
Collaborator

Choose a reason for hiding this comment

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

If anyone starts calling this function, it will be easy for them to forget to pass in a codeActionReason. Can you make this parameter non-optional (you'll have to either change the order of the parameters or make options non-optional too for this)

@justschen justschen merged commit 0593157 into microsoft:main Jun 14, 2022
justschen added a commit to justschen/vscode that referenced this pull request Jun 16, 2022
…Telemetry

Added Telemetry for CodeActions (part of refactoring preview)
@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2022
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

3 participants