robocorp / robotframework-lsp

Robocorp extensions for VS Code: Robocorp Code and RFW LSP
https://robocorp.com/docs/developer-tools/visual-studio-code
Apache License 2.0
200 stars 87 forks source link

Cannot work well with GitLens in Code-Insider, caused by the case different in windows. #1023

Closed Zoupers closed 4 months ago

Zoupers commented 6 months ago

Describe the bug

A clear and concise description of what the bug is.

As mentioned in the title, I found that the test view result somewhat influences the file url which the GitLens get in code-insider, and it causes the GitLens cannot correctly show the line history.

To Reproduce

Since I am using code-insider, I just reproduce it in code-insider. Here is a mini-repo. code_insider_bug.zip

  1. Using code-insider to open it. And do not open any file.
  2. Set the correct python environment for robotframework-lsp. Then open the __init__.robot file. And check the test view, wait until the test/01Test.robot show up.
  3. Switch side bar to GitLens-Inspect view, and check out the line history.
  4. Open the Test/01Test.robot,and check the line history of Gitlens, nothing show up.

Expected behavior

A clear and concise description of what you expected to happen.

GitLens work as usual.

Screenshots

If applicable, add screenshots to help explain your problem.

Like the screenshot, there should be something in the LINE HISTORY on the right side. image

Versions:

Logs

robotframework_ls.log.zip

Zoupers commented 6 months ago

Actually, I don't know if it should be proposed as a code-insider problem or robotframework-lsp problem...

Zoupers commented 6 months ago

I tried commenting out the relevant toLowerCase code in the testview.js and everything works fine.

fabioz commented 5 months ago

I tried commenting out the relevant toLowerCase code in the testview.js and everything works fine.

Would you like to provide a PR?

Zoupers commented 4 months ago

Cool, let me give a try.

Zoupers commented 4 months ago

I just found this problem begin to occur on vscode, not only vscode-insider.

Zoupers commented 4 months ago

@fabioz Although this is the solution, there may still be some incorrect paths cached in vscode storage.

Zoupers commented 4 months ago

I just know how to delete the storage, but I don't know how to force refresh.

smoky-gray commented 4 months ago

I think I'm getting almost same issue, it's making me crazy.

Below is the VSCode info, Version: 1.87.0 (system setup) Commit: 019f4d1419fbc8219a181fab7892ebccf7ee29a2 Date: 2024-02-27T23:41:44.469Z Electron: 27.3.2 ElectronBuildId: 26836302 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Windows_NT x64 10.0.19045

vscode extension, Robot Framework Language Server version is v1.11.0

I could not see gutter whatever I changed. While checking logs from Git output window, I found that path/filename passed to git cmd, all were changed to lower case, on my opinion it should be the root cause, but I don't know the reason and how to fix.

I have tried many different ways to fix this issue, such as re-install vscode, upgrade git to latest version, restart laptop, delete vscode cache and so on, but no luck.

If I disabled the extension, then everything looks good. However without "Robot Framework Language Server" I could do nothing.

Could someone kindly help to check/fix this issue ? @Zoupers Do you know any workaround ?

Zoupers commented 4 months ago

@peach-coder you can attemp to build a vsix package from this PR or you might apply changes locally following the change I've made.

Please remember to clear local workspace cache after install or apply changes.

smoky-gray commented 4 months ago

@peach-coder you can attemp to build a vsix package from this PR or you might apply changes locally following the change I've made.

Please remember to clear local workspace cache after install or apply changes.

@Zoupers Thanks for your help, I'll have a try soon. On the other hand I'm really wondering the root cause. Since "Robot Framework Language Server" extension has not been released new version for long time, why am I facing this issue ? Is there any conflict with Gitlens ?

Zoupers commented 4 months ago

I suspect this bug may originate from the VSCode itself, as the file URL is provided by vscode, and I first encountered this issue in the Code-Insider. At that time, normal VSCode version is totally fine. I have tried to locate the problem in the VSCode, but the complexity of the code has confounded me.

smoky-gray commented 4 months ago

Bad experience, if issue could not be fixed soon, I'd rather uninstall the extension and find another better IDE/plugin.