-
Notifications
You must be signed in to change notification settings - Fork 55
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
Missing documentation on refactoring & completion #82
Comments
May also include completion on enum based switches. See clangd/clangd#807 . |
I think it would be valuable to document all refactorings / tweaks. Are you interested in writing a documentation patch? |
That will be fun. Can we collect a comprehensive list of refactoring support and tweaks for me to write up? Also, what should be noted upon refactoring. The list:
Hidden tweaks
Improvements
Edit: please assign this issue to me. Edit 2: @HighCommander4 Can you double check the above list of functionalities for me to see if there's anything missing? And if they are on the right "since" version. Also, since we haven't released version 16 yet (clangd/clangd#1567) should I include the "Expand Deduced type"? |
Thanks for your interest!
I think the authoritative list here is the source: https://searchfox.org/llvm/source/clang-tools-extra/clangd/refactor/tweaks As you can see, there are quite a few. Feel free to cover just a subset of them initially and leave others for later, if that makes things easier. The tests are also helpful to get a feel for what each refactoring can do: https://searchfox.org/llvm/source/clang-tools-extra/clangd/unittests/tweaks
I think a 1-sentence description and one before/after code example for each tweak would be a good start. Another thing that would be valuable to document are significant limitations of a given refactoring, for example the fact that "extract function" does not currently support extracting a single expression-statement as dicussed in clangd/clangd#1254, however this is often not obvious without more in-depth knowledge of the refactoring (to me either), so we can probably leave this for future additions. |
I don't have the permission to do that in this repository (it's not in the clangd org). Let's ask @kadircet. |
As for tweak documentation, we usually have a good description of what they do, sometimes even with examples, as class documentation. See https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp#L35. |
Also thanks for doing this! |
Thanks for the tip! |
This one is hidden.
It sounds like this is a tweak for wrapping an objective-C string literal into an
(You linked to "remove using namespace" here, but I believe you're right about "generate move/copy..." being added in clangd 15.)
This one is actually an improvement of the "expand auto type" code action originally added in clangd 9, to also support Otherwise your list looks good to me! |
There are two more, DefineInline and DefineOutline. |
nice catch! |
Proposed classification: Code completionPopulate switch statement [since 12] RefactorRemove using name space [since 10] |
You can track my progress here: |
Currently, only rename is mentioned under the features tab.
Should we include other implemented refactoring features like inline/ extract variables?
Related: clangd/clangd#446 (comment)
Besides inline/ extract variables, refactoring functionalities under clangd/refactor/tweaks is barely documented.
Is this intended?
The text was updated successfully, but these errors were encountered: