Closed FeryrArdacon closed 1 year ago
Describe the bug VS Code plugin does not work if the working directory is accessed through a symbolic link on Linux.
To Reproduce Steps to reproduce the behavior:
- Create a ui5 app
- Create a symbolic link to the folder of your workspace with the "ln -s" command
- Open the app in VS Code using the symbolic link instead of the original path
- Code completion, references, etc. are not working then
Expected behavior The plugin can handle symbolic links as paths for the source code.
Screenshots The problem can be seen very good if you run the "ui5linter" command in the app folder when using the symbolic link. The output of the linter uses the original path, the link path is shown via the "pwd" command after the linter output.
Desktop
- OS: Linux Mint 21.2 (Victoria)
- IDE: VS Code 1.81.1
- UI5 Plugin: 1.13.0
- UI5 Linter: 1.8.2
- Node.js: 19.7.0
Additional context Hi! A while ago I had reported a problem with your plugin on my Linux PC. Because I could not reproduce the behavior on on other devices at the time, I closed it. I think I have found what causes the issue. Your plugin (or the linter) is resolving the path of the symbolic link and cannot match the findings with the symbolic link using source code files in VS Code. It is not a big issue since there is a workaround. But maybe it is something that can be fixed in the future.
Best Regard! Patrick
Hi! Thanks for the bug report and your support! :) That might be the issue indeed. Not sure if I will be able to find a solution, but before stating that I would like to ask for a folder structure example and where/how exactly are you using symbolic links so I could reproduce the issue.
Hi Ilja,
a little example can be created as following. I tried it myself in a fresh ubuntu VM to make sure for a reproduceable test environment.
Maybe a little bit extra info why someone would use a symbolic link in the first place. My workspaces are located on a second drive. This drive is bigger and is used to store all my data that must not necessarily be at the os main drive. And for quicker access I use a symbolic link to my workspaces in my home directory to save some clicks.
Hope I could help and wish you nice day!
Best Regards! Patrick
I have made some adjustments that makes the extension at least somehow working with this scenario.
However, I don't see how I can introduce full support.
The root cause is that I am using fs.realpathSync.native
which transforms symbolic links to real path.
The reason why I am using it is to get all parts which uses fs path (glob, VSCode itself, typescript (ts-morph) etc) to one format, because they may differ.
E.g. VSCode could give you c:\...
and glob would provide C:\...
, which is a challenge. And god knows what happens in OS other than Windows. I didn't find any other ways which could bring all paths to single format. So, unless anybody have any ideas on how to solve different path format issue, I will not be able to introduce full support of symbolic links.
Hi Ilja,
thanks for trying. I appreciate your effort. Tested it and it works fine for me. I understand the limits and thank you for your time and your great work building this extension!
Have a nice day!
Best Regards! Patrick
Describe the bug VS Code plugin does not work if the working directory is accessed through a symbolic link on Linux.
To Reproduce Steps to reproduce the behavior:
Expected behavior The plugin can handle symbolic links as paths for the source code.
Screenshots The problem can be seen very good if you run the "ui5linter" command in the app folder when using the symbolic link. The output of the linter uses the original path, the link path is shown via the "pwd" command after the linter output.
Desktop
Additional context Hi! A while ago I had reported a problem with your plugin on my Linux PC. Because I could not reproduce the behavior on on other devices at the time, I closed it. I think I have found what causes the issue. Your plugin (or the linter) is resolving the path of the symbolic link and cannot match the findings with the symbolic link using source code files in VS Code. It is not a big issue since there is a workaround. But maybe it is something that can be fixed in the future.
Best Regard! Patrick