yorkxin / vscode-coffeescript-support

Advanced CoffeeScript support in VSCode
https://marketplace.visualstudio.com/items?itemName=yorkxin.coffeescript-support
MIT License
29 stars 6 forks source link

ENOENT: no such file or directory #1

Closed riadd closed 6 years ago

riadd commented 6 years ago

Hello, thanks for the work on the extension!

I'm having issues getting it to run on my system. Opening symbols for my file, I'm getting the following error message:

[Error - 11:42:45] Request textDocument/documentSymbol failed. Message: Request textDocument/documentSymbol failed with message: ENOENT: no such file or directory, open 'd:\d%3A\projects\curiousexped\curiousexpedition\prototype-html\coffeescript\party.coffee' Code: -32603

I'm not sure how the "d%3A" part gets injected into the path name. It should be "d:\projects\curiousexped\curiousexpedition\prototype-html\coffeescript\party.coffee" instead.

I'm on Windows 10. VS Code 1.18.1.

yorkxin commented 6 years ago

d%3A is d: so I believe there is something wrong when getting the full path.

I found a similar issue here: https://github.com/Microsoft/vscode/issues/2990

But I believe the issue is that I removed file:// improperly: https://github.com/chitsaou/vscode-coffeescript-support/blob/master/server/src/utils/fileReader.ts#L5

riadd commented 6 years ago

Maybe it should use URL.file instead of URL.parse?

Any chance you could try that out?

zdenko commented 6 years ago

I have a similar problem (macOS) with character @ in the path, which is encoded to %40. I've solved it by changing https://github.com/chitsaou/vscode-coffeescript-support/blob/master/server/src/utils/fileReader.ts#L5 to

  return URL.parse(decodeURIComponent(uri)).path
yorkxin commented 6 years ago

@zdenko Glad to hear that. If you don't mind could you send a pull request containing this patch? I'll find a way to test it on Windows.

yorkxin commented 6 years ago

@riadd I am on macOS so testing it on Windows was something I didn't do (sorry). But since you reported the issue, I will test it on a Windows virtual machine.

yorkxin commented 6 years ago

@riadd @zdenko

I think I found a way to fix it, and checked on both macOS and Windows.

Here is the pre-release: https://github.com/chitsaou/vscode-coffeescript-support/releases/tag/v0.1.3beta1

Could you check it and let me know if it works as expected?

Thanks!

zdenko commented 6 years ago

It works 👍

riadd commented 6 years ago

Works for me as well (windows 10). Thank you!

yorkxin commented 6 years ago

Thanks for your help!

Just released a new version. Please check it :)