vscode工作空间可以使用相对路径

问题描述 投票:0回答:1

我想制作一个AMX mod X脚本,此模块与我制作的游戏有关,因此我将工作区用作配置。使编译器,库和输出路径依赖于每个游戏。我的源代码与编译器具有相同的文件夹

[我尝试写./.\\,但是它不起作用,vscode仍然找不到amxxpc.exe,这是我的配置工作区:

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "amxxpawn.compiler.executablePath": "./amxxpc.exe",
        "amxxpawn.compiler.includePaths": [
            "./include"
        ],
        "amxxpawn.compiler.outputPath": "../plugins",
        "amxxpawn.compiler.outputType": "path"
    }
}
在我编写完整路径之前,

amxxpawn.compiler.executablePath仍然无法计算amxxpc.exe。由于此文件与源代码位于同一文件夹中,因此我也尝试删除./,但仍然找不到它。

这是我使用的扩展名:https://marketplace.visualstudio.com/items?itemName=KliPPy.amxxpawn-language

visual-studio-code vscode-settings pawn
1个回答
0
投票

这并不总是在每个扩展中都起作用,但我将工作空间设置中的每个配置移至user.json,然后将${workspaceFolder}用作相对变量,例如:

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

工作区仍在使用,但我单独留了folderpath,也将path值设为.表示workspace文件的位置

© www.soinside.com 2019 - 2024. All rights reserved.