-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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
Added Telemetry for CodeActions (part of refactoring preview) #152081
Conversation
}; | ||
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.' }; |
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.
context
is pretty generic. Maybe reason
?
} | ||
} | ||
|
||
export enum applyCodeActionReason { |
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.
[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, |
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.
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)
…Telemetry Added Telemetry for CodeActions (part of refactoring preview)
Part of #151140