Skip to content

Double clicking variable selects variable, but copying and pasting does not have the $ symbol #240

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

Closed
deshiknaves opened this issue Aug 18, 2016 · 3 comments
Labels
Issue-Bug A bug to squash.
Milestone

Comments

@deshiknaves
Copy link

When you double a variable name, vscode-powershell will select the variable name with the $ sign. However, once you copy it to the clipboard and then paste it somewhere else, it does not contain the $ symbol.

@daviwil daviwil added the Issue-Bug A bug to squash. label Sep 8, 2016
@daviwil daviwil added this to the 0.7.3 milestone Sep 8, 2016
@daviwil
Copy link
Contributor

daviwil commented Sep 8, 2016

Hi @deshiknaves, I apologize for the long delay in responding to this issue. This could be a general issue with VS Code but I'll take a look today to see if we caused it somehow.

@deshiknaves
Copy link
Author

Without the extension, it doesn't highlight the $ before the variable name, so I figure there is some logic in the plugin that does that, but isn't updating the selection when copying it.

@daviwil
Copy link
Contributor

daviwil commented Sep 12, 2016

So I realized what was causing the confusion here: when you have the PowerShell extension installed, it uses the extension's language server to find "occurrences" of the symbol under the cursor. Since the language server knows how to identify the $ on the variable name, it gets included with the highlight on the variable when you put your cursor on it. This is confusing because it looks like the variable and the $ are both selected when only the variable name is actually selected.

The lack of selection on the $ is a problem caused by our syntax definition for the PowerShell language. I've filed an issue at our editor syntax repo to track this problem: PowerShell/EditorSyntax#23. I'll close this issue since we're tracking it at the other repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

No branches or pull requests

2 participants