visual-studio-code - vscode 工作空间可以使用相对路径
问题描述
我想制作一个 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
解决方案
这并不总是在每个扩展中都有效,但我将工作区设置中的每个配置移动到user.json
然后${workspaceFolder}
用作相对变量,例如:
"amxxpawn.compiler.includePaths": [
"${workspaceFolder}/include"
]
工作区仍在使用,但我独自离开它,也使folder
价值意味着文件的位置path
path
.
workspace
推荐阅读
- python - Opencv识别相似对象之间的差异
- autohotkey - 使用 AutoHotkey 自动化 WinReducer 时遇到问题
- java - 用字符串“blank”替换不止一次连续出现的下划线字符“_”
- laravel - 此集合实例上不存在属性 [id] 错误?
- python - 在这种情况下,应该在 scikit learn 中应用多标签分类中的不同方法
- django - 如何使用 Django 模型为每个订单添加多个食品?
- python - 来自库编译器的 Python 包:Matlab 运行时错误:索引超出矩阵维度
- javascript - 如何按值的频率对javascript中的数组进行排序?
- git - 这是避免自动合并的有效 git 工作流程吗?
- javascript - 关于房间创建和删除的 Socket.io 事件