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

ante-ls goto definition #193

Merged
merged 6 commits into from
Feb 27, 2024
Merged

ante-ls goto definition #193

merged 6 commits into from
Feb 27, 2024

Conversation

ehllie
Copy link
Contributor

@ehllie ehllie commented Feb 27, 2024

Implements goto definition capability, and prevents the ls from panicking when the open document is empty. Also refactoring of utility functions to a separate module.

Copy link
Owner

@jfecher jfecher left a comment

Choose a reason for hiding this comment

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

LGTM, thank you once again!

@jfecher jfecher merged commit ad2cfb9 into jfecher:master Feb 27, 2024
1 check passed
@jfecher
Copy link
Owner

jfecher commented Feb 27, 2024

@ehllie do you mind tackling the Send errors with the futures next? Since one of the previous PRs I've been getting many of the following errors when building ante-ls:

error: future cannot be sent between threads safely
   --> ante-ls/src/main.rs:66:65
    |
66  |       async fn did_save(&self, params: DidSaveTextDocumentParams) {
    |  _________________________________________________________________^
67  | |         self.client.log_message(MessageType::LOG, format!("ante-ls did_save: {:?}", params)).await;
68  | |         if let Some(text) = params.text {
69  | |             let rope = Rope::from_str(&text);
...   |
74  | |         };
75  | |     }
    | |_____^ future created by async block is not `Send`
    |
    = help: the trait `Sync` is not implemented for `UnsafeCell<ante::parser::ast::Ast<'_>>`

@jfecher
Copy link
Owner

jfecher commented Feb 27, 2024

Ah, never mind. I did a get reset without also stashing. Should not have merged this PR. I'm going to revert this, then can you fix the compiler errors? I'm going to add a CI test that ante-ls builds as well since it seems it is not being checked.

jfecher added a commit that referenced this pull request Feb 27, 2024
@ehllie
Copy link
Contributor Author

ehllie commented Feb 28, 2024

@ehllie do you mind tackling the Send errors with the futures next? Since one of the previous PRs I've been getting many of the following errors when building ante-ls:

error: future cannot be sent between threads safely
   --> ante-ls/src/main.rs:66:65
    |
66  |       async fn did_save(&self, params: DidSaveTextDocumentParams) {
    |  _________________________________________________________________^
67  | |         self.client.log_message(MessageType::LOG, format!("ante-ls did_save: {:?}", params)).await;
68  | |         if let Some(text) = params.text {
69  | |             let rope = Rope::from_str(&text);
...   |
74  | |         };
75  | |     }
    | |_____^ future created by async block is not `Send`
    |
    = help: the trait `Sync` is not implemented for `UnsafeCell<ante::parser::ast::Ast<'_>>`

That's odd, I did not get any errors while building ante-ls. What rustc version are you using?

ehllie added a commit to ehllie/ante that referenced this pull request Feb 28, 2024
jfecher pushed a commit that referenced this pull request Feb 28, 2024
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.

2 participants