Skip to content

improved heuristic to find project root #60

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 1 commit into from
Apr 28, 2025
Merged

Conversation

Leandros
Copy link
Collaborator

We're now trying to look at a few directories, instead of just the git root.

Fixes #49

@Leandros Leandros requested a review from crisidev April 28, 2025 07:27
@Leandros Leandros mentioned this pull request Apr 28, 2025
Copy link
Owner

@crisidev crisidev left a comment

Choose a reason for hiding this comment

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

Looks good.

@@ -19,6 +19,8 @@ impl LanguageServer for BaconLs {
async fn initialize(&self, params: InitializeParams) -> jsonrpc::Result<InitializeResult> {
tracing::info!("initializing {PKG_NAME} v{PKG_VERSION}",);
tracing::debug!("initializing with input parameters: {params:#?}");
let project_root = Cargo::find_project_root(&params).await;
Copy link

@michaelrommel michaelrommel Apr 28, 2025

Choose a reason for hiding this comment

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

@Leandros would it not be possible to get the root directory directly from the LSP client? Because nvim-lspconfig provides a method to specify how to find the root dir. And LspInfo correctly displays this dir.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@michaelrommel, this is exactly what I'm doing now.

We're now trying to look at a few directories, instead of just the git
root.

Fixes crisidev#49
@Leandros Leandros merged commit 9d07e13 into crisidev:main Apr 28, 2025
3 of 4 checks passed
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.

Selection of wrong root
3 participants