From 1fc17ffcf9c8b34f84a2828d77aa0bef466a61f4 Mon Sep 17 00:00:00 2001 From: Joshua Wong Date: Thu, 15 Sep 2022 23:47:50 -0500 Subject: [PATCH] feat: support workspace dependencies --- lua/crates/toml.lua | 8 ++++++++ teal/crates/toml.tl | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/lua/crates/toml.lua b/lua/crates/toml.lua index 9426d8d0..d965d652 100644 --- a/lua/crates/toml.lua +++ b/lua/crates/toml.lua @@ -209,6 +209,14 @@ function M.parse_section(text) } local target = prefix + + local workspace = prefix:match("^workspace%s*%.$") + if workspace then + + target = "" + prefix = "" + end + local dev_target = prefix:match("^(.*)dev%-$") if dev_target then target = vim.trim(dev_target) diff --git a/teal/crates/toml.tl b/teal/crates/toml.tl index af113e85..160ec0c1 100644 --- a/teal/crates/toml.tl +++ b/teal/crates/toml.tl @@ -209,6 +209,14 @@ function M.parse_section(text: string): Section } local target = prefix + + local workspace = prefix:match("^workspace%s*%.$") + if workspace then + -- the workspace table only allows a regular dependencies sub-table + target = "" + prefix = "" + end + local dev_target = prefix:match("^(.*)dev%-$") if dev_target then target = vim.trim(dev_target)