Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure and rename settings #376

Merged
merged 14 commits into from
Mar 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ You can use the following settings to configure Godot Tools:

- `editor_path` - The absolute path to the Godot editor executable. _Under Mac OS, this is the executable inside of Godot.app._
- `gdscript_lsp_server_port` - The WebSocket server port of the GDScript language server.
- `check_status` - Check the GDScript language server connection status.
- `checkStatus` - Check the GDScript language server connection status.

#### GDScript Debugger

Expand Down
88 changes: 44 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,51 +46,51 @@
"contributes": {
"commands": [
{
"command": "godot-tool.open_editor",
"command": "godotTools.openEditor",
"title": "Godot Tools: Open workspace with Godot editor"
},
{
"command": "godot-tool.run_project",
"command": "godotTools.runProject",
"title": "Godot Tools: Run workspace as Godot project"
},
{
"command": "godot-tool.run_project_debug",
"command": "godotTools.runProjectDebug",
"title": "Godot Tools: Run workspace as Godot project with visible collision shapes and navigation meshes"
},
{
"command": "godot-tool.list_native_classes",
"command": "godotTools.listNativeClasses",
"title": "Godot Tools: List native classes of godot"
},
{
"command": "godot-tool.open_type_documentation",
"command": "godotTools.openTypeDocumentation",
"title": "Godot Tools: Open Type Documentation"
},
{
"command": "godot-tool.debugger.inspect_node",
"command": "godotTools.debugger.inspectNode",
"title": "Inspect Remote Node",
"icon": {
"light": "resources/light/icon_GUI_visibility_visible.svg",
"dark": "resources/dark/icon_GUI_visibility_visible.svg"
}
},
{
"command": "godot-tool.debugger.refresh_scene_tree",
"command": "godotTools.debugger.refreshSceneTree",
"title": "Refresh",
"icon": {
"light": "resources/light/icon_refresh.svg",
"dark": "resources/dark/icon_refresh.svg"
}
},
{
"command": "godot-tool.debugger.refresh_inspector",
"command": "godotTools.debugger.refreshInspector",
"title": "Refresh",
"icon": {
"light": "resources/light/icon_refresh.svg",
"dark": "resources/dark/icon_refresh.svg"
}
},
{
"command": "godot-tool.debugger.edit_value",
"command": "godotTools.debugger.editValue",
"title": "Edit value",
"icon": {
"light": "resources/light/icon_edit.svg",
Expand Down Expand Up @@ -136,15 +136,15 @@
"title": "Godot Tools: Switch Scene/Script"
},
{
"command": "godot-tool.set_scene_file",
"command": "godotTools.setSceneFile",
"title": "Set as Scene File"
},
{
"command": "godot-tool.copy_resource_path_context",
"command": "godotTools.copyResourcePathContext",
"title": "Copy Resource Path"
},
{
"command": "godot-tool.copy_resource_path",
"command": "godotTools.copyResourcePath",
"title": "Godot Tools: Copy Resource Path"
}
],
Expand All @@ -157,9 +157,9 @@
],
"configuration": {
"type": "object",
"title": "Godot Tools configuration",
"title": "Godot Tools",
"properties": {
"godot_tools.gdscript_lsp_server_protocol": {
"godotTools.lsp.serverProtocol": {
"type": [
"string"
],
Expand All @@ -169,57 +169,57 @@
],
"default": "tcp",
"enumDescriptions": [
"Using WebSocket protocol to connect to Godot 3.2 and Godot 3.2.1",
"Using TCP protocol to connect to Godot 3.2.2 and newer versions"
"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 have restart VSCode editor after change this value."
"description": "The server protocol of the GDScript language server.\nYou must restart VSCode after changing this value."
},
"godot_tools.gdscript_lsp_server_host": {
"godotTools.lsp.serverHost": {
"type": "string",
"default": "127.0.0.1",
"description": "The server host of the GDScript language server"
},
"godot_tools.gdscript_lsp_server_port": {
"godotTools.lsp.serverPort": {
"type": "number",
"default": 6008,
"description": "The server port of the GDScript language server"
},
"godot_tools.editor_path": {
"godotTools.editorPath": {
"type": "string",
"default": "",
"description": "The absolute path to the Godot editor executable"
},
"godot_tools.scene_file_config": {
"godotTools.sceneFileConfig": {
"type": "string",
"default": "",
"description": "The scene file to run"
},
"godot_tools.reconnect_automatically": {
"godotTools.lsp.autoReconnect.enabled": {
"type": "boolean",
"default": true,
"description": "Whether the plugin should attempt to reconnect"
"description": "Whether the plugin should attempt to reconnect to the GDScript language server"
},
"godot_tools.reconnect_cooldown": {
"godotTools.lsp.autoReconnect.cooldown": {
"type": "number",
"default": 3000,
"description": "The number of milliseconds to wait before attempting to reconnect"
},
"godot_tools.reconnect_attempts": {
"godotTools.lsp.autoReconnect.attempts": {
"type": "number",
"default": 10,
"description": "How many times the client will attempt to reconnect"
},
"godot_tools.force_visible_collision_shapes": {
"godotTools.forceVisibleCollisionShapes": {
"type": "boolean",
"default": false,
"description": "Force the project to run with visible collision shapes"
},
"godot_tools.force_visible_nav_mesh": {
"godotTools.forceVisibleNavMesh": {
"type": "boolean",
"default": false,
"description": "Force the project to run with visible navigation meshes"
},
"godot_tools.native_symbol_placement": {
"godotTools.nativeSymbolPlacement": {
"enum": [
"active",
"beside"
Expand All @@ -231,7 +231,7 @@
"default": "beside",
"description": "Where to place the native symbol windows"
},
"godot_tools.scenePreview.previewRelatedScenes": {
"godotTools.scenePreview.previewRelatedScenes": {
"enum": [
"anyFolder",
"sameFolder",
Expand Down Expand Up @@ -353,10 +353,10 @@
"description": "Relative path from the godot.project file to a TSCN file. If launch_scene and launch_game_instance are true, and this file is defined, will launch the specified file instead of looking for an active TSCN file.",
"default": ""
},
"additional_options":{
"type":"string",
"additional_options": {
"type": "string",
"description": "Additional command line arguments.",
"default":""
"default": ""
}
}
}
Expand All @@ -371,7 +371,7 @@
"address": "127.0.0.1",
"launch_game_instance": true,
"launch_scene": false,
"additional_options":""
"additional_options": ""
}
],
"configurationSnippets": [
Expand All @@ -386,7 +386,7 @@
"address": "127.0.0.1",
"launch_game_instance": true,
"launch_scene": false,
"additional_options":""
"additional_options": ""
}
}
]
Expand Down Expand Up @@ -461,18 +461,18 @@
"when": "false"
},
{
"command": "godot-tool.copy_resource_path_context",
"command": "godotTools.copyResourcePathContext",
"when": "false"
}
],
"view/title": [
{
"command": "godot-tool.debugger.refresh_scene_tree",
"command": "godotTools.debugger.refreshSceneTree",
"when": "view == active-scene-tree",
"group": "navigation"
},
{
"command": "godot-tool.debugger.refresh_inspector",
"command": "godotTools.debugger.refreshInspector",
"when": "view == inspect-node",
"group": "navigation"
},
Expand All @@ -489,17 +489,17 @@
],
"view/item/context": [
{
"command": "godot-tool.debugger.inspect_node",
"command": "godotTools.debugger.inspectNode",
"when": "view == active-scene-tree",
"group": "inline"
},
{
"command": "godot-tool.debugger.inspect_node",
"command": "godotTools.debugger.inspectNode",
"when": "view == inspect-node && viewItem == remote_object",
"group": "inline"
},
{
"command": "godot-tool.debugger.edit_value",
"command": "godotTools.debugger.editValue",
"when": "view == inspect-node && viewItem == editable_value",
"group": "inline"
},
Expand Down Expand Up @@ -529,23 +529,23 @@
],
"explorer/context": [
{
"command": "godot-tool.set_scene_file",
"command": "godotTools.setSceneFile",
"group": "2_workspace"
},
{
"command": "godot-tool.copy_resource_path_context",
"command": "godotTools.copyResourcePathContext",
"group": "6_copypath"
}
],
"editor/title/context": [
{
"command": "godot-tool.copy_resource_path_context",
"command": "godotTools.copyResourcePathContext",
"group": "1_godot"
}
],
"editor/context": [
{
"command": "godot-tool.open_type_documentation",
"command": "godotTools.openTypeDocumentation",
"when": "godotTools.context.connectedToEditor",
"group": "navigation@9"
},
Expand Down
16 changes: 6 additions & 10 deletions src/debugger/debug_session.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import {
LoggingDebugSession,
InitializedEvent,
Thread,
Source,
Breakpoint,
Breakpoint, InitializedEvent, LoggingDebugSession, Source, Thread
} from "vscode-debugadapter";
import { DebugProtocol } from "vscode-debugprotocol";
import { Mediator } from "./mediator";
import { get_configuration } from "../utils";
import { GodotDebugData, GodotVariable } from "./debug_runtime";
import { ObjectId, RawObject } from "./variables/variants";
import { Mediator } from "./mediator";
import { SceneTreeProvider } from "./scene_tree/scene_tree_provider";
import { ServerController } from "./server_controller";
import { ObjectId, RawObject } from "./variables/variants";
const { Subject } = require("await-notify");
import fs = require("fs");
import { SceneTreeProvider } from "./scene_tree/scene_tree_provider";
import { get_configuration } from "../utils";

interface LaunchRequestArguments extends DebugProtocol.LaunchRequestArguments {
address: string;
Expand Down Expand Up @@ -238,7 +234,7 @@ export class GodotDebugSession extends LoggingDebugSession {
args.launch_scene,
args.scene_file,
args.additional_options,
get_configuration("scene_file_config", "") || args.scene_file,
get_configuration("sceneFileConfig", "") || args.scene_file,
]);

this.sendResponse(response);
Expand Down
8 changes: 4 additions & 4 deletions src/debugger/debugger_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function register_debugger(context: ExtensionContext) {
);

commands.registerCommand(
"godot-tool.debugger.inspect_node",
"godotTools.debugger.inspectNode",
(element: SceneNode | RemoteProperty) => {
if (element instanceof SceneNode) {
Mediator.notify("inspect_object", [
Expand Down Expand Up @@ -70,11 +70,11 @@ export function register_debugger(context: ExtensionContext) {
}
);

commands.registerCommand("godot-tool.debugger.refresh_scene_tree", () => {
commands.registerCommand("godotTools.debugger.refreshSceneTree", () => {
Mediator.notify("request_scene_tree", []);
});

commands.registerCommand("godot-tool.debugger.refresh_inspector", () => {
commands.registerCommand("godotTools.debugger.refreshInspector", () => {
if (inspector_provider.has_tree()) {
let name = inspector_provider.get_top_name();
let id = inspector_provider.get_top_id();
Expand All @@ -88,7 +88,7 @@ export function register_debugger(context: ExtensionContext) {
});

commands.registerCommand(
"godot-tool.debugger.edit_value",
"godotTools.debugger.editValue",
(property: RemoteProperty) => {
let previous_value = property.value;
let type = typeof previous_value;
Expand Down
6 changes: 3 additions & 3 deletions src/debugger/server_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ export class ServerController {
this.debug_data = debug_data;

if (launch_instance) {
let godot_path: string = utils.get_configuration("editor_path", "godot");
const force_visible_collision_shapes = utils.get_configuration("force_visible_collision_shapes", false);
const force_visible_nav_mesh = utils.get_configuration("force_visible_nav_mesh", false);
let godot_path: string = utils.get_configuration("editorPath", "godot");
const force_visible_collision_shapes = utils.get_configuration("forceVisibleCollisionShapes", false);
const force_visible_nav_mesh = utils.get_configuration("forceVisibleNavMesh", false);

let executable_line = `"${godot_path}" --path "${project_path}" --remote-debug ${address}:${port}`;

Expand Down
6 changes: 6 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { ExtensionContext } from "vscode";
import { GodotTools } from "./godot-tools";
import { shouldUpdateSettings, updateOldStyleSettings, updateStoredVersion } from "./settings_updater";
import debuggerContext = require("./debugger/debugger_context");

let tools: GodotTools = null;

export function activate(context: ExtensionContext) {
if (shouldUpdateSettings(context)) {
updateOldStyleSettings();
}
updateStoredVersion(context);

tools = new GodotTools(context);
tools.activate();
debuggerContext.register_debugger(context);
Expand Down
Loading