red / VScode-extension

Red extension for Visual Studio Code
Boost Software License 1.0
40 stars 17 forks source link

[WISH] commands for flags `-u` and `-r` #14

Closed geekyi closed 5 years ago

geekyi commented 7 years ago

We currently have 4 commands. Add more for other commonly used compilation options.

iceflow19 commented 6 years ago

I would think it be better to have some of these integrated into the command palette.

gltewalt commented 6 years ago

Can you use DevOptions for it?

Something like:

commandsProvider.ts in execCommand

        case Commands.Red_Compile: {
            buildDir = redSettings.buildDir ||
                vscode.workspace.rootPath ||
                path.dirname(filePath);
            compileFlag = redSettings.devOptions.join(" ") || "-c";
            outputFilename = path.join(buildDir, path.parse(filePath).name);
            if (guiMode) {
                text = `${redExecutable} -t Windows -o "${outputFilename}" ${compileFlag} "${filePath}"`;
            } else {
                text = `${redExecutable} -o "${outputFilename}" ${compileFlag} "${filePath}"`;
            }
        } break;
        default: {
            text = 'echo "No red toolchain or red console"';
        }
    }
    terminal.sendText(text);
    terminal.show();
}

Settings.

    "red.redPath": "\"C:\\Users\\Old Man\\red.exe\"",
    "red.buildDir": "C:\\Users\\Old Man\\Desktop",
    "red.devOptions": ["-r"], 
gltewalt commented 6 years ago

@qtxie

qtxie commented 6 years ago

@gltewalt Thanks. I'll try to update it in the next days.

bitbegin commented 5 years ago

i'm not sure if this is needed

bitbegin commented 5 years ago

recommend code runner

bitbegin commented 5 years ago

I have added "compile Red in Release mode", "clear libRedRT", "update libRedRT" commands. modifed the key bingdings:

            {
                "command": "red.interpret",
                "key": "F6"
            },
            {
                "command": "red.interpretGUI",
                "key": "ctrl+F6"
            },
            {
                "command": "red.compile",
                "key": "F7"
            },
            {
                "command": "red.compileGUI",
                "key": "ctrl+F7"
            },
            {
                "command": "red.compileRelease",
                "key": "ctrl+shift+F7"
            },
            {
                "command": "reds.compile",
                "key": "F8"
            },
            {
                "command": "red.commandMenu",
                "key": "ctrl+k ctrl+m"
            }
bitbegin commented 5 years ago

image