-
Notifications
You must be signed in to change notification settings - Fork 234
Fix unable to open files in problems/peek windows issue #872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unable to open files in problems/peek windows issue #872
Conversation
Well, looks like that bombs a lot of tests. I'll take a look at the tests tomorrow and see if this is a case where we can "fix" the tests. |
OK, the latest update leaves only one (non-test) use of PowerShellEditorServices/src/PowerShellEditorServices/Session/RemoteFileManager.cs Line 596 in 1a86d4b
which calls (and uses ClientPath):
which sends this insert test request to the LSP client: Line 46 in 1a86d4b
Not sure if we could have a latent bug here where we pass a path that hasn't been converted to a DocumentUri. So I've left this one alone. I think it is used when you edit a remote file. @TylerLeonhardt ? |
OK, I think this is ready for review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just a couple suggestions
This is great @rkeithhill! A couple things... Can you resolve the merge conflict? Is it possible to add tests for this change? (I only ask because I think this part of the code is very testable) |
This is due to PSES not properly storing a language client path in the ClientFilePath property of ScriptFile. This change ensures that a ClientFilePath is always stored in the text document Uri that a LSP client expects. This code has mostly been provided by @SeeminglyScience. Thanks for the reference to your code. This fixes issue 1732 in the vscode-powershell repo.
ce692b2
to
b4be9ba
Compare
Resovled the merge conflicts and addresses other PR comments. I'll look into tests next. |
BTW it would be nice if running tests locally was more convenient and more reliable. For instance, when I run the tests from the Visual Studio Test Explorer window, I get 55 failures, yet I get zero failures fom the command line. That is, when the tests don't hang. Often when running from the command line, the tests hang. :-( |
Yeah testing is what I want to focus on when I next get the chance. Once we have better testing we can make the changes we so badly need to make without breaking everything else |
@TylerLeonhardt Good call on adding tests. I think I've found an issue but I need to spin up my Ubuntu VM to verify. |
Let me know if there's anything I can do to help! |
Commit: Try to fix tests for Linux ✔️ Nice! Do you think this is ready for review now? |
Yes. It is ready for review. Also could you test this on macOS or Linux? In the released version of the extension, open the examples folder. Insert a few lines of script into Now build VSCode with this PR pulled down in PSES and try the above experiment again and it should work this time. BTW sometimes I've seen references fail before when you try to navigate to a file. Still trying to find a repro for that one. |
Thanks. So you are seeing the extension dev host use the ISE color theme as well. Hmm... I wonder what is up with that. |
@SeeminglyScience Would you mind taking a peek at this again? I changed some of the logic and would like to get you to review it. The main thing I found is that Linux allows file names like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! One nit and some possible optimization. The string allocs are nbd though, shouldn't block if they're an issue.
To quote Lego Batman - "What the heck!?"
How do you go about kicking a new build without having to push an unnecessary commit? |
OK, just about ready to merge this. @TylerLeonhardt could you run that test one more time since we changed the Linux/macOS code path a bit (based on @SeeminglyScience feedback)? Thanks. |
Can someone rekick the build? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a not important nit. 😄
Co-Authored-By: rkeithhill <[email protected]>
those flaky tests are so frustrating but I haven't had time to fix/mitigate them... I'm thinking about implementing 5x retry logic. |
@SeeminglyScience @rjmholt if you guys wanna give this one more look after my comments... otherwise I think this is good to go in |
p.s. this PR still works on macOS 😄 |
@rjmholt is OOF, merging this in. I marked it for backport. @rkeithhill we should cherry pick this back and test it. |
This is due to PSES not properly storing a language client path in the
ClientFilePath property of ScriptFile. This change ensures that a
ClientFilePath is always stored in the text document Uri that a LSP
client expects. This code has mostly been provided by
@SeeminglyScience. Thanks for the reference to your code.
This fixes issue 1732 in the vscode-powershell repo.
BTW I've also verified that there are issues when you use the reference code lens where refs to other files that you haven't loaded, will not load when you click on the file in the peek window.