Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SergeyShorokhov opened this issue Mar 25, 2019 · 2 comments

Comments

@SergeyShorokhov
Copy link
Contributor

SergeyShorokhov commented Mar 25, 2019

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

@SergeyShorokhov SergeyShorokhov changed the title Add support for (${env:VARIABLE})environment variables as paths. Add support for (${env:VARIABLE}) environment variables as paths. Mar 25, 2019
@SergeyShorokhov SergeyShorokhov changed the title Add support for (${env:VARIABLE}) environment variables as paths. Add support for (${env:VARIABLE}) environment variables as paths in configuration. Mar 25, 2019
@SergeyShorokhov
Copy link
Contributor Author

@rsKliPPy any suggestions?

@rtxa
Copy link

rtxa commented Apr 26, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants