Skip to content

Commit f8f35df

Browse files
author
Newton Der
committed
No need for deactivate function
1 parent ca83f64 commit f8f35df

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

patches/sagemaker/sagemaker-idle-extension.diff

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
Index: third-party-src/extensions/sagemaker-idle-extension/README.md
1+
Index: code-editor-src/extensions/sagemaker-idle-extension/README.md
22
===================================================================
33
--- /dev/null
4-
+++ third-party-src/extensions/sagemaker-idle-extension/README.md
4+
+++ code-editor-src/extensions/sagemaker-idle-extension/README.md
55
@@ -0,0 +1,3 @@
66
+# Code Editor Idle Extension
77
+
88
+The Code Editor Idle Extension tracks user activity and logs the last active timestamp (in UTC) to a local file. User activities monitored include file changes, text editor selection changes, and terminal interactions. Additionally, it provides an API endpoint `/api/idle` that returns the lastActiveTimestamp.
99
\ No newline at end of file
10-
Index: third-party-src/extensions/sagemaker-idle-extension/extension-browser.webpack.config.js
10+
Index: code-editor-src/extensions/sagemaker-idle-extension/extension-browser.webpack.config.js
1111
===================================================================
1212
--- /dev/null
13-
+++ third-party-src/extensions/sagemaker-idle-extension/extension-browser.webpack.config.js
13+
+++ code-editor-src/extensions/sagemaker-idle-extension/extension-browser.webpack.config.js
1414
@@ -0,0 +1,17 @@
1515
+/*---------------------------------------------------------------------------------------------
1616
+ * Copyright Amazon.com Inc. or its affiliates. All rights reserved.
@@ -29,10 +29,10 @@ Index: third-party-src/extensions/sagemaker-idle-extension/extension-browser.web
2929
+ extension: './src/extension.ts'
3030
+ },
3131
+});
32-
Index: third-party-src/extensions/sagemaker-idle-extension/extension.webpack.config.js
32+
Index: code-editor-src/extensions/sagemaker-idle-extension/extension.webpack.config.js
3333
===================================================================
3434
--- /dev/null
35-
+++ third-party-src/extensions/sagemaker-idle-extension/extension.webpack.config.js
35+
+++ code-editor-src/extensions/sagemaker-idle-extension/extension.webpack.config.js
3636
@@ -0,0 +1,20 @@
3737
+/*---------------------------------------------------------------------------------------------
3838
+ * Copyright Amazon.com Inc. or its affiliates. All rights reserved.
@@ -54,10 +54,10 @@ Index: third-party-src/extensions/sagemaker-idle-extension/extension.webpack.con
5454
+ extension: './src/extension.ts',
5555
+ }
5656
+});
57-
Index: third-party-src/extensions/sagemaker-idle-extension/package.json
57+
Index: code-editor-src/extensions/sagemaker-idle-extension/package.json
5858
===================================================================
5959
--- /dev/null
60-
+++ third-party-src/extensions/sagemaker-idle-extension/package.json
60+
+++ code-editor-src/extensions/sagemaker-idle-extension/package.json
6161
@@ -0,0 +1,43 @@
6262
+{
6363
+ "name": "sagemaker-idle-extension",
@@ -102,10 +102,10 @@ Index: third-party-src/extensions/sagemaker-idle-extension/package.json
102102
+ "dependencies": {},
103103
+ "repository": {}
104104
+}
105-
Index: third-party-src/extensions/sagemaker-idle-extension/tsconfig.json
105+
Index: code-editor-src/extensions/sagemaker-idle-extension/tsconfig.json
106106
===================================================================
107107
--- /dev/null
108-
+++ third-party-src/extensions/sagemaker-idle-extension/tsconfig.json
108+
+++ code-editor-src/extensions/sagemaker-idle-extension/tsconfig.json
109109
@@ -0,0 +1,10 @@
110110
+{
111111
+ "extends": "../tsconfig.base.json",
@@ -117,10 +117,10 @@ Index: third-party-src/extensions/sagemaker-idle-extension/tsconfig.json
117117
+ "../../src/vscode-dts/vscode.d.ts"
118118
+ ]
119119
+}
120-
Index: third-party-src/extensions/sagemaker-idle-extension/.vscodeignore
120+
Index: code-editor-src/extensions/sagemaker-idle-extension/.vscodeignore
121121
===================================================================
122122
--- /dev/null
123-
+++ third-party-src/extensions/sagemaker-idle-extension/.vscodeignore
123+
+++ code-editor-src/extensions/sagemaker-idle-extension/.vscodeignore
124124
@@ -0,0 +1,11 @@
125125
+.vscode/**
126126
+.vscode-test/**
@@ -133,11 +133,11 @@ Index: third-party-src/extensions/sagemaker-idle-extension/.vscodeignore
133133
+out/**
134134
+cgmanifest.json
135135
+preview-src/**
136-
Index: third-party-src/extensions/sagemaker-idle-extension/src/extension.ts
136+
Index: code-editor-src/extensions/sagemaker-idle-extension/src/extension.ts
137137
===================================================================
138138
--- /dev/null
139-
+++ third-party-src/extensions/sagemaker-idle-extension/src/extension.ts
140-
@@ -0,0 +1,112 @@
139+
+++ code-editor-src/extensions/sagemaker-idle-extension/src/extension.ts
140+
@@ -0,0 +1,108 @@
141141
+import * as vscode from "vscode";
142142
+import * as fs from "fs";
143143
+import * as path from "path";
@@ -153,18 +153,14 @@ Index: third-party-src/extensions/sagemaker-idle-extension/src/extension.ts
153153
+ startMonitoringTerminalActivity();
154154
+}
155155
+
156-
+export function deactivate() {
157-
+ if(terminalActivityInterval) {
158-
+ clearInterval(terminalActivityInterval)
159-
+ }
160-
+}
156+
+export function deactivate() {}
161157
+
162158
+/**
163159
+ * Initializes the file path where the idle timestamp will be stored.
164160
+ * It sets the path to a hidden file in the /tmp/ directory.
165161
+ */
166162
+function initializeIdleFilePath() {
167-
+ const tmpDirectory = "/tmp/";
163+
+ const tmpDirectory = "/tmp/";
168164
+ idleFilePath = path.join(tmpDirectory, ".sagemaker-last-active-timestamp");
169165
+
170166
+ // Set initial lastActivetimestamp
@@ -251,10 +247,10 @@ Index: third-party-src/extensions/sagemaker-idle-extension/src/extension.ts
251247
+ fs.writeFileSync(idleFilePath, timestamp);
252248
+}
253249
\ No newline at end of file
254-
Index: third-party-src/build/gulpfile.extensions.js
250+
Index: code-editor-src/build/gulpfile.extensions.js
255251
===================================================================
256-
--- third-party-src.orig/build/gulpfile.extensions.js
257-
+++ third-party-src/build/gulpfile.extensions.js
252+
--- code-editor-src.orig/build/gulpfile.extensions.js
253+
+++ code-editor-src/build/gulpfile.extensions.js
258254
@@ -61,6 +61,7 @@ const compilations = [
259255
'extensions/search-result/tsconfig.json',
260256
'extensions/simple-browser/tsconfig.json',
@@ -263,10 +259,10 @@ Index: third-party-src/build/gulpfile.extensions.js
263259
'extensions/tunnel-forwarding/tsconfig.json',
264260
'extensions/typescript-language-features/test-workspace/tsconfig.json',
265261
'extensions/typescript-language-features/web/tsconfig.json',
266-
Index: third-party-src/build/npm/dirs.js
262+
Index: code-editor-src/build/npm/dirs.js
267263
===================================================================
268-
--- third-party-src.orig/build/npm/dirs.js
269-
+++ third-party-src/build/npm/dirs.js
264+
--- code-editor-src.orig/build/npm/dirs.js
265+
+++ code-editor-src/build/npm/dirs.js
270266
@@ -39,6 +39,7 @@ const dirs = [
271267
'extensions/php-language-features',
272268
'extensions/references-view',
@@ -275,10 +271,10 @@ Index: third-party-src/build/npm/dirs.js
275271
'extensions/search-result',
276272
'extensions/simple-browser',
277273
'extensions/tunnel-forwarding',
278-
Index: third-party-src/src/vs/server/node/webClientServer.ts
274+
Index: code-editor-src/src/vs/server/node/webClientServer.ts
279275
===================================================================
280-
--- third-party-src.orig/src/vs/server/node/webClientServer.ts
281-
+++ third-party-src/src/vs/server/node/webClientServer.ts
276+
--- code-editor-src.orig/src/vs/server/node/webClientServer.ts
277+
+++ code-editor-src/src/vs/server/node/webClientServer.ts
282278
@@ -3,7 +3,7 @@
283279
* Licensed under the MIT License. See License.txt in the project root for license information.
284280
*--------------------------------------------------------------------------------------------*/
@@ -336,3 +332,5 @@ Index: third-party-src/src/vs/server/node/webClientServer.ts
336332
+ }
337333
+ }
338334
}
335+
336+

0 commit comments

Comments
 (0)