Skip to content

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

Closed

Description

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.

Activity

  1. added this to the milestone on Sep 8, 2016
  2. daviwil commented on Sep 8, 2016

    @daviwil
    Contributor

    Hi Deshi Rahim (@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.

  3. deshiknaves commented on Sep 11, 2016

    @deshiknaves
    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.

  4. daviwil commented on Sep 12, 2016

    @daviwil
    Contributor

    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.

  5. modified the milestones: 0.8.0, on Nov 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions