Hi again! :)
I find this extension extremely helpful for new code and packages that I'm using, but it still has room for improvement. At least on the Python side, since that's what I'm using it for.
Describe the Feature Request
Many Python's built-in functions' parameters are unnecessary to inlay hint and introduce unnecessary clutter most of the time. Also, use of keyword arguments in many Python's built-in functions calls just doesn't work because many built-in functions are C functions bound to Python.
Because of that, I propose having a configuration argument that would ignore built-ins, if that is even feasible.
If not that, the second best thing would be to allow configuring an ignore list of function names that will never be inlay hinted.
I find this feature to be neat and it would also expand on the customizability of the extension.
Describe Preferred Solution
If built-in ignoring is possible the user would need to set e.g. "inline-parameters.python.ignoreBuiltIns": true
in VS Code's settings.json
.
Describe Alternatives
Seeing that the above is probably far-fetched, I propose giving users an option to configure a list of functions they don't want to inlay hint instead.
The user would have to define e.g. "inline-parameters.python.functionsToIgnore": ["print", "len", "sort", ...]
in settings.json
.
Related Code
I haven't developed any extension so I don't have any experience in the process of building and testing the changes of a VS Code extension.
I have no clue how the main proposal would be implemented, but I have an idea of what changes need to be made to implement the alternative.
The following suggestions are for Python, but it probably applies to all of them, implementation-wise.
The new configuration option with an empty list as the default value should be added here:
|
"inline-parameters.python.suppressWhenArgumentMatchesName": { |
|
"type": "boolean", |
|
"markdownDescription": "Suppress parameter name hints on arguments whose text is identical to the parameter name.", |
|
"default": true |
|
} |
|
} |
And here as well:
|
static suppressWhenArgumentMatchesName(): boolean { |
|
return this.pythonConfiguration.get("suppressWhenArgumentMatchesName"); |
|
} |
|
} |
Finally we just need to modify the condition to also check the ignore list:
|
if (parameters[index] === undefined || parameters[index].name === undefined) continue; |
The modified condition would be something along the lines of:
if (
parameters[index] === undefined ||
parameters[index].name === undefined ||
PythonConfiguration.functionsToIgnore().includes(parameters[index].name)
) {
continue;
}
Thanks for reading this long write-up :) . I will be very grateful if this can be implemented in any way, shape or form.
I'll gladly help/assist if I can be of any use :D