-
Notifications
You must be signed in to change notification settings - Fork 510
UNC Path autocompletion removes one leading slash, preventing further completions #2116
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
UNC Path autocompletion removes one leading slash, preventing further completions #2116
Comments
@msftrncs what does the behaviour of this look like in the terminal for you? Since you're using PS 7, if the same thing happens there it's worth opening an issue on PowerShell |
Everything works fine at the prompt, I have been working on the completions code myself, but I can confirm that everything works fine from the integrated terminal, both PS 6.2.2 and PS 7 preview. Inside VS Code, the path completion seems to be working differently. The leading slash is being removed, and it would appear, relative to the command prompt, the trailing slash is being removed too. IMPORTANT, the path must be quoted, or the selection made must make it quote the path during the completion, to see this. After completing After completing |
Is there a trouble reproducing this? I have multiple installs behaving exactly the same way. Here is a log of one instance: 2019-08-06 22:39:14.289 [VERBOSE] tid:22 in 'GetCompletionsAsync' C:\PowerShellEditorServices\src\PowerShellEditorServices\Language\AstOperations.cs: line 78
Getting completions at offset 35808 (line: 890, column: 4)
2019-08-06 22:39:14.306 [VERBOSE] tid:22 in 'GetCompletionsAsync' C:\PowerShellEditorServices\src\PowerShellEditorServices\Language\AstOperations.cs: line 133
IntelliSense completed in 15ms.
2019-08-06 22:39:14.306 [VERBOSE] tid:22 in 'WriteMessageAsync' C:\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageWriter.cs: line 88
Writing Response 'textDocument/completion' with id 50
{
"jsonrpc": "2.0",
"id": "50",
"result": [
{
"label": "Carl",
"kind": 19,
"detail": null,
"documentation": null,
"sortText": "0001Carl",
"filterText": "'\\\\svr-2015-01\\User Documents\\Carl'",
"insertText": "'\\\\svr-2015-01\\User Documents\\Carl$0'",
"insertTextFormat": 2,
"range": null,
"commitCharacters": null,
"textEdit": {
"range": {
"start": {
"line": 889,
"character": 0
},
"end": {
"line": 889,
"character": 35
}
},
"newText": "'\\\\svr-2015-01\\User Documents\\Carl$0'"
},
"additionalTextEdits": null,
"command": null,
"data": null
}
]
}
2019-08-06 22:39:14.309 [VERBOSE] tid:22 in 'ReadMessageAsync' C:\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs: line 138
Received Request 'completionItem/resolve' with id 51
{
"jsonrpc": "2.0",
"id": 51,
"method": "completionItem/resolve",
"params": {
"label": "Carl",
"filterText": "'\\\\svr-2015-01\\User Documents\\Carl'",
"insertTextFormat": 2,
"textEdit": {
"newText": "'\\\\svr-2015-01\\User Documents\\Carl$0'",
"range": {
"start": {
"line": 889,
"character": 0
},
"end": {
"line": 889,
"character": 35
}
}
},
"kind": 19,
"sortText": "0001Carl",
"data": null
}
}
2019-08-06 22:39:14.309 [VERBOSE] tid:22 in 'WriteMessageAsync' C:\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageWriter.cs: line 88
Writing Response 'completionItem/resolve' with id 51
{
"jsonrpc": "2.0",
"id": "51",
"result": {
"label": "Carl",
"kind": 19,
"detail": null,
"documentation": null,
"sortText": "0001Carl",
"filterText": "'\\\\svr-2015-01\\User Documents\\Carl'",
"insertText": null,
"insertTextFormat": 2,
"range": null,
"commitCharacters": null,
"textEdit": {
"range": {
"start": {
"line": 889,
"character": 0
},
"end": {
"line": 889,
"character": 35
}
},
"newText": "'\\\\svr-2015-01\\User Documents\\Carl$0'"
},
"additionalTextEdits": null,
"command": null,
"data": null
}
} The |
IIRC the |
Thanks @msftrncs based on the logs, it appears that the PowerShell extension is properly handling the the slashes, so I have opened an issue in the VScode repo to track this. |
This issue is being closed as inactive, if this issue is still occurring it will be re-opened |
We're following up with the vscode team. |
Just bumping as still occurring in VSCode 1.37.1 and PowerShell extension v2019.5.0 and it looks like the issue in the VSCode repo was closed as stale by their bot. Interesting to note that it only seems to do it for me when the path is already in quotes, or will be auto-completed with quotes due to a space in the path. |
Sorry @SotoDucani, I missed the notification in the vscode issue - I've responded. P.S. this is for sure a vs code issue. I can repro with just a vs code snippet:
which gives me:
As soon as the vs code team reopens @SydneyhSmith's issue, let's close this one. |
Not a problem @TylerLeonhardt, thanks for following up with them! |
Looks like it has been re-opened in the vscode repo so I will go ahead and close this one. |
Noting, this was determined to be an issue here, VS-Code indicates this is a TextMate special facility. Backslashes I believe @TylerLeonhardt is already planning to just escape all backslashes, but just so that its known, one of the TextMate constructs that must be escaped is
The same happens for |
Yeah. We'll have to handle |
I have a fix for this out now PowerShell/PowerShellEditorServices#1044 |
System Details
VS Code 1.36
PowerShell Extension: Preview 2019.05
PowerShell 6.2 or 7.0 preview 2
System Details Output
Issue Description
Attempting to complete a path to a directory on a UNC path, the leading slash keeps being removed by the completion.
'\\server\share\somefolder\'
Expected Behaviour
'\\server\share\somefolder\AdditionalFolder\'
Actual Behaviour
'\server\share\somefolder\AdditionalFolder\'
The text was updated successfully, but these errors were encountered: