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

Track origin's occurrences #907

Merged
merged 5 commits into from
May 21, 2021
Merged

Track origin's occurrences #907

merged 5 commits into from
May 21, 2021

Conversation

turbolent
Copy link
Member

@turbolent turbolent commented May 16, 2021

Description

Record occurrences in origins, so that it is possible to get all occurrences from one occurrence.

For example, in the following program:

struct Counter {
    var n: Int

    init() {
        self.n = 0
    }

    fun inc() {
        self.n = self.n + 1
    }
}

It is possible to get from one of the occurrences of field n in functions inc to the origin, the field declaration on line 2, and from there get all occurrences (the one in the initializer, and the other two in the inc function.

Also:

  • Fix the origin range for field declarations
  • Add a function to get all occurrences for a position (multiple checker passes (re)declare occurrences)

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@turbolent turbolent force-pushed the bastian/more-completion-items branch from a8bbb1b to d115b87 Compare May 20, 2021 20:48
Base automatically changed from bastian/more-completion-items to master May 20, 2021 22:26
languageserver/server/server.go Outdated Show resolved Hide resolved
@turbolent turbolent merged commit c84693a into master May 21, 2021
@turbolent turbolent deleted the bastian/origin-occurrences branch May 21, 2021 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants