-
Notifications
You must be signed in to change notification settings - Fork 12
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
Workflow proposal #51
Comments
Also, if you have a (semi)automated way of running the test, let me know how so I can run them myself. |
Thanks for the proposal. The topic about |
Yes, they will be probably 2 PRs for this, but I think they make more sense when used together, that's why a "workflow proposal". In any case, if there is a place to better discuss it before starting any implementation, then just let me know. |
For now, the only place we have for discussion is here (issue page), so I hope we can discuss it here (or another issue). |
We would like to continue to discuss changes to the API regarding configuration. The current API for register_group is intentionally kept simple. In fact, simply inheriting multiple augends can still be accomplished with code like the following: local augends_base = {
augend1,
augend2,
...
}
require("dial.config").augends:register_group {
default = augend_base,
python = list_concat { augend_base, {augend3} }
} where Inherits is a convenient feature for the user, but there is also a concern about the complexity of API and inner implementation. When self-references or cross-references occur, dial.nvim must detect them and raise an error. Such errors would not be detected by the Lua language server. |
True, then the inheritance should be achieved by just using Regarding the file format thing, do you think it's better to extend the api as I said or to add extra functions for that use case instead? |
Agreed. I will consider adding it to the README and help. For filetypes, I think the latter idea, i.e., add extra functions, is preferable, like: require("dial.config").augends:on_filetype { -- or more preferable function name
python = list_concat {
augend_base,
{
words {False, True}
},
markdown = list_concat {
augend_base,
{
augend.misc.alias.markdown_header,
}
}
} |
No, I mean if you are fine with |
My understanding is that by providing a function like |
So you mean we should make inc_normal and similars trigger both kinds of groups? or that when calling them, the group of the filetype will act as "default"? |
My idea is:
And now I'm checking the second PR (#53). I will consider appropriate ways to implement filetype support. I would appreciate your opinions, as there are many things I am not aware of on my own. |
Yes, I'm aware of the vim.keymap.set("n", "<C-A>", dm.inc_normal(require("dial.extras")._resolve_ft), { noremap = true }) Adding |
I tried adding functionality based on the on_filetype idea (#54). |
Your PR is good enough for my usecase, as having per-filetype augends is what I really need. The idea of this pr was to make the thing more flexible, allowing other kinds of rules. But yes, maybe this is good enough and there is no need for that kind of flexibility. |
I don't know of a better place to write this so I'm doing it here but feel free to redirect me.
It will be nice if the groups are inherited from "default" so one can just add some
augends
for certain filetypes without having to duplicate the default group.It will be also nice to make dial to use the group with the name of the
filetype
if it exists otherwise use 'default', that way instead of having several maps one could use the same and profit.If you are ok with those, please, let me know. We could discuss the api and I could implement the requested changes.
By now I think both could be accomplished with this api:
The text was updated successfully, but these errors were encountered: