Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand completion support for language server (chapel-lang#25991)
This PR expands upon our existing completion support to be location specific. Prior to this PR, only the module level scope was used to provide completion symbols. This PR changes that, so that visible symbols are computed based upon the users cursor. With this PR, users will get an auto-complete suggestion of 'myVariable' when 'myV' is typed. ```chapel record myRecord { var myVariable = 1; proc foo() { myV } } ``` Implementation details This PR uses the fact that the FileInfo visits nodes in order when building segments. So in the above example, the scope for `myRecord` is visited before `foo`. As each scope is entered, we keep track of the location, its Scope object, and the parent scopes. This is precomputed before a user ever requests a completion, so that when that occurs it is just a simple lookup. [Reviewed by @DanilaFe]
- Loading branch information