Skip to content

Commit d926c7f

Browse files
committed
vscode-extension: update dependencies, including typescript
Start using ~ for typescript version because updates might include breaking changes
1 parent c2d2405 commit d926c7f

17 files changed

+1778
-835
lines changed

vscode-extension/package-lock.json

Lines changed: 1704 additions & 774 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vscode-extension/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@
4040
"devDependencies": {
4141
"@rgrove/parse-xml": "^4.2.0",
4242
"@types/mocha": "^10.0.10",
43-
"@types/node": "^18.19.78",
43+
"@types/node": "^18.19.124",
4444
"@types/vscode": "^1.82.0",
4545
"@vscode/vsce": "^3.2.2",
4646
"glob": "^8.1.0",
4747
"json5": "^2.2.3",
4848
"mocha": "^11.1.0",
4949
"ts-loader": "^9.5.2",
50-
"typescript": "^5.8.2",
50+
"typescript": "~5.9.2",
5151
"vscode-jsonrpc": "^8.2.1",
5252
"vscode-languageclient": "^9.0.1",
53-
"webpack": "^5.98.0",
53+
"webpack": "^5.101.3",
5454
"webpack-cli": "^6.0.1"
5555
},
5656
"activationEvents": [

vscode-extension/src/main/ts/commands/selectWorkspaceSDK.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export default function selectWorkspaceSDK(
212212
);
213213
}
214214
//if the user has defined search paths for SDKs, include them
215-
let searchPaths = vscode.workspace
215+
const searchPaths = vscode.workspace
216216
.getConfiguration("as3mxml")
217217
.get("sdk.searchPaths");
218218
if (Array.isArray(searchPaths)) {

vscode-extension/src/main/ts/extension.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ function getValidatedEditorSDKConfiguration(
8686
if (!savedContext) {
8787
return null;
8888
}
89-
let result = vscode.workspace
89+
let result: string | undefined | null = vscode.workspace
9090
.getConfiguration("as3mxml")
91-
.get("sdk.editor") as string;
91+
.get("sdk.editor");
9292
//this may return null
9393
return validateEditorSDK(
9494
savedContext.extensionPath,
@@ -113,9 +113,9 @@ function onDidChangeConfiguration(event: vscode.ConfigurationChangeEvent) {
113113
) {
114114
//we're going to try to kill the language server and then restart
115115
//it with the new settings
116-
const javaSettingsPath = vscode.workspace
116+
const javaSettingsPath: string | undefined | null = vscode.workspace
117117
.getConfiguration("as3mxml")
118-
.get("java.path") as string;
118+
.get("java.path");
119119
javaExecutablePath = findJava(javaSettingsPath, (javaPath) => {
120120
if (!savedContext) {
121121
return false;
@@ -132,9 +132,8 @@ function onDidChangeConfiguration(event: vscode.ConfigurationChangeEvent) {
132132
if (needsSDKUpdate || event.affectsConfiguration("as3mxml.sdk.framework")) {
133133
frameworkSDKHome = getFrameworkSDKPathWithFallbacks();
134134
if (!frameworkSDKHome) {
135-
let explicitFrameworkSetting = vscode.workspace
136-
.getConfiguration("as3mxml")
137-
.get("sdk.framework") as string;
135+
const explicitFrameworkSetting: string | undefined | null =
136+
vscode.workspace.getConfiguration("as3mxml").get("sdk.framework");
138137
needsRestart = !explicitFrameworkSetting;
139138
}
140139
needsSDKUpdate = true;
@@ -258,9 +257,9 @@ function restartServer() {
258257
export function activate(context: vscode.ExtensionContext) {
259258
savedContext = context;
260259
checkForProjectsToImport();
261-
let javaSettingsPath = vscode.workspace
260+
const javaSettingsPath: string | undefined | null = vscode.workspace
262261
.getConfiguration("as3mxml")
263-
.get("java.path") as string;
262+
.get("java.path");
264263
javaExecutablePath = findJava(javaSettingsPath, (javaPath) => {
265264
return validateJava(context.extensionPath, javaPath);
266265
});
@@ -578,16 +577,16 @@ export function deactivate() {
578577
}
579578

580579
function hasInvalidJava(): boolean {
581-
let javaPath = vscode.workspace
580+
const javaPath: string | undefined | null = vscode.workspace
582581
.getConfiguration("as3mxml")
583-
.get("java.path") as string;
582+
.get("java.path");
584583
return !javaExecutablePath && javaPath != null;
585584
}
586585

587586
function hasInvalidEditorSDK(): boolean {
588-
let sdkPath = vscode.workspace
587+
const sdkPath: string | undefined | null = vscode.workspace
589588
.getConfiguration("as3mxml")
590-
.get("sdk.editor") as string;
589+
.get("sdk.editor");
591590
return !editorSDKHome && sdkPath != null;
592591
}
593592

@@ -680,9 +679,9 @@ function startClient() {
680679
if (process.platform === "darwin") {
681680
args.unshift("-Dapple.awt.UIElement=true");
682681
}
683-
let jvmargsString = vscode.workspace
682+
let jvmargsString: string | undefined | null = vscode.workspace
684683
.getConfiguration("as3mxml")
685-
.get("languageServer.jvmargs") as string;
684+
.get("languageServer.jvmargs");
686685
if (jvmargsString) {
687686
let jvmargs = jvmargsString.split(" ");
688687
args.unshift(...jvmargs);

vscode-extension/src/main/ts/utils/ActionScriptTaskProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ export default class ActionScriptTaskProvider
736736
) {
737737
options.push("--verbose=true");
738738
}
739-
let jvmargs = vscode.workspace
739+
const jvmargs = vscode.workspace
740740
.getConfiguration("as3mxml")
741741
.get("asconfigc.jvmargs");
742742
if (typeof jvmargs === "string") {

vscode-extension/src/main/ts/utils/BaseAsconfigTaskProvider.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ export default class BaseAsconfigTaskProvider {
111111
if (fs.existsSync(winPath)) {
112112
return [winPath];
113113
}
114-
let useBundled = <string>(
115-
vscode.workspace.getConfiguration("as3mxml").get("asconfigc.useBundled")
116-
);
114+
const useBundled = vscode.workspace
115+
.getConfiguration("as3mxml")
116+
.get("asconfigc.useBundled");
117117
if (!useBundled) {
118118
//use an executable on the system path
119119
return [executableName];
@@ -126,9 +126,9 @@ export default class BaseAsconfigTaskProvider {
126126
if (fs.existsSync(unixPath)) {
127127
return [unixPath];
128128
}
129-
let useBundled = <string>(
130-
vscode.workspace.getConfiguration("as3mxml").get("asconfigc.useBundled")
131-
);
129+
const useBundled = vscode.workspace
130+
.getConfiguration("as3mxml")
131+
.get("asconfigc.useBundled");
132132
if (!useBundled) {
133133
//use an executable on the system path
134134
return [executableName];

vscode-extension/src/main/ts/utils/findAnimate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ const ADOBE_FOLDERS_WINDOWS = [
3131
const EXE_NAMES_WINDOWS = ["Animate.exe", "Flash.exe"];
3232

3333
export default function findAnimate(): string | null {
34-
let settingsPath = vscode.workspace
34+
const settingsPath: string | undefined | null = vscode.workspace
3535
.getConfiguration("as3mxml")
36-
.get("sdk.animate") as string;
36+
.get("sdk.animate");
3737
if (settingsPath) {
3838
if (
3939
process.platform === "win32" &&

vscode-extension/src/main/ts/utils/findJava.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ limitations under the License.
1616
import * as path from "path";
1717

1818
export default function findJava(
19-
settingsPath: string,
19+
settingsPath: string | undefined | null,
2020
validate: (javaPath: string) => boolean
2121
): string | null {
2222
if (settingsPath) {
@@ -34,21 +34,25 @@ export default function findJava(
3434
}
3535

3636
if ("JAVA_HOME" in process.env) {
37-
let javaHome = <string>process.env.JAVA_HOME;
38-
let javaPath = path.join(javaHome, "bin", executableFile);
39-
if (validate(javaPath)) {
40-
return javaPath;
37+
let JAVA_HOME = process.env.JAVA_HOME;
38+
if (JAVA_HOME) {
39+
let javaPath = path.join(JAVA_HOME, "bin", executableFile);
40+
if (validate(javaPath)) {
41+
return javaPath;
42+
}
4143
}
4244
}
4345

4446
if ("PATH" in process.env) {
45-
let PATH = <string>process.env.PATH;
46-
let paths = PATH.split(path.delimiter);
47-
let pathCount = paths.length;
48-
for (let i = 0; i < pathCount; i++) {
49-
let javaPath = path.join(paths[i], executableFile);
50-
if (validate(javaPath)) {
51-
return javaPath;
47+
const PATH = process.env.PATH;
48+
if (PATH) {
49+
let paths = PATH.split(path.delimiter);
50+
let pathCount = paths.length;
51+
for (let i = 0; i < pathCount; i++) {
52+
let javaPath = path.join(paths[i], executableFile);
53+
if (validate(javaPath)) {
54+
return javaPath;
55+
}
5256
}
5357
}
5458
}

vscode-extension/src/main/ts/utils/findSDKInFlexHomeEnvironmentVariable.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ const ENVIRONMENT_VARIABLE_FLEX_HOME = "FLEX_HOME";
1919

2020
export default function findSDKInFlexHomeEnvironmentVariable(): string | null {
2121
if (ENVIRONMENT_VARIABLE_FLEX_HOME in process.env) {
22-
let flexHome = process.env.FLEX_HOME;
23-
//this may return null
24-
return validateFrameworkSDK(flexHome);
22+
const FLEX_HOME = process.env[ENVIRONMENT_VARIABLE_FLEX_HOME];
23+
if (FLEX_HOME) {
24+
//this may return null
25+
return validateFrameworkSDK(FLEX_HOME);
26+
}
2527
}
2628
return null;
2729
}

vscode-extension/src/main/ts/utils/findSDKInRoyaleHomeEnvVar.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ const ENVIRONMENT_VARIABLE_ROYALE_HOME = "ROYALE_HOME";
1919

2020
export default function findSDKInRoyaleHomeEnvVar(): string | null {
2121
if (ENVIRONMENT_VARIABLE_ROYALE_HOME in process.env) {
22-
let flexHome = process.env.ROYALE_HOME;
23-
//this may return null
24-
return validateFrameworkSDK(flexHome);
22+
let ROYALE_HOME = process.env[ENVIRONMENT_VARIABLE_ROYALE_HOME];
23+
if (ROYALE_HOME) {
24+
//this may return null
25+
return validateFrameworkSDK(ROYALE_HOME);
26+
}
2527
}
2628
return null;
2729
}

0 commit comments

Comments
 (0)