Commit fa1a4f5
authored
Fix Pester CodeLens run/debug by not quoting params/already quoted args (#794)
* Fix Pester CodeLens run/debug by not quoting params/already quoted args
Requires a corresponding PR in vscode-powershell.
We should look this one over good as it has potential to break folks.
I think the odds are low. Essentially we added the QuoteEscapString
method because we get raw paths from VSCode when debugging
the current file. Those paths are quoted because they may contain
spaces and because we use single quotes, existing single quotes
have to be doubled e.g C:\Don'tUseQuotesInPaths to
'C:\Don''tUseQuotesInPaths'.
This unfortunately was always being invoked on args. Now we
check if the arg is a parameter (starts with '-') or is already quoted. The thinking is if the users is specifying a quoted arg, it's on them
to handle any necessary escaping.
BTW is there another char that can act as the start of a parameter -
like the longer dash - whatever that is called.
Longer term, we need a better solution for how to handle paths
from VSCode. Maybe we handle them there and eliminate the
escaping logic in PSES?
* Revert to not escape/quoting args or script value when not a file path1 parent 19d5c5b commit fa1a4f5
File tree
2 files changed
+23
-19
lines changed- src
- PowerShellEditorServices.Protocol/Server
- PowerShellEditorServices/Session
2 files changed
+23
-19
lines changedLines changed: 1 addition & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
| 305 | + | |
315 | 306 | | |
316 | 307 | | |
317 | 308 | | |
| |||
Lines changed: 22 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
772 | | - | |
773 | 772 | | |
774 | 773 | | |
775 | 774 | | |
| |||
791 | 790 | | |
792 | 791 | | |
793 | 792 | | |
794 | | - | |
795 | | - | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
796 | 801 | | |
797 | 802 | | |
798 | 803 | | |
799 | | - | |
800 | | - | |
801 | | - | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
802 | 810 | | |
803 | 811 | | |
804 | 812 | | |
805 | | - | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
806 | 817 | | |
807 | | - | |
| 818 | + | |
808 | 819 | | |
809 | 820 | | |
810 | 821 | | |
811 | | - | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
812 | 825 | | |
813 | 826 | | |
814 | 827 | | |
| |||
0 commit comments