microsoft / vscode

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

Unable to open a file becasue vscode says it's a directory #62251

Closed pvanek closed 5 years ago

pvanek commented 5 years ago

Version: 1.28.2 (user setup) Commit: 7f3ce96ff4729c91352ae6def877e59c561f4850 Date: 2018-10-17T00:23:51.859Z Electron: 2.0.9 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 Architecture: x64

Steps to Reproduce:

  1. A language server provides a path to file
  2. User tries to go to to a class definition (Ctrl+mouse click)
  3. The exception is thrown from EditorGroupView::doHandleOpenEditorError() mostly probably. Unable to open 'c:\qore-0.9.0-git\share\qore-modules\0.9.0\RestClient.qm': File is a directory.

Which is not true. This is a really file. Tested with Windows Explorer, MSYS2 file. Also the file can be opened using programming language scrips like Python, Qore, PERL...

The file has (IMHO) correct permissions: Read, Read & Execute, (-rw-r--r-- under MSYS)

Does this issue occur when all extensions are disabled?: Cannot test because this file is served/provided by an extension

https://github.com/qorelanguage/qore-vscode/issues/7

kieferrm commented 5 years ago

I stumbled over a similar issue when the URL is not well-formed. @pvanek What does your URL look like precisely?

Here are my steps to reproduce: 1) Open a .js file 2) Add a comment of the following form (ensure that the url has only two / rather than the required three).

/**
 * file://C:\rootfolder\folder1\folder2\file.png
 */

3) Ensure C:\rootfolder\folder1\folder2\file.png exists. 4) Ctrl+Click the url in the comment -> You the "this is a directory" error message. This is the wrong error message. 5) Correct the URL to file:///C:\rootfolder\folder1\folder2\file.png -> everything works as expected

kieferrm commented 5 years ago

/needsMoreInfo

vscodebot[bot] commented 5 years 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!

pvanek commented 5 years ago

@kieferrm yes, thanks! this is it. So it's most probably caused by a 3rd party extension.

But anyway - isn't that error message confusing a bit?

pvanek commented 5 years ago

FYI: fixed downstream https://github.com/qorelanguage/qls/issues/2