rsKliPPy / amxxpawn-language

AMXXPawn Language Service for Visual Studio Code
22 stars 8 forks source link

Add support for (${env:VARIABLE}) environment variables as paths in configuration. #16

Open wopox1337 opened 5 years ago

wopox1337 commented 5 years ago

image

Is not possible to set global settings in paths for code highlighting & compilation settings. As example for i want: /.vscode/settings.json

"amxxpawn.compiler.includePaths": [
        "${workspaceRoot}/hlds/cstrike/addons/amxmodx/scripting/include",

// Local folder with working AMXMODX & another default includes.
        "${env:AMXX_PATH}/scripting/include"
    ]

Now it's not works. But, vscode supports them (Environment variables) in tasks.json as i know.

Configuration example:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Compile AMXX Plugin with all debug (D3)",
            "type": "shell",
            "windows": {
                "command": "${env:AMXX_PATH}/scripting/amxxpc.exe",
            },
            // "linux": {
                // "command": "${workspaceRoot}/scripting/amxxpc",
            // },
            "args": [
                "${workspaceRoot}/hlds/cstrike/addons/amxmodx/scripting/plugin.sma",
                "-i${env:AMXX_PATH}/scripting/include",
                "-i${workspaceRoot}/hlds/cstrike/addons/amxmodx/scripting/include",
                "-o${env:AMXX_PATH}/plugins/plugin.amxx",
                "-d3"
            ],
            "promptOnClose": false,
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "presentation": {
                // "reveal": "never", // "never" or "always" when we need to see also console output
                "reveal": "always",
                "panel": "dedicated",
                "clear": true
            },
            "problemMatcher": {
                "fileLocation": "absolute",
                "pattern": {
                    // Group 1 - filename (absolute path for filename)
                    // Group 2 - beginning line
                    // Group 3 - ending line (optional)
                    // Group 4 - error | warning (severity)
                    // Group 5 - message
                    "regexp": "(.+?)\\((\\d+)(?:\\s--\\s(\\d+))?\\)\\s:\\s(warning|error)\\s\\d+:\\s(.*)",
                    "file": 1,
                    "line": 2,
                    "column": 3,
                    "severity": 4,
                    "message": 5
                }
            }
        }
    ]
}

as example, windows environment variables settings. %AMXX_PATH% = F:\\hlds\\cstrike\\addons\\amxmodx

wopox1337 commented 5 years ago

@rsKliPPy any suggestions?

rtxa commented 2 years ago

@wopox1337 For what I read in this issue, VSCode doesn't have an API to expose a way to expand variables using the format ${env:<variable>}. Anyway one of the guys from the issue has created a package to add support for this: vscode-variables. That should do the work for this feature request.