diff --git a/.vscode/settings.json b/.vscode/settings.json index ed0c728..a4e4286 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "cSpell.enabled": true, "cSpell.words": [ - "cgedebug", + "castleDebug", "cnoc", "FPCDIR", "fpcsrc", diff --git a/README.md b/README.md index 665b440..733b490 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ The extension helps developing Castle Game Engine (CGE) applications: * Simplifies the setup as much as possible by providing: * the ability to automatically configure compilation, build, run and clean the game/application without writing any tasks.json file - * the ability to automatically configure debug by choosing `cgedebug` \(it uses [Free Pascal (fpc) Debugger](https://marketplace.visualstudio.com/items?itemName=CNOC.fpdebug) extension underneath\) without writing any launch.json file + * the ability to automatically configure debug by choosing `castleDebug` \(it uses [Free Pascal (fpc) Debugger](https://marketplace.visualstudio.com/items?itemName=CNOC.fpdebug) extension underneath\) without writing any launch.json file * Pascal Language Server (pasls) automatic configuration system * code completion (e.g. `Ctrl` + `Space`) thanks to Pascal Language Server * current file procedure list (`Ctrl` + `Shift` + `O`): @@ -73,7 +73,7 @@ This extension contributes the following settings: ## Known Issues This the first extension release so we lack some features: -* `cgedebug`/`fpDebug` doesn't work on macOS. +* `castleDebug`/`fpDebug` doesn't work on macOS. * The extension doesn't work in _restricted_ mode. You need to _trust_ the folder. * The extension doesn't support workspaces with multiple folders, where one of them is CGE project. * Show documentation (generated by PasDoc) as a popup in VS Code. diff --git a/package.json b/package.json index b159b55..bd21c22 100644 --- a/package.json +++ b/package.json @@ -48,41 +48,41 @@ ], "debuggers": [ { - "type": "cgedebug" + "type": "castleDebug" } ], "commands": [ { - "command": "castle-engine.compileGame", - "title": "Compile Game (CGE)" + "command": "castle-engine.compile", + "title": "Compile (Castle Game Engine)" }, { - "command": "castle-engine.runGame", - "title": "Run Game (CGE)" + "command": "castle-engine.run", + "title": "Run (Castle Game Engine)" }, { - "command": "castle-engine.cleanGame", - "title": "Clean Game (CGE)" + "command": "castle-engine.clean", + "title": "Clean (Castle Game Engine)" }, { "command": "castle-engine.showBuildModeSelectionInStatusBar", - "title": "Select Build Mode (CGE)" + "title": "Select Build Mode (Castle Game Engine)" }, { "command": "castle-engine.openWorkspaceInCastleEditor", - "title": "Open In Castle Editor (CGE)" + "title": "Open In Castle Editor (Castle Game Engine)" }, { "command": "castle-engine.validateAndOpenSettings", - "title": "Validate and open settings" + "title": "Validate and Open Settings" }, { - "command": "castle-engine.searchInCGEApiReference", - "title": "Search in Api Reference (CGE)" + "command": "castle-engine.searchInApiReference", + "title": "Search in Api Reference (Castle Game Engine)" }, { - "command": "castle-engine.backInCGEApiReference", - "title": "Go back in Api Reference (CGE)" + "command": "castle-engine.backInApiReference", + "title": "Go Back in Api Reference (Castle Game Engine)" } ], "configuration": { @@ -122,7 +122,7 @@ "menus": { "webview/context": [ { - "command": "castle-engine.backInCGEApiReference", + "command": "castle-engine.backInApiReference", "when": "webviewId == 'cge_api_reference'" } ] @@ -152,18 +152,18 @@ ], "keybindings": [ { - "command": "castle-engine.compileGame", + "command": "castle-engine.compile", "key": "ctrl+f9", "mac": "cmd+f9", "when": "editorTextFocus" }, { - "command": "castle-engine.runGame", + "command": "castle-engine.run", "key": "shift+f9", "when": "editorTextFocus" }, { - "command": "castle-engine.searchInCGEApiReference", + "command": "castle-engine.searchInApiReference", "key": "ctrl+f1", "mac": "cmd+f1", "when": "editorTextFocus" diff --git a/src/castleConfiguration.js b/src/castleConfiguration.js index 527c85a..d275d26 100644 --- a/src/castleConfiguration.js +++ b/src/castleConfiguration.js @@ -28,14 +28,14 @@ class CastleConfiguration { this.recompilationNeeded = true; this._commandId = { showBuildModes: 'castle-engine.showBuildModeSelectionInStatusBar', - compileGame: 'castle-engine.compileGame', - runGame: 'castle-engine.runGame', - cleanGame: 'castle-engine.cleanGame', - debugGame: 'workbench.action.debug.start', + compile: 'castle-engine.compile', + run: 'castle-engine.run', + clean: 'castle-engine.clean', + debug: 'workbench.action.debug.start', openInCastleEditor: 'castle-engine.openWorkspaceInCastleEditor', validateAndOpenSettings: 'castle-engine.validateAndOpenSettings', - searchInCGEApiReference: 'castle-engine.searchInCGEApiReference', - backInCGEApiReference: 'castle-engine.backInCGEApiReference' + searchInApiReference: 'castle-engine.searchInApiReference', + backInApiReference: 'castle-engine.backInApiReference' }; this._buildToolPath = ''; this._enginePath = ''; diff --git a/src/castleDebugProvider.js b/src/castleDebugProvider.js index c55a301..44a11bc 100644 --- a/src/castleDebugProvider.js +++ b/src/castleDebugProvider.js @@ -3,13 +3,13 @@ const castleExec = require('./castleExec.js'); const castleConfiguration = require('./castleConfiguration.js'); /** - * Castle Debug Provider that uses fpDebug to start debug session without - * configuration. Just choose "cgedebug" after hiting F5. + * Castle Debug Provider that uses fpDebug to start debug session without + * configuration. Just choose "castleDebug" after hitting F5. */ class CastleDebugProvider { /** - * @param {castleConfiguration.CastleConfiguration} castleConfig + * @param {castleConfiguration.CastleConfiguration} castleConfig */ constructor(castleConfig) { this._castleConfig = castleConfig; @@ -25,13 +25,13 @@ class CastleDebugProvider { if ((config.type == undefined) && (config.request == undefined) && (config.name == undefined)) { - // this._castleConfig.buildToolPath can be changed when - // debug configuration provider is created and + // this._castleConfig.buildToolPath can be changed when + // debug configuration provider is created and // new configuration can be not valid when buildToolPath === '' if (this._castleConfig.buildToolPath === '') return undefined; // abort launch - config.type = 'fpDebug'; // cgedebug is used only as alias for fpDebug + config.type = 'fpDebug'; // castleDebug is used only as alias for fpDebug config.name = 'Debug CGE Game with fpDebug'; config.request = 'launch'; let executableName = await castleExec.executeFileAndReturnValue(this._castleConfig.buildToolPath, ['output', 'executable-name']); @@ -75,14 +75,14 @@ class CastleDebugProvider { } /** - * This function does nothing but must be defined to show cgedebug outside Pascal files e.g. after open folder in vscode. - * @param {undefined | WorkspaceFolder} folder - * @param {CancellationToken} token + * This function does nothing but must be defined to show castleDebug outside Pascal files e.g. after open folder in vscode. + * @param {undefined | WorkspaceFolder} folder + * @param {CancellationToken} token */ provideDebugConfigurations(folder, token) { console.log('provideDebugConfigurations - START'); console.log('provideDebugConfigurations - STOP'); - } + } } module.exports = CastleDebugProvider; \ No newline at end of file diff --git a/src/castlePlugin.js b/src/castlePlugin.js index 661a204..1dbdd42 100644 --- a/src/castlePlugin.js +++ b/src/castlePlugin.js @@ -116,21 +116,21 @@ class CastlePlugin { } if (this._taskCommandsRegistered === false) { - this._disposableCompileGame = vscode.commands.registerCommand(this._castleConfig.commandId.compileGame, () => { - vscode.tasks.executeTask(this._castleTaskProvider.compileGameTask); + this._disposableCompile = vscode.commands.registerCommand(this._castleConfig.commandId.compile, () => { + vscode.tasks.executeTask(this._castleTaskProvider.compileTask); }); - this._context.subscriptions.push(this._disposableCompileGame); + this._context.subscriptions.push(this._disposableCompile); - this._disposableRunGame = vscode.commands.registerCommand(this._castleConfig.commandId.runGame, () => { + this._disposableRun = vscode.commands.registerCommand(this._castleConfig.commandId.run, () => { this._castleTaskProvider.updateCastleTasks(); - vscode.tasks.executeTask(this._castleTaskProvider.runGameTask); + vscode.tasks.executeTask(this._castleTaskProvider.runTask); }); - this._context.subscriptions.push(this._disposableRunGame); + this._context.subscriptions.push(this._disposableRun); - this._disposableCleanGame = vscode.commands.registerCommand(this._castleConfig.commandId.cleanGame, () => { - vscode.tasks.executeTask(this._castleTaskProvider.cleanGameTask); + this._disposableClean = vscode.commands.registerCommand(this._castleConfig.commandId.clean, () => { + vscode.tasks.executeTask(this._castleTaskProvider.cleanTask); }); - this._context.subscriptions.push(this._disposableCleanGame); + this._context.subscriptions.push(this._disposableClean); this._taskCommandsRegistered = true; } @@ -138,14 +138,14 @@ class CastlePlugin { else { if (this._taskCommandsRegistered === true) { // when there is no build tool availble - this._disposableCompileGame.dispose(); - this._disposableCompileGame = null; + this._disposableCompile.dispose(); + this._disposableCompile = null; - this._disposableRunGame.dispose(); - this._disposableCompileGame = null; + this._disposableRun.dispose(); + this._disposableRun = null; - this._disposableCleanGame.dispose(); - this._disposableCleanGame = null; + this._disposableClean.dispose(); + this._disposableClean = null; this._taskCommandsRegistered = false; } @@ -176,7 +176,7 @@ class CastlePlugin { updateSearchInApiReferenceCommands() { if (this._searchInApiReferenceCommandsRegistered === false) { - this._disposableSearchInApiReference = vscode.commands.registerCommand(this._castleConfig.commandId.searchInCGEApiReference, () => { + this._disposableSearchInApiReference = vscode.commands.registerCommand(this._castleConfig.commandId.searchInApiReference, () => { let wordToSearch = ''; const editor = vscode.window.activeTextEditor; if (editor) { @@ -216,7 +216,7 @@ class CastlePlugin { margin: 0; padding: 0; } - #cgeApiReferenceFrame { + #ApiReferenceFrame { height: 100%; width: 100%; border: none; @@ -240,17 +240,17 @@ class CastlePlugin { } }); -
+
- + `; }); - this._disposableBackInCGEApiReference = vscode.commands.registerCommand(this._castleConfig.commandId.backInCGEApiReference, () => { + this._disposableBackInApiReference = vscode.commands.registerCommand(this._castleConfig.commandId.backInApiReference, () => { if (this._referencePanel !== undefined) { this._referencePanel.webview.postMessage({command: 'cgeback'}); } @@ -317,7 +317,7 @@ class CastlePlugin { if (this._castleDebugProvider == undefined) { this._castleDebugProvider = new CastleDebugProvider(this._castleConfig); - this._disposableDebugConfProvider = vscode.debug.registerDebugConfigurationProvider('cgedebug', this._castleDebugProvider); + this._disposableDebugConfProvider = vscode.debug.registerDebugConfigurationProvider('castleDebug', this._castleDebugProvider); this._context.subscriptions.push(this._disposableDebugConfProvider); } } diff --git a/src/castleStatusBar.js b/src/castleStatusBar.js index 8934d60..93db371 100644 --- a/src/castleStatusBar.js +++ b/src/castleStatusBar.js @@ -9,10 +9,10 @@ class CastleStatusBar { /** * Constructor - * @param {vscode.ExtensionContext} context - * @param {castleConfiguration.CastleConfiguration} castleConfig - * @param {castleLanguageServer.castleLanguageServer} castleLanguageServer - * @param {CastleTaskProvder.castleTaskProvder} castleTaskProvder + * @param {vscode.ExtensionContext} context + * @param {castleConfiguration.CastleConfiguration} castleConfig + * @param {castleLanguageServer.castleLanguageServer} castleLanguageServer + * @param {CastleTaskProvder.castleTaskProvder} castleTaskProvder */ constructor(context, castleConfig, castleLanguageServer, castleTaskProvder) { this._castleConfig = castleConfig; @@ -58,8 +58,8 @@ class CastleStatusBar { createCompileButton() { this._compileButton = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 19); this._context.subscriptions.push(this._compileButton); - this._compileButton.command = this._castleConfig.commandId.compileGame; - this._compileButton.tooltip = 'CGE: Click to compile game'; + this._compileButton.command = this._castleConfig.commandId.compile; + this._compileButton.tooltip = 'Compile Castle Game Engine Project'; this._compileButton.text = '$(gear) Compile'; this._compileButton.show(); } @@ -67,8 +67,8 @@ class CastleStatusBar { createDebugButton() { this._debugButton = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 18); this._context.subscriptions.push(this._runButton); - this._debugButton.command = this._castleConfig.commandId.debugGame; - this._debugButton.tooltip = 'CGE: Click to start debuging your game'; + this._debugButton.command = this._castleConfig.commandId.debug; + this._debugButton.tooltip = 'Start Debugging'; this._debugButton.text = '$(debug-alt) Debug'; this._debugButton.show(); } @@ -76,8 +76,8 @@ class CastleStatusBar { createRunButton() { this._runButton = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 18); this._context.subscriptions.push(this._runButton); - this._runButton.command = this._castleConfig.commandId.runGame; - this._runButton.tooltip = 'CGE: Click to run game'; + this._runButton.command = this._castleConfig.commandId.run; + this._runButton.tooltip = 'Run Castle Game Engine Project'; this._runButton.text = '$(run) Run'; this._runButton.show(); } @@ -85,8 +85,8 @@ class CastleStatusBar { createCleanButton() { this._cleanButton = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 18); this._context.subscriptions.push(this._cleanButton); - this._cleanButton.command = this._castleConfig.commandId.cleanGame; - this._cleanButton.tooltip = 'CGE: Click to clean game files'; + this._cleanButton.command = this._castleConfig.commandId.clean; + this._cleanButton.tooltip = 'Clean Castle Game Engine Project'; this._cleanButton.text = 'Clean'; this._cleanButton.show(); } @@ -95,7 +95,7 @@ class CastleStatusBar { this._openInEditorButton = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 18); this._context.subscriptions.push(this._openInEditorButton); this._openInEditorButton.command = this._castleConfig.commandId.openInCastleEditor; - this._openInEditorButton.tooltip = 'CGE: Open Project in Castle Editor'; + this._openInEditorButton.tooltip = 'Open Project in Castle Game Engine Editor'; this._openInEditorButton.text = '$(game) Open in Editor'; this._openInEditorButton.show(); } @@ -104,8 +104,8 @@ class CastleStatusBar { this._openSettingsButton = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 18); this._context.subscriptions.push(this._openSettingsButton); this._openSettingsButton.command = this._castleConfig.commandId.validateAndOpenSettings; - this._openSettingsButton.tooltip = 'CGE: Invalid plugin configuration click to fix'; - this._openSettingsButton.text = 'CGE: Invalid plugin config'; + this._openSettingsButton.tooltip = 'Castle Game Engine: Invalid plugin configuration. Click to fix'; + this._openSettingsButton.text = 'Castle Game Engine: Invalid plugin configuration'; this._openSettingsButton.color = new vscode.ThemeColor('statusBarItem.errorForeground'); this._openSettingsButton.show(); } diff --git a/src/castleTaskProvider.js b/src/castleTaskProvider.js index a9594b7..48e052d 100644 --- a/src/castleTaskProvider.js +++ b/src/castleTaskProvider.js @@ -6,7 +6,7 @@ const castleConfiguration = require('./castleConfiguration.js'); class CastleTaskProvder { /** - * @param {castleConfiguration.CastleConfiguration} castleConfig + * @param {castleConfiguration.CastleConfiguration} castleConfig */ constructor(castleConfig) { this._castleConfig = castleConfig; @@ -15,7 +15,7 @@ class CastleTaskProvder { createTasks() { try { - this._compileGameTask = new vscode.Task( + this._compileTask = new vscode.Task( { type: 'cge-tasks' }, vscode.workspace.workspaceFolders[0], 'compile-cge-game-task', // task name @@ -23,9 +23,9 @@ class CastleTaskProvder { new vscode.ShellExecution(this._castleConfig.buildToolPath, ['compile', '--mode=' + this._castleConfig.buildMode.buildTool]), // what to do '$cge-problem-matcher' ); - this._compileGameTask.group = vscode.TaskGroup.Build; + this._compileTask.group = vscode.TaskGroup.Build; - this._runGameTask = new vscode.Task( + this._runTask = new vscode.Task( { type: 'cge-tasks' }, vscode.workspace.workspaceFolders[0], 'run-cge-game-task', // task name @@ -34,7 +34,7 @@ class CastleTaskProvder { '$cge-problem-matcher' ); - this._cleanGameTask = new vscode.Task( + this._cleanTask = new vscode.Task( { type: 'cge-tasks' }, vscode.workspace.workspaceFolders[0], 'clean-cge-game-task', // task name @@ -42,7 +42,7 @@ class CastleTaskProvder { new vscode.ShellExecution(this._castleConfig.buildToolPath, ['clean']), // what to do '$cge-problem-matcher' ); - this._cleanGameTask.group = vscode.TaskGroup.Clean; + this._cleanTask.group = vscode.TaskGroup.Clean; } catch (err) { vscode.window.showErrorMessage(`createTasks - EXCEPTION: ${err}`); @@ -52,39 +52,39 @@ class CastleTaskProvder { } /** - * Updates compile task to use proper build mode and run game + * Updates compile task to use proper build mode and run game * task when recompilationNeeded changes o buildToolPath changes. */ updateCastleTasks() { if (this._castleConfig.recompilationNeeded) - this._runGameTask.execution = new vscode.ShellExecution(this._castleConfig.buildToolPath, ['compile-run', '--mode=' + this._castleConfig.buildMode.buildTool]); + this._runTask.execution = new vscode.ShellExecution(this._castleConfig.buildToolPath, ['compile-run', '--mode=' + this._castleConfig.buildMode.buildTool]); else - this._runGameTask.execution = new vscode.ShellExecution(this._castleConfig.buildToolPath, ['run', '--mode=' + this._castleConfig.buildMode.buildTool]); + this._runTask.execution = new vscode.ShellExecution(this._castleConfig.buildToolPath, ['run', '--mode=' + this._castleConfig.buildMode.buildTool]); - this._compileGameTask.execution = new vscode.ShellExecution(this._castleConfig.buildToolPath, ['compile', '--mode=' + this._castleConfig.buildMode.buildTool]); + this._compileTask.execution = new vscode.ShellExecution(this._castleConfig.buildToolPath, ['compile', '--mode=' + this._castleConfig.buildMode.buildTool]); - this._cleanGameTask.execution = new vscode.ShellExecution(this._castleConfig.buildToolPath, ['clean']); + this._cleanTask.execution = new vscode.ShellExecution(this._castleConfig.buildToolPath, ['clean']); } /** * @returns {vscode.Task} compile task */ - get compileGameTask() { - return this._compileGameTask; + get compileTask() { + return this._compileTask; } /** * @returns {vscode.Task} run task */ - get runGameTask() { - return this._runGameTask; + get runTask() { + return this._runTask; } /** * @returns {vscode.Task} clean sources task */ - get cleanGameTask() { - return this._cleanGameTask; + get cleanTask() { + return this._cleanTask; } provideTasks() { @@ -93,7 +93,7 @@ class CastleTaskProvder { return []; this.updateCastleTasks(); - return [this._compileGameTask, this._runGameTask, this._cleanGameTask]; + return [this._compileTask, this._runTask, this._cleanTask]; } catch (err) { vscode.window.showErrorMessage(`provideTasks - EXCEPTION: ${err}`);