visual-studio-code - DocumentRoot 和 VSCode 连接
问题描述
如何在 Visual Studio Code 中设置工作区,以便“intelephense”机制建议我自动完成从我用作 DocumentRoot (Apache) 的目录开始的路径,而不是从 VS Code 工作区目录开始?
例如,我的项目(工作区)目录称为“网站”;它包含 'public' 目录,其中包含 index.html 和 style.css 。如果,在 html 文件中,我开始输入href="./
,我想在其中将文件与样式链接起来,intelephense 建议public
,这是错误的!
我真正想要的是:
<link rel="stylesheet" href="./style.css">
因为具有样式的文件与链接到它的 html 文件位于同一目录中。
style.css
因此,如果 intelephense在我开始输入时建议我href="./
,而不是建议:,那将是正确的public
。
我在 VS Code 工作区文件中尝试了这段代码:
{
"folders": [
{
"path": "."
}
],
"settings": {
"intelephense.environment.documentRoot": "./public"
}
}
但这并不能解决问题 - 我什至不确定这是要走的路。
解决方案
推荐阅读
- android - 无法在 BottomSheetBehavior 内的 NestedScrollView 内滚动 RecyclerView
- csv - 响应 cURL 请求时使用什么内容配置?
- c# - 无法在项目的 VS 2017 中运行调试模式
- jquery - 在锚标记中清空 Onclick 和 href
- makefile - 文件目标是否是 PHONY 目标的先决条件?
- abap - 如何使用多个非必填输入字段进行搜索?
- powerbi - power bi 复合模型中的切片器控制不刷新
- powershell - PowerShell 删除 URL 列表中特殊字符后的文本
- php - 说明如何在 PHP 中使用简单的路由系统
- amazon-web-services - 如何在 ubuntu 上运行“AWS sam”命令?