mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
@@ -11,6 +11,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
|
|||||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||||
import { ICommandService, ICommandEvent } from 'vs/platform/commands/common/commands';
|
import { ICommandService, ICommandEvent } from 'vs/platform/commands/common/commands';
|
||||||
import { TelemetryAction, TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys';
|
import { TelemetryAction, TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys';
|
||||||
|
import { Handler } from 'vs/editor/common/editorCommon';
|
||||||
|
|
||||||
export class SqlTelemetryContribution extends Disposable implements IWorkbenchContribution {
|
export class SqlTelemetryContribution extends Disposable implements IWorkbenchContribution {
|
||||||
|
|
||||||
@@ -25,15 +26,26 @@ export class SqlTelemetryContribution extends Disposable implements IWorkbenchCo
|
|||||||
commandService.onWillExecuteCommand(
|
commandService.onWillExecuteCommand(
|
||||||
(e: ICommandEvent) => {
|
(e: ICommandEvent) => {
|
||||||
// Filter out high-frequency events
|
// Filter out high-frequency events
|
||||||
if (!['type',
|
if (![
|
||||||
'deleteLeft', 'deleteRight',
|
'deleteLeft', 'deleteRight', 'lineBreakInsert', 'outdent', 'redo', 'tab', 'undo', 'deleteInsideWord', // From src\vs\editor\browser\coreCommands.ts
|
||||||
'deleteWordLeft', 'deleteWordRight', 'deleteWordStartRight', 'deleteWordEndRight',
|
|
||||||
'setContext',
|
'setContext',
|
||||||
'cut', 'paste', 'undo',
|
Handler.CompositionEnd, Handler.CompositionStart, Handler.CompositionType, Handler.Cut, Handler.Paste,
|
||||||
'tab',
|
Handler.ReplacePreviousChar, Handler.Type,
|
||||||
'selectNextSuggestion'].some(id => id === e.commandId) &&
|
'selectNextSuggestion', 'selectPrevSuggestion',
|
||||||
// Events from src\vs\editor\contrib\wordOperations\wordOperations.ts
|
'acceptSelectedSuggestion', 'acceptAlternativeSelectedSuggestion', 'hideSuggestWidget',
|
||||||
!e.commandId.startsWith('cursor') &&
|
'selectNextSuggestion', 'selectNextPageSuggestion', 'selectLastSuggestion', 'selectPrevSuggestion',
|
||||||
|
'selectPrevPageSuggestion', 'selectFirstSuggestion', 'toggleSuggestionDetails', 'toggleExplainMode', 'toggleSuggestionFocus',
|
||||||
|
'insertBestCompletion', 'insertNextSuggestion', 'insertPrevSuggestion', 'editor.action.resetSuggestSize',
|
||||||
|
'workbench.action.toggleSidebarVisibility', // From src\vs\workbench\browser\actions\layoutActions.ts
|
||||||
|
// Panel actions from src\vs\workbench\browser\parts\panel\panelActions.ts
|
||||||
|
'workbench.action.togglePanel', 'workbench.action.focusPanel', 'workbench.action.previousPanelView',
|
||||||
|
'workbench.action.nextPanelView', 'workbench.action.toggleMaximizedPanel', 'workbench.action.closePanel', 'workbench.action.closeAuxiliaryBar',
|
||||||
|
'workbench.action.movePanelToSidePanel', 'workbench.action.movePanelToSecondarySideBar', 'workbench.action.moveSidePanelToPanel', 'workbench.action.moveSecondarySideBarToPanel'
|
||||||
|
].some(id => id === e.commandId) &&
|
||||||
|
!e.commandId.startsWith('deleteWord') && // Events from src\vs\editor\contrib\wordOperations\wordOperations.ts
|
||||||
|
!e.commandId.startsWith('cursor') && // Events from src\vs\editor\contrib\wordOperations\wordOperations.ts
|
||||||
|
!e.commandId.startsWith('notification') && // Events from src\vs\workbench\browser\parts\notifications\notificationsCommands.ts
|
||||||
|
!e.commandId.startsWith('editor.action') && // All generic editor actions - not details we currently care about
|
||||||
!e.commandId.startsWith('_')) { // Commands starting with _ are internal commands which generally aren't useful to us currently
|
!e.commandId.startsWith('_')) { // Commands starting with _ are internal commands which generally aren't useful to us currently
|
||||||
// Note - this event is duplicated in extHostCommands to also ensure logging of all commands contributed by extensions
|
// Note - this event is duplicated in extHostCommands to also ensure logging of all commands contributed by extensions
|
||||||
telemetryService.sendActionEvent(TelemetryView.Shell, TelemetryAction.adsCommandExecuted, e.commandId);
|
telemetryService.sendActionEvent(TelemetryView.Shell, TelemetryAction.adsCommandExecuted, e.commandId);
|
||||||
|
|||||||
Reference in New Issue
Block a user