Skip to content
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

Extract tables to functions: missing return statement #246

Open
kkharji opened this issue Feb 24, 2022 · 2 comments
Open

Extract tables to functions: missing return statement #246

kkharji opened this issue Feb 24, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@kkharji
Copy link

kkharji commented Feb 24, 2022

SOO finally, I got to try this. Oh it made my life so much easier and with null-ls is crazy good.

Great work 😍 I can only imagine the possibilities of such a codebase.

I notice while extracting tables that it misses adding return keyword.

local function mysources(builtins, dig, fmt)
                {
                      fmt.nixfmt,
                      builtins.code_actions.refactoring,
                      fmt.fixjson,
                      fmt.clang_format,
                      fmt.stylua.with {
                        extra_args = {
                          "--config-path",
                          vim.env.HOME .. "/.config/nvim/stylua.toml",
                          "-",
                        },
                      },
                      dig.vint,
                      fmt.swiftformat.with {
                        extra_args = {
                          "--config",
                          ".swiftformat",
                        },
                      },
                    }
end

Also why is it indent like that 🤔

@teddylear
Copy link
Collaborator

@tami5 thanks for opening issue! Do you mind sharing what the code looked like prior to the refactor so I can setup a test case to reproduce the issue? Also is the lua? I'm assuming this is from 'local function'. Indenting for all refactoring operations is something new we have added, so we are still trying to get it right.

@teddylear teddylear added bug Something isn't working waiting-reply labels Feb 24, 2022
@kkharji
Copy link
Author

kkharji commented Feb 24, 2022

@tami5 thanks for opening issue! Do you mind sharing what the code looked like prior to the refactor so I can setup a test case to reproduce the issue? Also is the lua? I'm assuming this is from 'local function'. Indenting for all refactoring operations is something new we have added, so we are still trying to get it right.

No at all it somewhere in my dot files I don't have access to right now, but basically it visual select a table with in a table and extract to function.

Yes that lua.

Indention maybe could be set by the user?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants