QB64Official / vscode

QB64 Extension for Visual Studio Code.
MIT License
13 stars 3 forks source link

Add additional OS specific path configuration settings #116

Closed grymmjack closed 1 year ago

grymmjack commented 1 year ago

I would like to have OS specific path configuration settings available for the following:

${config:qb64.compilerPath.osx}
${config:qb64.compilerPath.linux}
${config:qb64.compilerPath.windows}
${config:qb64.helpPath.osx}
${config:qb64.helpPath.linux}
${config:qb64.helpPath.windows}
${config:qb64.installPath.osx}
${config:qb64.installPath.linux}
${config:qb64.installPath.windows}

Why?

Because vscode profiles are OS agnostic, and they aren't saved individually per OS.

As a result when I'm working on my qb64 stuff on windows, I have to change compilerPath, helpPath, and installPath configuration for the extension.

When I'm done working on windows, and switch to say mac, again I have to change those variables.

The same is true for when I'm working in linux.

The only way I can think of to disambiguate this and keep everything in alignment without having to change these every time would be to create new variables per OS.

Thanks.

I can work around some of this like compilation step in my own tasks.json, but the hover help seems to be hard coded against helpPath (of course it would be - that's why it's there) but the problem is that helpPath is different for every OS.

Also once these exist, here is my tasks.json (I no longer use launch.json in favor of this tasks.json) which I've mapped my hotkeys like so to activate:

keyboardshortcuts.json (snippet of relevant config) - CTRL+SHIFT+B or F5 = build, CTRL+F5 = test

    {
        "key": "f5",
        "command": "workbench.action.tasks.build",
        "when": "taskCommandsRegistered"
    },
    {
        "key": "ctrl+shift+b",
        "command": "-workbench.action.tasks.build",
        "when": "taskCommandsRegistered"
    },
    {
        "key": "ctrl+f5",
        "command": "workbench.action.tasks.test"
    },

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Run",
            "dependsOn": "Compile",
            "type": "shell",
            "windows": {
                "command": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            },
            "osx": {
                "command": "${fileDirname}/${fileBasenameNoExtension}.run",
            },
            "linux": {
                "command": "${fileDirname}/${fileBasenameNoExtension}.run",
            },
            "presentation": {
                "echo": false,
                "reveal": "always",
                "focus": false,
                "panel": "shared",
                "showReuseMessage": false,
                "clear": false
            },
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
        {
            "label": "Compile",
            "dependsOn": "Remove",
            "type": "shell",
            "windows": {
                "command": "${config:qb64.compilerPath.windows}", /* i:\\git\\qb64pe\\qb64pe.exe */
                "args": [
                    "-x",
                    "${fileDirname}\\${fileBasename}",
                    "-o",
                    "${fileDirname}\\${fileBasenameNoExtension}.exe"
                ]
            },
            "osx": {
                "command": "${config:qb64.compilerPath.osx}",
                "args": [
                    "-x",
                    "${fileDirname}/${fileBasename}",
                    "-o",
                    "${fileDirname}/${fileBasenameNoExtension}.run"
                ]
            },
            "linux": {
                "command": "${config:qb64.compilerPath.linux}",
                "args": [
                    "-x",
                    "${fileDirname}/${fileBasename}",
                    "-o",
                    "${fileDirname}/${fileBasenameNoExtension}.run"
                ]
            },
            "presentation": {
                "reveal": "always",
                "panel": "shared",
                "focus": false
            }
        },
        {
            "label": "Remove",
            "type": "shell",
            "windows": {
                "command": "del",
                "args": [
                    "${fileDirname}\\${fileBasenameNoExtension}.exe"
                ]
            },
            "osx": {
                "command": "rm -f",
                "args": [
                    "${fileDirname}/${fileBasenameNoExtension}.run"
                ]
            },
            "linux": {
                "command": "rm -f",
                "args": [
                    "${fileDirname}/${fileBasenameNoExtension}.run"
                ]
            },
            "presentation": {
                "reveal": "always",
                "panel": "shared",
                "focus": false
            }
        }
    ]
}
grymmjack commented 1 year ago

Update: I found this: image

Which /might/ do what I need - by just keeping them separate.

Let me give it a shot.

grymmjack commented 1 year ago

OK so we don't need this feature - it is simply required to not Sync the setting.

I also had to clear out the existing configuration in the profile of that setting.

I guess just Won't Do :)