texlab-patch removed
All checks were successful
CI / Build Packages (default) (push) Successful in 47s
CI / Build Packages (example-a) (push) Successful in 48s
CI / Nix Flake Check (push) Successful in 1m50s
CI / Build Packages (example-b) (push) Successful in 47s
CI / Build Packages (pyzotero) (push) Successful in 52s
CI / Build Packages (pyzotero-cli) (push) Successful in 1m2s
All checks were successful
CI / Build Packages (default) (push) Successful in 47s
CI / Build Packages (example-a) (push) Successful in 48s
CI / Nix Flake Check (push) Successful in 1m50s
CI / Build Packages (example-b) (push) Successful in 47s
CI / Build Packages (pyzotero) (push) Successful in 52s
CI / Build Packages (pyzotero-cli) (push) Successful in 1m2s
This commit is contained in:
20
flake.lock
generated
20
flake.lock
generated
@@ -352,7 +352,8 @@
|
|||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"jailed-agents": "jailed-agents",
|
"jailed-agents": "jailed-agents",
|
||||||
"mcp-servers": "mcp-servers",
|
"mcp-servers": "mcp-servers",
|
||||||
"nixpkgs": "nixpkgs_6"
|
"nixpkgs": "nixpkgs_6",
|
||||||
|
"texlab-src": "texlab-src"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
@@ -445,6 +446,23 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"texlab-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1767083273,
|
||||||
|
"narHash": "sha256-hd7fDnZqNEz4Ayop3uPqL4IU6xgGsTjMhGvgF+Trgcw=",
|
||||||
|
"owner": "latex-lsp",
|
||||||
|
"repo": "texlab",
|
||||||
|
"rev": "d89bf0fa65bd931ab57183d067f66189fc31e6c9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "latex-lsp",
|
||||||
|
"ref": "v5.25.1",
|
||||||
|
"repo": "texlab",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"treefmt-nix": {
|
"treefmt-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|||||||
@@ -15,10 +15,6 @@
|
|||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
jailed-agents.url = "git+https://gitea@gitea.bueso.eu/luis/jailed-agents";
|
jailed-agents.url = "git+https://gitea@gitea.bueso.eu/luis/jailed-agents";
|
||||||
mcp-servers.url = "git+https://gitea@gitea.bueso.eu/luis/mcp-servers";
|
mcp-servers.url = "git+https://gitea@gitea.bueso.eu/luis/mcp-servers";
|
||||||
texlab-src = {
|
|
||||||
url = "github:latex-lsp/texlab/v5.25.1";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
@@ -28,7 +24,6 @@
|
|||||||
flake-utils,
|
flake-utils,
|
||||||
jailed-agents,
|
jailed-agents,
|
||||||
mcp-servers,
|
mcp-servers,
|
||||||
texlab-src,
|
|
||||||
}:
|
}:
|
||||||
flake-utils.lib.eachDefaultSystem (
|
flake-utils.lib.eachDefaultSystem (
|
||||||
system:
|
system:
|
||||||
@@ -37,7 +32,7 @@
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages = import ./pkgs {
|
packages = import ./pkgs {
|
||||||
inherit pkgs texlab-src;
|
inherit pkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells.default = import ./devshells {
|
devShells.default = import ./devshells {
|
||||||
|
|||||||
@@ -1,28 +1,16 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
texlab-src ? null,
|
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
self =
|
self = {
|
||||||
{
|
example-a = pkgs.callPackage ./example-a { };
|
||||||
example-a = pkgs.callPackage ./example-a { };
|
example-b = pkgs.callPackage ./example-b { };
|
||||||
example-b = pkgs.callPackage ./example-b { };
|
pyzotero = pkgs.callPackage ./pyzotero { };
|
||||||
pyzotero = pkgs.callPackage ./pyzotero { };
|
pyzotero-cli = pkgs.callPackage ./pyzotero-cli {
|
||||||
pyzotero-cli = pkgs.callPackage ./pyzotero-cli {
|
pyzotero = self.pyzotero;
|
||||||
pyzotero = self.pyzotero;
|
};
|
||||||
};
|
khal-export = pkgs.callPackage ./khal-export { };
|
||||||
khal-export = pkgs.callPackage ./khal-export { };
|
org-zotero-export = pkgs.callPackage ./org-zotero-export { };
|
||||||
org-zotero-export = pkgs.callPackage ./org-zotero-export { };
|
};
|
||||||
}
|
|
||||||
// (
|
|
||||||
if texlab-src != null then
|
|
||||||
{
|
|
||||||
texlab = pkgs.callPackage ./texlab {
|
|
||||||
inherit texlab-src;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ }
|
|
||||||
);
|
|
||||||
in
|
in
|
||||||
self // { default = self.example-a; }
|
self // { default = self.example-a; }
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
lib,
|
|
||||||
rustPlatform,
|
|
||||||
pkg-config,
|
|
||||||
openssl,
|
|
||||||
texlab-src,
|
|
||||||
}:
|
|
||||||
rustPlatform.buildRustPackage {
|
|
||||||
pname = "texlab";
|
|
||||||
version = "5.25.1-patched";
|
|
||||||
src = texlab-src;
|
|
||||||
cargoLock.lockFile = "${texlab-src}/Cargo.lock";
|
|
||||||
patches = [ ./patches/subfile-diagnostics.patch ];
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
|
||||||
buildInputs = [ openssl ];
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Texlab with subfile diagnostic fix";
|
|
||||||
mainProgram = "texlab";
|
|
||||||
license = lib.licenses.mit;
|
|
||||||
platforms = lib.platforms.all;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
diff --git a/crates/diagnostics/src/build_log.rs b/crates/diagnostics/src/build_log.rs
|
|
||||||
index 1234567..abcdefg 100644
|
|
||||||
--- a/crates/diagnostics/src/build_log.rs
|
|
||||||
+++ b/crates/diagnostics/src/build_log.rs
|
|
||||||
@@ -14,8 +14,13 @@ pub fn update(
|
|
||||||
|
|
||||||
let data = log_document.data.as_log()?;
|
|
||||||
|
|
||||||
- let parents = deps::parents(workspace, log_document);
|
|
||||||
- let root_document = parents.iter().next()?;
|
|
||||||
+ // Try to find the compiled .tex file from the log file name first.
|
|
||||||
+ // This handles subfile compilation where the subfile is the actual root.
|
|
||||||
+ let root_document = find_compiled_document(workspace, log_document)
|
|
||||||
+ .or_else(|| {
|
|
||||||
+ // Fallback to original behavior: find parent via dependency graph
|
|
||||||
+ deps::parents(workspace, log_document).into_iter().next()
|
|
||||||
+ })?;
|
|
||||||
|
|
||||||
let base_path = root_document
|
|
||||||
.path
|
|
||||||
@@ -57,3 +62,14 @@ fn find_range_of_hint(document: &Document, error: &BuildError) -> Option<TextRan
|
|
||||||
let hint_end = hint_start + hint.text_len();
|
|
||||||
Some(TextRange::new(hint_start, hint_end))
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+/// Given a .log file, find the corresponding .tex file that was compiled.
|
|
||||||
+/// E.g., `/path/to/chapter.log` -> `/path/to/chapter.tex`
|
|
||||||
+fn find_compiled_document<'a>(
|
|
||||||
+ workspace: &'a Workspace,
|
|
||||||
+ log_document: &Document,
|
|
||||||
+) -> Option<&'a Document> {
|
|
||||||
+ let log_path = log_document.path.as_ref()?;
|
|
||||||
+ let tex_path = log_path.with_extension("tex");
|
|
||||||
+ let tex_uri = Url::from_file_path(&tex_path).ok()?;
|
|
||||||
+ workspace.lookup(&tex_uri)
|
|
||||||
+}
|
|
||||||
Reference in New Issue
Block a user