-
Notifications
You must be signed in to change notification settings - Fork 107
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
Add basic language server support for explicit symbol imports #3282
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ignores project config files and directories generated by VSCode, IntelliJ-based IDEs, Eclipse, Vim, etc. Adding as a PR since this tends to be a reasonably common practice for open-source repositories. These specific entries are from the `.gitignore` in [rust-lang/rust](https://github.com/rust-lang/rust/blob/master/.gitignore#L13-L23).
## Changelog for ic-hs: Branch: master Commits: [dfinity/ic-hs@b7bbd5db...998a0084](dfinity/ic-hs@b7bbd5d...998a008) * [`691b2847`](dfinity/ic-hs@691b284) Use nixbuild.net as a remote nix builder on CI ([dfinity/ic-hsdfinity#81](https://togithub.com/dfinity/ic-hs/issues/81)) * [`27320521`](dfinity/ic-hs@2732052) .github/workflows/release.yml: disable MacOS builds in release job ([dfinity/ic-hsdfinity#82](https://togithub.com/dfinity/ic-hs/issues/82)) * [`998a0084`](dfinity/ic-hs@998a008) feat: allow optional "error_code" field in responses ([dfinity/ic-hsdfinity#75](https://togithub.com/dfinity/ic-hs/issues/75))
Thanks @rvanasa these contributions are much appreciated. I won't get a chance to review today but perhaps someone else will. |
ggreif
reviewed
Jun 3, 2022
ggreif
approved these changes
Jun 4, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds straightforward "go to definition" support for Motoko's pattern-style import syntax.
For example,
import { v|als } "mo:base/Array"
andv|als(x)
(where|
represents the cursor) will correctly navigate to the correspondingArray.vals
declaration.As with existing language server functionality, these changes do not yet account for variable shadowing. However, the updated
parse_module_header
function already parses import patterns such as (import {alias = field} "..."
) based on the proposed generalized import syntax (#3076).Please let me know if additional explanation would be helpful for any of these changes. I also included four test cases to cover the newly expected behavior of
definition_handler
andparse_module_header
.Tested in VSCode on WSL using the official Motoko extension.
Fixes #3078
Supersedes #3263
CC @kritzcreek, @crusso, @matthewhammer