plugins.refactoring.settings
Options provided to the require('refactoring').setup
function.
Type: attribute set of anything
Default:
{ }
Example:
{
callback = {
__raw = ''
function()
print('nixvim')
end
'';
};
foo_bar = 42;
hostname = "localhost:8080";
}
Declared by:
plugins.refactoring.settings.extract_var_statements
When performing an extract_var
refactor operation, you can custom how the new variable would be declared by setting configuration
like the below example.
Example:
{
# overriding extract statement for go
go = "%s := %s // poggers";
}
Type: null or (attribute set of (string or raw lua code))
Default:
null
Plugin default: { }
Declared by:
plugins.refactoring.settings.print_var_statements
In any custom print var statement, it is possible to optionally add a max of two %s
patterns, which is where the debug path and
the actual variable reference will go, respectively. To add a literal "%s"
to the string, escape the sequence like this: %%s
.
For an example custom print var statement, go to this folder, select your language, and view multiple-statements/print_var.config
.
Note: if you have multiple custom statements, the plugin will prompt for which one should be inserted. If you just have one custom statement in your config, it will override the default automatically.
Example:
{
# add a custom print var statement for cpp
cpp = [ "printf(\"a custom statement %%s %s\", %s)" ];
}
Type: null or (attribute set of ((list of (string or raw lua code)) or raw lua code))
Default:
null
Plugin default: { }
Declared by:
plugins.refactoring.settings.printf_statements
In any custom printf statement, it is possible to optionally add a max of one %s
pattern, which is where the debug path will go.
For an example custom printf statement, go to this folder, select your language, and click on multiple-statements/printf.config
.
Note: if you have multiple custom statements, the plugin will prompt for which one should be inserted. If you just have one custom statement in your config, it will override the default automatically.
Example:
{
# add a custom printf statement for cpp
cpp = [ "std::cout << \"%s\" << std::endl;" ];
}
Type: null or (attribute set of ((list of (string or raw lua code)) or raw lua code))
Default:
null
Plugin default: { }
Declared by:
plugins.refactoring.settings.prompt_func_param_type
For certain languages like Golang, types are required for functions parameters. Unfortunately, for some parameters there is no way to automatically find their type. In those instances, we want to provide a way to input a type instead of inserting a placeholder value.
Set the relevant language(s) to true
to enable prompting for parameter types, e.g:
{
go = true;
cpp = true;
c = true;
java = true;
}
Type: null or (attribute set of (boolean or raw lua code))
Default:
null
Plugin default:
{
c = false;
cpp = false;
cxx = false;
go = false;
h = false;
hpp = false;
java = false;
}
Declared by:
plugins.refactoring.settings.prompt_func_return_type
For certain languages like Golang, types are required for functions that return an object(s). Unfortunately, for some functions there is no way to automatically find their type. In those instances, we want to provide a way to input a type instead of inserting a placeholder value.
Set the relevant language(s) to true
to enable prompting for a return type, e.g:
{
go = true;
cpp = true;
c = true;
java = true;
}
Type: null or (attribute set of (boolean or raw lua code))
Default:
null
Plugin default:
{
c = false;
cpp = false;
cxx = false;
go = false;
h = false;
hpp = false;
java = false;
}
Declared by:
plugins.refactoring.settings.show_success_message
Shows a message with information about the refactor on success. Such as:
[Refactor] Inlined 3 variable occurrences
Type: null or boolean or raw lua code
Default:
null
Plugin default: false
Declared by: