-
Notifications
You must be signed in to change notification settings - Fork 47
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
lush.parse
error when basing from another specs
#69
Comments
I'll be honest, it's been a while since I've worked on the code and don't have the time to check properly right now (half of this post is really notes to future me), but my test: describe "#69", ->
it "errors", ->
base = parse -> {
A { fg: "#00FF00", gui: "italic" }
}
spec = parse -> {
A { base.A, gui: nil }
} Gives the error: user bugs #69 errors
./lua/lush/parser.lua:1: {
code = "circular_self_link",
msg = "Attempt to link self",
on = "A"
} Off the top of my head,
So the parser can't rectify the spec and somewhere it's failing to check for errors or perhaps just cant surface the error context properly. Anyway, if you For your user, you might have to wrap the mini-spec in a
That should keep you moving, but it is a bug, at least in not showing a useful error if nothing else. |
Getting my brain back in Lua mode, I am thinking:
I bet if you set Nils are ok to reach the compiler, they get coerced into "NONE" lush.nvim/lua/lush/compiler.lua Lines 6 to 10 in 63e11d9
Not 100% if I can actually check for this, since checking if a key is nil would probably break the whole link idea cause everything would look like an inherit without checking all the way up chains for differences. Probably the fix will just be surfacing the error and documenting that |
This works! I should have thought of this in the first place. Not sure why I went with I'll probably make this zenbones-theme/zenbones.nvim#14 (comment) the recommended way for simple overrides. It's much more flexible but still simple to write. I first considered showing the extend/merge way but that seems to large of an |
But it works with extend or merge.
Work around is to do something like:
Related: zenbones-theme/zenbones.nvim#14
The text was updated successfully, but these errors were encountered: