From b2f0f7f47958ea5f421c4c8d8fb988726ed1eeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omelette=20=E8=9B=8B=E5=8D=B7?= Date: Sun, 4 Feb 2024 21:42:15 -0500 Subject: [PATCH] Release 1.1.4 --- CHANGELOG.md | 11 ++++++++++- package.json | 6 +++--- src/extension.ts | 14 ++++++++++---- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 083288b..cadafba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,4 +65,13 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## [1.1.3] - 2024-02-04 ### Fixed -- Fix JSON to Lua table regex. \ No newline at end of file +- Fix JSON to Lua table regex. + +## [1.1.4] - 2024-02-04 + +### Changed +- Config 'showQuickButtons' is now 'quickButtons' to avoid splitting other entries. +- Disable status bar button tooltip to prevent obscuring notifications. + +### Fixed +- File display not showing if directory does not exist. diff --git a/package.json b/package.json index 636319e..126e418 100644 --- a/package.json +++ b/package.json @@ -32,12 +32,12 @@ "dcsLuaRunner.serverPort": { "type": "number", "default": 12080, - "description": "Remote DCS Fiddle port." + "description": "Remote DCS Fiddle port for mission env. GUI env will automatically be on the next port (12081 by default)." }, "dcsLuaRunner.useHttps": { "type": "boolean", "default": false, - "description": "If server is behind a HTTPS reverse proxy. You should also change the port to 443." + "description": "Set if server is behind a HTTPS reverse proxy. You should also change server port accordingly (443)." }, "dcsLuaRunner.webAuthUsername": { "type": "string", @@ -71,7 +71,7 @@ "default": "JSON", "description": "Note: Experimental feature! Original returned data is in JSON. Conversion to Lua table is done after receiving data and may not be 100% accurate. Please report any issues." }, - "dcsLuaRunner.showQuickButtons": { + "dcsLuaRunner.quickButtons": { "type": "boolean", "default": false, "description": "Show buttons to quickly switch settings beside the run button." diff --git a/src/extension.ts b/src/extension.ts index 077a767..e820667 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -11,7 +11,7 @@ async function runLua(lua: string, outputChannel: vscode.OutputChannel, filename const runCodeLocally = config.get('runCodeLocally') as boolean; const runInMissionEnv = config.get('runInMissionEnv') as boolean; const serverAddress = runCodeLocally ? '127.0.0.1' : config.get('serverAddress') as string; - const serverPort = runCodeLocally ? 12080 : config.get('serverPort') as number + (runInMissionEnv ? 0 : 1); + const serverPort = (runCodeLocally ? 12080 : config.get('serverPort') as number) + (runInMissionEnv ? 0 : 1); const useHttps = runCodeLocally ? false : config.get('useHttps') as boolean; const authUsername = config.get('webAuthUsername') as string; const authPassword = config.get('webAuthPassword') as string; @@ -27,7 +27,13 @@ async function runLua(lua: string, outputChannel: vscode.OutputChannel, filename } else if (returnDisplay === 'file') { const activeEditor = vscode.window.activeTextEditor; const workspaceFolder = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders[0].uri.fsPath : ''; - const filePath = `${workspaceFolder}/.vscode/dcs_lua_output.${returnDisplayFormat}`; + const vscodeFolderPath = `${workspaceFolder}/.vscode`; + const filePath = `${vscodeFolderPath}/dcs_lua_output.${returnDisplayFormat}`; + + // Create the .vscode directory if it doesn't exist + if (!fs.existsSync(vscodeFolderPath)) { + fs.mkdirSync(vscodeFolderPath); + } // Create the file if it doesn't exist if (!fs.existsSync(filePath)) { fs.writeFileSync(filePath, ''); @@ -151,7 +157,7 @@ export function activate(context: vscode.ExtensionContext) { const runTarget = runCodeLocally ? 'local machine' : 'remote server'; const runEnv = runInMissionEnv ? 'mission' : 'GUI'; const serverAddress = runCodeLocally ? '127.0.0.1' : config.get('serverAddress') as string; - const serverPort = runCodeLocally ? 12080 : config.get('serverPort') as number + (runInMissionEnv ? 0 : 1); + const serverPort = (runCodeLocally ? 12080 : config.get('serverPort') as number) + (runInMissionEnv ? 0 : 1); if (config.get('returnDisplay') === 'Console Output') { outputChannel.show(true); outputChannel.appendLine(`[DCS] Settings: Run code in ${runEnv} environment on ${runTarget} (${serverAddress}:${serverPort}).`); @@ -198,7 +204,7 @@ export function activate(context: vscode.ExtensionContext) { vscode.commands.executeCommand('setContext', 'luaFileActive', vscode.window.activeTextEditor.document.languageId === 'lua'); } let statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 100); - statusBarItem.tooltip = 'DCS Lua Runner: Click to change settings'; + // statusBarItem.tooltip = 'DCS Lua Runner: Click to change settings'; statusBarItem.show(); statusBarItem.command = 'extension.showQuickPick'; context.subscriptions.push(statusBarItem);