You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VS Code中Intelephense插件HTML路径补全错误问题求助

Intelephense in VS Code: Incorrect HTML Path Completion (Targets Outer Directory Files)

I've been using the Intelephense plugin in VS Code for code completion, and overall it works really well. But I'm stuck on an annoying issue with path completion in HTML: when I try to autocomplete image paths inside my workspace folder, the plugin keeps matching files from an outer directory instead of the workspace's own files.

For example, when I'm editing index.php inside myFolder and try to add an image, the autocomplete suggests:

<img src="./images/picture.jpg">

But the correct path I need is:

<img src="./images/myPicture.jpg">

Here's my directory structure for clarity:

|--myFolder <Workspace Root>
|   |--images
|   |   \--myPicture.jpg
|   |--index.php
|--images
|   \--picture.jpg <The wrong file being picked up>
|--index.php

I've already tried a couple of fixes with no luck:

  • Renaming the index.php file inside myFolder
  • Setting the Document Root to ${workspaceFolder}

I haven't found any solutions to this online, and it's been causing a lot of frustration since I have to manually correct paths every time.

If anyone has run into this issue before or knows how to resolve it, I'd be really grateful for your help!

内容的提问来源于stack exchange,提问作者wolf

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 14:42:43