File tree Expand file tree Collapse file tree 4 files changed +14
-1
lines changed
Filter options
Expand file tree Collapse file tree 4 files changed +14
-1
lines changed
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ export class PersistentState<T> implements IPersistentState<T> {
108
108
export const GLOBAL_PERSISTENT_KEYS_DEPRECATED = 'PYTHON_EXTENSION_GLOBAL_STORAGE_KEYS' ;
109
109
export const WORKSPACE_PERSISTENT_KEYS_DEPRECATED = 'PYTHON_EXTENSION_WORKSPACE_STORAGE_KEYS' ;
110
110
111
- const GLOBAL_PERSISTENT_KEYS = 'PYTHON_GLOBAL_STORAGE_KEYS' ;
111
+ export const GLOBAL_PERSISTENT_KEYS = 'PYTHON_GLOBAL_STORAGE_KEYS' ;
112
112
const WORKSPACE_PERSISTENT_KEYS = 'PYTHON_WORKSPACE_STORAGE_KEYS' ;
113
113
type KeysStorageType = 'global' | 'workspace' ;
114
114
export type KeysStorage = { key : string ; defaultValue : unknown } ;
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ import { WorkspaceService } from './common/application/workspace';
46
46
import { disposeAll } from './common/utils/resourceLifecycle' ;
47
47
import { ProposedExtensionAPI } from './proposedApiTypes' ;
48
48
import { buildProposedApi } from './proposedApi' ;
49
+ import { GLOBAL_PERSISTENT_KEYS } from './common/persistentState' ;
49
50
50
51
durations . codeLoadingTime = stopWatch . elapsedTime ;
51
52
@@ -116,6 +117,8 @@ async function activateUnsafe(
116
117
// activation starts here
117
118
118
119
// First we initialize.
120
+ const isFirstSession = context . globalState . get ( GLOBAL_PERSISTENT_KEYS , [ ] ) . length === 0 ;
121
+ console . log ( isFirstSession ) ;
119
122
const ext = initializeGlobals ( context ) ;
120
123
activatedServiceContainer = ext . legacyIOC . serviceContainer ;
121
124
// Note standard utils especially experiment and platform code are fundamental to the extension
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export enum EventName {
7
7
FORMAT_ON_TYPE = 'FORMAT.FORMAT_ON_TYPE' ,
8
8
EDITOR_LOAD = 'EDITOR.LOAD' ,
9
9
REPL = 'REPL' ,
10
+ FIRST_SESSION = 'FIRST_SESSION' ,
10
11
CREATE_NEW_FILE_COMMAND = 'CREATE_NEW_FILE_COMMAND' ,
11
12
SELECT_INTERPRETER = 'SELECT_INTERPRETER' ,
12
13
SELECT_INTERPRETER_ENTER_BUTTON = 'SELECT_INTERPRETER_ENTER_BUTTON' ,
Original file line number Diff line number Diff line change @@ -1440,6 +1440,15 @@ export interface IEventNamePropertyMapping {
1440
1440
*/
1441
1441
selection : 'Yes' | 'Maybe later' | "Don't show again" | undefined ;
1442
1442
} ;
1443
+ /**
1444
+ * Telemetry event sent in the very first session of the user. We check whether persistent cache is empty to figure out if it's the first session.
1445
+ */
1446
+ /* __GDPR__
1447
+ "first_session" : {
1448
+ "duration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "karrtikr" }
1449
+ }
1450
+ */
1451
+ [ EventName . FIRST_SESSION ] : never | undefined ;
1443
1452
/**
1444
1453
* Telemetry event sent when starting REPL
1445
1454
*/
You can’t perform that action at this time.
0 commit comments