Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Word match includes ":" #257

@atombender

Description

@atombender

Your environment

  • vscode-ruby version: 0.16.0
  • Ruby version: 2.3.3p222
  • VS Code version: 1.19.3
  • Operating System: macOS 10.13.2
  • Hardware (optional):

Make sure you have ruby, ruby-debug-ide and ruby-debug-basex19 installed before submitting your issue -- thank you !

Expected behavior

: should never be part of word matching rules.

Actual behavior

: is included when matching words (e.g. cmd-D). This used to be an issue in VSCode itself, but was fixed.

Steps to reproduce the problem

Given the following snippet:

Foo::Bar.baz(:fnord)

Position caret on Bar and hit cmd-D. This will highlight :Bar instead of just Bar:

screen shot 2018-01-30 at 14 26 58

Postion caret on fnord and hit Cmd-D. This will hightlight :fnord instead of fnord.

screen shot 2018-01-30 at 14 27 12

Both are surprising and wrong. A symbol is not a word. The : is not part of it, in the same way that quotes are not part of "a string" or a minus character is not part of -3. For example, this hits the cmd-D behaviour where you might have:

def delete(object)
  put_in_trash if object.kind == :foo || mode == 'foo'
end

Place the caret on foo and hit cmd-D a few times, and it will of course only match the symbol. Similarly, if you used cmd-D with the intention to copy the name, you'd get the colon included. Neither is useful.

Some might argue that the colon is part of the term, but this just isn't useful. Of course, the other use case which hits qualified identifiers (Foo::Bar) is indefensible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions