vscode workspace can use relative path

2.8k Views Asked by At

I want to make a AMX mod X script, this modules are related which game I make, so I am using workspace as configuration. Making compiler, library and output path dependent of each game. my source code has same folder as compiler

I've tried to write ./ and .\\ but it's won't work, vscode still can't find amxxpc.exe, here's my configuration workspace:

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "amxxpawn.compiler.executablePath": "./amxxpc.exe",
        "amxxpawn.compiler.includePaths": [
            "./include"
        ],
        "amxxpawn.compiler.outputPath": "../plugins",
        "amxxpawn.compiler.outputType": "path"
    }
}

amxxpawn.compiler.executablePath still can't figure amxxpc.exe until I wrote full path. since this placed in same folder as source code, I also tried to remove ./ but still can't find it.

here's my extension I use: https://marketplace.visualstudio.com/items?itemName=KliPPy.amxxpawn-language

1

There are 1 best solutions below

0
On BEST ANSWER

This is not always work in every extension but I moved every configs in workspace settings to user.json and then use ${workspaceFolder} as relative variable, for e.x:

"amxxpawn.compiler.includePaths": [
            "${workspaceFolder}/include"
        ]

workspace still used but I left it folder and path alone, also making path value to . means location of workspace file