Skip to content

Error on emitting reference for capture groups #181

@varungandhi-src

Description

@varungandhi-src
Contributor

Input

[scip-ruby] couldn't find field 1 in class <redacted>;
    18 |      string =~ /(.+);\s*$/ ? $1 : string
                                      ^^

Undesirable behavior

The error seems incorrect, we shouldn't be checking for $1 as being a field, it's special syntax for the captured value in the capture group in the preceding regex. (https://stackoverflow.com/questions/6673847/what-are-rubys-numbered-global-variables)

Expected behavior

No error.

scip-ruby-debug indexing output

n/a

Configuration

scip-ruby v0.3.3

Additional info

No response

Activity

changed the title [-]Error on emitting reference for $1[/-] [+]Error on emitting reference for capture groups[/+] on Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mmanela@varungandhi-src

        Issue actions

          Error on emitting reference for capture groups · Issue #181 · sourcegraph/scip-ruby