Skip to content

Commit

Permalink
Rename various identifiers to be without Game
Browse files Browse the repository at this point in the history
  • Loading branch information
michaliskambi committed Feb 22, 2024
1 parent fad5276 commit d4153c0
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 91 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"cSpell.enabled": true,
"cSpell.words": [
"cgedebug",
"castleDebug",
"cnoc",
"FPCDIR",
"fpcsrc",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`):
Expand Down Expand Up @@ -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.
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -122,7 +122,7 @@
"menus": {
"webview/context": [
{
"command": "castle-engine.backInCGEApiReference",
"command": "castle-engine.backInApiReference",
"when": "webviewId == 'cge_api_reference'"
}
]
Expand Down Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions src/castleConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down
20 changes: 10 additions & 10 deletions src/castleDebugProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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']);
Expand Down Expand Up @@ -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;
42 changes: 21 additions & 21 deletions src/castlePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,36 +116,36 @@ 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;
}
}
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;
}
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -216,7 +216,7 @@ class CastlePlugin {
margin: 0;
padding: 0;
}
#cgeApiReferenceFrame {
#ApiReferenceFrame {
height: 100%;
width: 100%;
border: none;
Expand All @@ -240,17 +240,17 @@ class CastlePlugin {
}
});
</script>
<div id="cgeApiReferenceToolbar">
<div id="ApiReferenceToolbar">
<button onclick="goBack()">Back</button>
</div>
<iframe id="cgeApiReferenceFrame" src="https://castle-engine.io/apidoc/html/tipue_results.html?q=${wordToSearch}"></iframe>
<iframe id="ApiReferenceFrame" src="https://castle-engine.io/apidoc/html/tipue_results.html?q=${wordToSearch}"></iframe>
</body>
</html>
`;

});

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'});
}
Expand Down Expand Up @@ -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);
}
}
Expand Down
30 changes: 15 additions & 15 deletions src/castleStatusBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -58,35 +58,35 @@ 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();
}

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();
}

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();
}

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();
}
Expand All @@ -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();
}
Expand All @@ -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();
}
Expand Down
Loading

0 comments on commit d4153c0

Please sign in to comment.