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

feat: Add Language Server for devenv #1663

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Add testing infrastructure
k3yss committed Jan 8, 2025
commit 2087b406b85f4f00a5ccf568f2720144ce99a897
15 changes: 15 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -69,6 +69,8 @@ tokio = { version = "1.39.3", features = [
"sync",
"time",
"io-std",
"test-util",
"full",
] }
which = "6.0.0"
whoami = "1.5.1"
@@ -77,6 +79,8 @@ xdg = "2.5.2"
tower-lsp = "0.20.0"
tracing-appender = "0.2.3"
dashmap = "6.1.0"
fs_extra = "1.3.0"
temp-dir = "0.1.13"
# Using older version of tree-sitter due to tree-sitter-nix not being updated yet
tree-sitter = "0.20"
tree-sitter-nix = "0.0.1"
2 changes: 2 additions & 0 deletions devenv/Cargo.toml
Original file line number Diff line number Diff line change
@@ -49,6 +49,8 @@ tracing-appender.workspace = true
dashmap.workspace = true
tree-sitter.workspace = true
tree-sitter-nix.workspace = true
fs_extra.workspace = true
temp-dir.workspace = true

[build-dependencies]
cc = "*"
5 changes: 3 additions & 2 deletions devenv/src/devenv.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{cli, cnix, config, log, lsp, tasks, utils};
use super::{cli, cnix, config, lsp, tasks, utils};
use clap::crate_version;
use cli_table::Table;
use cli_table::{print_stderr, WithTitle};
@@ -9,7 +9,6 @@ use nix::sys::signal;
use nix::unistd::Pid;
use once_cell::sync::Lazy;
use serde::Deserialize;
use serde_json::Value;
use sha2::Digest;
use std::collections::HashMap;
use std::io::Write;
@@ -413,7 +412,9 @@ impl Devenv {
}

pub async fn lsp(&mut self) -> Result<()> {
self.assemble(false)?;
let options = self.nix.build(&["optionsJSON"]).await?;
debug!("{:?}", options);
let options_path = options[0]
.join("share")
.join("doc")
Loading