Skip to content

Language service crate #371

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

Merged
merged 13 commits into from
Jun 12, 2023
Merged

Language service crate #371

merged 13 commits into from
Jun 12, 2023

Conversation

minestarks
Copy link
Member

This adds a language_service Rust crate. The language service is simply a struct that maintains a compilation state for each known document. It receives document edits and updates the current compilation state based on those edits. It provides methods (get_completions, get_definition, hover) to get information about the current compilation.

Review note This PR is a subset of the draft PR at #364 . That PR is an end-to-end implementation with everything wired up and functional in the playground and VS Code. You may want to refer to #364 if you have questions about how some of the things defined in this PR will end up getting used.

Review note the actual editor feature implementations at completion.rs, definition.rs and hover.rs are meant to be placeholders with very limited functionality (see the unit tests for the very few cases we do support). Fleshing out the actual features will be done in later PRs.

@swernli
Copy link
Collaborator

swernli commented Jun 7, 2023

Since this introduces a new top-level folder, could you also add it to the code owners file? Perhaps with you, Bill, and Ian as owners?

@minestarks
Copy link
Member Author

Addressed @idavis and @SamarSha 's comments.

@SamarSha - I had to update the call sites for SourceMap methods, which subtly changes the assumptions at the call site in some cases. A careful look would be appreciated to make sure I didn't break any behavior.

Copy link
Contributor

@bamarsha bamarsha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes related to SourceMap look good.

@minestarks minestarks merged commit 91afda4 into main Jun 12, 2023
@minestarks minestarks deleted the minestarks/language-service-native branch June 12, 2023 20:34
@minestarks minestarks mentioned this pull request Jun 13, 2023
37 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants