Skip to content

Commit 8fc4a34

Browse files
author
Astitv Shandilya
committed
Fix: Spacing issues and yarn.lock file, vscode engine versions
1 parent 7cb83ed commit 8fc4a34

File tree

11 files changed

+8241
-471
lines changed

11 files changed

+8241
-471
lines changed
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
2-
// See http://go.microsoft.com/fwlink/?LinkId=827846
3-
// for the documentation about the extensions.json format
4-
"recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher", "ms-vscode.extension-test-runner"]
5-
}
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"dbaeumer.vscode-eslint",
6+
"amodio.tsl-problem-matcher",
7+
"ms-vscode.extension-test-runner"
8+
]
9+
}

patched-vscode/extensions/post-startup-notifications/.vscode/launch.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
// Hover to view descriptions of existing attributes.
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
{
6-
"version": "0.2.0",
7-
"configurations": [
8-
{
9-
"name": "Run Extension",
10-
"type": "extensionHost",
11-
"request": "launch",
12-
"args": [
13-
"--extensionDevelopmentPath=${workspaceFolder}"
14-
],
15-
"outFiles": [
16-
"${workspaceFolder}/dist/**/*.js"
17-
],
18-
"preLaunchTask": "${defaultBuildTask}"
19-
}
20-
]
21-
}
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
],
15+
"outFiles": [
16+
"${workspaceFolder}/dist/**/*.js"
17+
],
18+
"preLaunchTask": "${defaultBuildTask}"
19+
}
20+
]
21+
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
3-
"files.exclude": {
4-
"out": false, // set this to true to hide the "out" folder with the compiled JS files
5-
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
6-
},
7-
"search.exclude": {
8-
"out": true, // set this to false to include "out" folder in search results
9-
"dist": true // set this to false to include "dist" folder in search results
10-
},
11-
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
12-
"typescript.tsc.autoDetect": "off"
13-
}
3+
"files.exclude": {
4+
"out": false, // set this to true to hide the "out" folder with the compiled JS files
5+
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
6+
},
7+
"search.exclude": {
8+
"out": true, // set this to false to include "out" folder in search results
9+
"dist": true // set this to false to include "dist" folder in search results
10+
},
11+
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
12+
"typescript.tsc.autoDetect": "off"
13+
}
Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
// See https://go.microsoft.com/fwlink/?LinkId=733558
22
// for the documentation about the tasks.json format
33
{
4-
"version": "2.0.0",
5-
"tasks": [
6-
{
7-
"type": "npm",
8-
"script": "watch",
9-
"problemMatcher": "$ts-webpack-watch",
10-
"isBackground": true,
11-
"presentation": {
12-
"reveal": "never",
13-
"group": "watchers"
14-
},
15-
"group": {
16-
"kind": "build",
17-
"isDefault": true
18-
}
19-
},
20-
{
21-
"type": "npm",
22-
"script": "watch-tests",
23-
"problemMatcher": "$tsc-watch",
24-
"isBackground": true,
25-
"presentation": {
26-
"reveal": "never",
27-
"group": "watchers"
28-
},
29-
"group": "build"
30-
},
31-
{
32-
"label": "tasks: watch-tests",
33-
"dependsOn": [
34-
"npm: watch",
35-
"npm: watch-tests"
36-
],
37-
"problemMatcher": []
38-
}
39-
]
40-
}
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "watch",
9+
"problemMatcher": "$ts-webpack-watch",
10+
"isBackground": true,
11+
"presentation": {
12+
"reveal": "never",
13+
"group": "watchers"
14+
},
15+
"group": {
16+
"kind": "build",
17+
"isDefault": true
18+
}
19+
},
20+
{
21+
"type": "npm",
22+
"script": "watch-tests",
23+
"problemMatcher": "$tsc-watch",
24+
"isBackground": true,
25+
"presentation": {
26+
"reveal": "never",
27+
"group": "watchers"
28+
},
29+
"group": "build"
30+
},
31+
{
32+
"label": "tasks: watch-tests",
33+
"dependsOn": [
34+
"npm: watch",
35+
"npm: watch-tests"
36+
],
37+
"problemMatcher": []
38+
}
39+
]
40+
}
Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
11
{
2-
"name": "post-startup-notifications",
3-
"displayName": "post-startup-notifications",
4-
"description": "Extension for surfacing post startup script status notifications to users",
5-
"version": "0.0.1",
6-
"publisher": "sagemaker",
7-
"license": "MIT",
8-
"engines": {
9-
"vscode": "^1.73.0"
10-
},
11-
"categories": [
12-
"Other"
13-
],
14-
"activationEvents": [
15-
"*"
16-
],
17-
"main": "./dist/extension.js",
18-
"contributes": {
19-
"commands": []
20-
},
21-
"scripts": {
22-
"test": "jest",
23-
"compile": "gulp compile-extension:post-startup-notifications",
24-
"watch": "npm run build-preview && gulp watch-extension:post-startup-notifications",
25-
"vscode:prepublish": "npm run build-ext",
26-
"build-ext": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:post-startup-notifications ./tsconfig.json"
27-
},
28-
"jest": {
29-
"preset": "ts-jest",
30-
"testEnvironment": "node",
31-
"moduleFileExtensions": [
32-
"ts",
33-
"js"
34-
]
35-
},
36-
"devDependencies": {
37-
"@types/jest": "^29.5.14",
38-
"@types/mocha": "^10.0.10",
39-
"@types/node": "20.x",
40-
"@types/vscode": "^1.98.0",
41-
"@typescript-eslint/eslint-plugin": "^8.25.0",
42-
"@typescript-eslint/parser": "^8.25.0",
43-
"@vscode/test-cli": "^0.0.10",
44-
"@vscode/test-electron": "^2.4.1",
45-
"eslint": "^9.21.0",
46-
"jest": "^29.7.0",
47-
"mocha": "^11.1.0",
48-
"ts-jest": "^29.3.0",
49-
"ts-loader": "^9.5.2",
50-
"typescript": "^5.7.3",
51-
"webpack": "^5.98.0",
52-
"webpack-cli": "^6.0.1"
53-
},
54-
"dependencies": {
55-
"chokidar": "^4.0.3"
56-
}
57-
}
2+
"name": "post-startup-notifications",
3+
"displayName": "post-startup-notifications",
4+
"description": "Extension for surfacing post startup script status notifications to users",
5+
"version": "0.0.1",
6+
"publisher": "sagemaker",
7+
"license": "MIT",
8+
"engines": {
9+
"vscode": "^1.98.0"
10+
},
11+
"categories": [
12+
"Other"
13+
],
14+
"activationEvents": [
15+
"*"
16+
],
17+
"main": "./dist/extension.js",
18+
"contributes": {
19+
"commands": []
20+
},
21+
"scripts": {
22+
"test": "jest",
23+
"compile": "gulp compile-extension:post-startup-notifications",
24+
"watch": "npm run build-preview && gulp watch-extension:post-startup-notifications",
25+
"vscode:prepublish": "npm run build-ext",
26+
"build-ext": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:post-startup-notifications ./tsconfig.json"
27+
},
28+
"jest": {
29+
"preset": "ts-jest",
30+
"testEnvironment": "node",
31+
"moduleFileExtensions": [
32+
"ts",
33+
"js"
34+
]
35+
},
36+
"devDependencies": {
37+
"@types/jest": "^29.5.14",
38+
"@types/mocha": "^10.0.10",
39+
"@types/node": "20.x",
40+
"@types/vscode": "^1.98.0",
41+
"@typescript-eslint/eslint-plugin": "^8.25.0",
42+
"@typescript-eslint/parser": "^8.25.0",
43+
"@vscode/test-cli": "^0.0.10",
44+
"@vscode/test-electron": "^2.4.1",
45+
"eslint": "^9.21.0",
46+
"jest": "^29.7.0",
47+
"mocha": "^11.1.0",
48+
"ts-jest": "^29.3.0",
49+
"ts-loader": "^9.5.2",
50+
"typescript": "^5.7.3",
51+
"webpack": "^5.98.0",
52+
"webpack-cli": "^6.0.1"
53+
},
54+
"dependencies": {
55+
"chokidar": "^4.0.3"
56+
}
57+
}

patched-vscode/extensions/post-startup-notifications/src/extension.ts

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,71 +10,71 @@ let watcher: chokidar.FSWatcher;
1010
let outputChannel: vscode.OutputChannel;
1111

1212
export function activate(context: vscode.ExtensionContext) {
13-
// Check if in SageMaker Unified Studio
14-
const envValue = process.env[SERVICE_NAME_ENV_KEY];
13+
// Check if in SageMaker Unified Studio
14+
const envValue = process.env[SERVICE_NAME_ENV_KEY];
1515

16-
if (!envValue || envValue !== SERVICE_NAME_ENV_VALUE) {
17-
return;
18-
}
16+
if (!envValue || envValue !== SERVICE_NAME_ENV_VALUE) {
17+
return;
18+
}
1919

20-
outputChannel = vscode.window.createOutputChannel('SageMaker Unified Studio Post Startup Notifications');
20+
outputChannel = vscode.window.createOutputChannel('SageMaker Unified Studio Post Startup Notifications');
2121

22-
try {
23-
watcher = chokidar.watch(POST_START_UP_STATUS_FILE, {
24-
persistent: true,
25-
ignoreInitial: false,
26-
awaitWriteFinish: {
27-
stabilityThreshold: 2000,
28-
pollInterval: 100
29-
}
30-
});
22+
try {
23+
watcher = chokidar.watch(POST_START_UP_STATUS_FILE, {
24+
persistent: true,
25+
ignoreInitial: false,
26+
awaitWriteFinish: {
27+
stabilityThreshold: 2000,
28+
pollInterval: 100
29+
}
30+
});
3131

32-
watcher.on('add', (path) => {
33-
processStatusFile();
34-
}).on('change', (path) => {
35-
processStatusFile();
36-
}).on('unlink', (path) => {
37-
outputChannel.appendLine(`File ${path} has been removed`);
38-
});
32+
watcher.on('add', (path) => {
33+
processStatusFile();
34+
}).on('change', (path) => {
35+
processStatusFile();
36+
}).on('unlink', (path) => {
37+
outputChannel.appendLine(`File ${path} has been removed`);
38+
});
3939

40-
} catch (error: any) {
41-
outputChannel.appendLine(`Error setting up file watcher: ${error}`);
42-
}
40+
} catch (error: any) {
41+
outputChannel.appendLine(`Error setting up file watcher: ${error}`);
42+
}
4343
}
4444

4545
function processStatusFile() {
46-
try {
47-
const content = fs.readFileSync(POST_START_UP_STATUS_FILE, 'utf8');
48-
const statusData: StatusFile = JSON.parse(content);
46+
try {
47+
const content = fs.readFileSync(POST_START_UP_STATUS_FILE, 'utf8');
48+
const statusData: StatusFile = JSON.parse(content);
4949

50-
// Only show message if status has changed
51-
if (statusData.status && statusData.status !== previousStatus) {
52-
previousStatus = statusData.status;
50+
// Only show message if status has changed
51+
if (statusData.status && statusData.status !== previousStatus) {
52+
previousStatus = statusData.status;
5353

54-
if (statusData.message) {
55-
switch (statusData.status.toLowerCase()) {
56-
case 'error':
57-
vscode.window.showErrorMessage(statusData.message);
58-
break;
59-
case 'in-progress':
60-
default:
61-
vscode.window.showInformationMessage(statusData.message);
54+
if (statusData.message) {
55+
switch (statusData.status.toLowerCase()) {
56+
case 'error':
57+
vscode.window.showErrorMessage(statusData.message);
58+
break;
59+
case 'in-progress':
60+
default:
61+
vscode.window.showInformationMessage(statusData.message);
62+
}
63+
}
64+
}
65+
} catch (error: any) {
66+
if (error.code !== 'ENOENT') {
67+
outputChannel.appendLine(`Error processing status file: ${error.message}`);
6268
}
63-
}
64-
}
65-
} catch (error: any) {
66-
if (error.code !== 'ENOENT') {
67-
outputChannel.appendLine(`Error processing status file: ${error.message}`);
6869
}
69-
}
7070
};
7171

7272
export function deactivate() {
73-
if (watcher) {
74-
watcher.close();
75-
}
76-
outputChannel.appendLine('Status monitor deactivated');
77-
if (outputChannel) {
78-
outputChannel.dispose();
79-
}
73+
if (watcher) {
74+
watcher.close();
75+
}
76+
outputChannel.appendLine('Status monitor deactivated');
77+
if (outputChannel) {
78+
outputChannel.dispose();
79+
}
8080
}

0 commit comments

Comments
 (0)