Skip to content
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 UNC intellisense backslash #1044

Merged

Conversation

TylerLeonhardt
Copy link
Member

fixes PowerShell/vscode-powershell#2116

This escapes all \ } and $ so that the intellisense is properly escaped for Textmate to render it.

(yes, we don't need to escape {)

@rjmholt
Copy link
Contributor

rjmholt commented Sep 26, 2019

(yes, we don't need to escape {)

😕


// Since we want to use a "tab stop" we need to escape a few things for Textmate to render properly.
var sb = new StringBuilder(completionDetails.CompletionText)
.Replace("\\", "\\\\")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might consider using a verbatim string here e.g. .Replace(@"\", @"\\") and below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well use verbatim strings on lines 2017 & 2018 as well. Makes the reading of "replaced this with that" easier if you don't have to mentally convert esc sequences. :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, yeah that's definitely nit-picking. :-) Overall LGTM.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright, they're everywhere now - and they're perfectly lined up!

Copy link
Contributor

@rkeithhill rkeithhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@TylerLeonhardt TylerLeonhardt merged commit 8332631 into PowerShell:master Oct 3, 2019
@TylerLeonhardt TylerLeonhardt deleted the fix-unc-intellisense-slash branch October 3, 2019 20:45
TylerLeonhardt added a commit that referenced this pull request Oct 16, 2019
* fix UNC intellisense backslash

* use here string

* here everywhere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UNC Path autocompletion removes one leading slash, preventing further completions
4 participants