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)