Skip to content

Commit

Permalink
Merge branch 'godotengine:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
k-expon authored Nov 26, 2024
2 parents ca396c3 + 6ddf05d commit 4284f58
Show file tree
Hide file tree
Showing 42 changed files with 1,464 additions and 1,039 deletions.
8 changes: 8 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"skipFiles": [
"**/extensionHostProcess.js",
"<node_internals>/**/*.js"
],
"preLaunchTask": "npm: watch",
"env": {
"VSCODE_DEBUG_MODE": true
Expand All @@ -34,6 +38,10 @@
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"skipFiles": [
"**/extensionHostProcess.js",
"<node_internals>/**/*.js"
],
"preLaunchTask": "npm: watch",
"env": {
"VSCODE_DEBUG_MODE": true
Expand Down
48 changes: 48 additions & 0 deletions .vscode/test_files.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"# --- IN ---": {
"scope": "gdscript",
"prefix": "#IN",
"body": [
"# --- IN ---"
],
"description": "Snapshot Test #IN block"
},
"# --- OUT ---": {
"scope": "gdscript",
"prefix": "#OUT",
"body": [
"# --- OUT ---"
],
"description": "Snapshot Test #OUT block"
},
"# --- END ---": {
"scope": "gdscript",
"prefix": "#END",
"body": [
"# --- END ---"
],
"description": "Snapshot Test #END block"
},
"# --- CONFIG ---": {
"scope": "gdscript",
"prefix": [
"#CO",
"#CONFIG"
],
"body": [
"# --- CONFIG ---"
],
"description": "Snapshot Test #CONFIG block"
},
"# --- CONFIG ALL ---": {
"scope": "gdscript",
"prefix": [
"#CA",
"#CONFIG ALL"
],
"body": [
"# --- CONFIG ALL ---"
],
"description": "Snapshot Test #CONFIG ALL block"
},
}
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"linter": {
"rules": {
"style": {
"noUselessElse": "off"
"noUselessElse": "off",
"useImportType": "off"
}
}
}
Expand Down
15 changes: 0 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,21 +296,6 @@
"default": false,
"description": "Whether extra space should be removed from function parameter lists"
},
"godotTools.lsp.serverProtocol": {
"type": [
"string"
],
"enum": [
"ws",
"tcp"
],
"default": "tcp",
"enumDescriptions": [
"Use the WebSocket protocol to connect to Godot 3.2 and Godot 3.2.1",
"Use the TCP protocol to connect to Godot 3.2.2 and newer versions"
],
"description": "The server protocol of the GDScript language server.\nYou must restart VSCode after changing this value."
},
"godotTools.lsp.serverHost": {
"type": "string",
"default": "127.0.0.1",
Expand Down
26 changes: 12 additions & 14 deletions src/debugger/debug_runtime.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SceneTreeProvider } from "./scene_tree_provider";
import path = require("path");
import * as path from "node:path";

import { createLogger } from "../utils";
import { SceneTreeProvider } from "./scene_tree_provider";

const log = createLogger("debugger.runtime");

Expand All @@ -24,9 +25,9 @@ export class GodotStackVars {
public locals: GodotVariable[] = [],
public members: GodotVariable[] = [],
public globals: GodotVariable[] = [],
) { }
) {}

public reset(count: number = 0) {
public reset(count = 0) {
this.locals = [];
this.members = [];
this.globals = [];
Expand Down Expand Up @@ -62,7 +63,7 @@ export class RawObject extends Map<any, any> {
}

export class ObjectId implements GDObject {
constructor(public id: bigint) { }
constructor(public id: bigint) {}

public stringify_value(): string {
return `<${this.id}>`;
Expand All @@ -85,7 +86,7 @@ export class GodotDebugData {
public last_frames: GodotStackFrame[] = [];
public projectPath: string;
public scene_tree?: SceneTreeProvider;
public stack_count: number = 0;
public stack_count = 0;
public stack_files: string[] = [];
public session;

Expand Down Expand Up @@ -126,19 +127,16 @@ export class GodotDebugData {
bps.splice(index, 1);
this.breakpoints.set(pathTo, bps);
const file = `res://${path.relative(this.projectPath, bp.file)}`;
this.session?.controller.remove_breakpoint(
file.replace(/\\/g, "/"),
bp.line,
);
this.session?.controller.remove_breakpoint(file.replace(/\\/g, "/"), bp.line);
}
}
}

public get_all_breakpoints(): GodotBreakpoint[] {
const output: GodotBreakpoint[] = [];
Array.from(this.breakpoints.values()).forEach((bp_array) => {
for (const bp_array of Array.from(this.breakpoints.values())) {
output.push(...bp_array);
});
}
return output;
}

Expand All @@ -150,14 +148,14 @@ export class GodotDebugData {
const breakpoints = this.get_all_breakpoints();
let output = "";
if (breakpoints.length > 0) {
output += " --breakpoints \"";
output += ' --breakpoints "';
breakpoints.forEach((bp, i) => {
output += `${this.get_breakpoint_path(bp.file)}:${bp.line}`;
if (i < breakpoints.length - 1) {
output += ",";
}
});
output += "\"";
output += '"';
}
return output;
}
Expand Down
8 changes: 4 additions & 4 deletions src/debugger/debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,13 @@ export class GodotDebugger implements DebugAdapterDescriptorFactory, DebugConfig
break;
case "number":
if (is_float) {
new_parsed_value = parseFloat(value);
if (isNaN(new_parsed_value)) {
new_parsed_value = Number.parseFloat(value);
if (Number.isNaN(new_parsed_value)) {
return;
}
} else {
new_parsed_value = parseInt(value);
if (isNaN(new_parsed_value)) {
new_parsed_value = Number.parseInt(value);
if (Number.isNaN(new_parsed_value)) {
return;
}
}
Expand Down
Loading

0 comments on commit 4284f58

Please sign in to comment.