microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.31k stars 28.9k forks source link

The file is not displayed in the text editor because it is a directory. #198882

Closed srcrook closed 6 months ago

srcrook commented 10 months ago

Type: Bug

to fix you need to add in your navegator the index.php

http://localhost/dashboard/myproject/index.php

(index)꞉38:9:379 before

index.php꞉38:9:237 after

Please Fix This..

VS Code version: Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:51:52.184Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz (4 x 3600)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|7.85GB (2.45GB free)| |Process Argv|--crash-reporter-id fe8c5d68-a9ef-4ecd-ad67-0d68fefb6d7b| |Screen Reader|no| |VM|0%|
Extensions (4) Extension|Author (truncated)|Version ---|---|--- format-selection-as-html|adr|2.3.0 html-whitespace-eliminator-toggle|inf|0.0.8 vscode-html-format|moh|0.1.2 php-debug|xde|1.34.0
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 py29gd2263cf:30880073 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 3biah626:30602489 89544117:30613380 showlangstatbar:30737416 pythonfmttext:30731395 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 pythonnosmt12:30797651 pythonidxpt:30866567 pythonnoceb:30805159 synctok:30869157 dsvsc013:30795093 dsvsc014:30804076 dsvsc015:30845448 pythontestfixtcf:30871695 pythonregdiag2:30871582 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 2e7ec940:30885897 pythontbext0:30879054 dsvsc016cf:30886111 dsvsc017cf:30886113 dsvsc018:30886114 aa_t_chat:30882232 ```
IllusionMH commented 10 months ago

/needsMoreInfo

Please describe how exactly it's related to VS Code editor itself and clear steps to reproduce (link to localhost does not allow to reproduce).

Otherwise error looks logical if you try to open folder innstead of file

VSCodeTriageBot commented 10 months ago

Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.

Happy Coding!

srcrook commented 10 months ago

/needsMoreInfo

Please describe how exactly it's related to VS Code editor itself and clear steps to reproduce (link to localhost does not allow to reproduce).

Otherwise error looks logical if you try to open folder innstead of file

I debugged my project using Chrome and naturally the best help is to show where the error in the code is, which is accessed by clicking on the warnings and errors (index.php꞉38:9:237)

The problem is that when starting a project the extension is not automatically placed in vs

Example with resolved result: dashboard/myproject/index.php (the extension (index.php) must be, in the debuggable browser url for it to work = index.php꞉38:9:237)

Bugged example: when accessing debug in vs and the url looks like this: dashboard/myproject/ The result in vs in the console is = (index)꞉38:9:379 Clicking shows the error mentioned above and not show the error. (The file is not displayed in the text editor because it is a directory)

VSCodeTriageBot commented 7 months ago

Hey @Tyriar, this issue might need further attention.

@srcrook, you can help us out by closing this issue if the problem no longer exists, or adding more information.

VSCodeTriageBot commented 7 months ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

Tyriar commented 7 months ago

@srcrook could you provide a screenshot of the issue? It's not clear where the link is appearing exactly. If it's within the terminal we could potentially look up an index file when clicked, I'd need to know what program is giving this output and where the link it though.

kkroon commented 7 months ago

I recently encountered this issue while trying to understand why a certain Well Known Search Engine was treating a file as if it were a directory. When I opened one of the files (named notice.html), I got the error message cited above:

File-treated-as-directory

lramos15 commented 7 months ago

@kkroon You're just opening the notice.html file from your folder and it says it's a directory? Is it just that one file?

kkroon commented 7 months ago

@lramos15 That is correct. Other files are acting like this, but I haven't been able to figure out a pattern: e.g., some files named index.html misbehave ... but another in a different folder may not.

The only additional details I can offer are:

lramos15 commented 7 months ago

Oh so in this case you're connected to some sort of NAS? I'm not sure what I'm following about you saying the search engine also treats it as a directory?

kkroon commented 6 months ago

@lramos15 We only store it on the NAS as a staging area to put a copy on our public site.

Once there, a certain Alphabetical Search Engine company has found it and is treating it as a fictitious directory to crawl (this example is a file named index.html and is the most egregious example of this behavior, but I have seen a couple other files behaving the same way): File-as-directory-allows-crawl-of-fictitious-subfolders

I've inspected the file's properties (that is, the file on the NAS) with PowerShell; but its d (for directory) flag is not set, only when I try to open it in VS Code.

lramos15 commented 6 months ago

So both Google and VS Code are saying it's a directory? Does that mean there is a file problem and not a VS Code problem?

VSCodeTriageBot commented 6 months ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!