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

Improvements #549

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Improvements #549

wants to merge 14 commits into from

Conversation

DroZ-hun
Copy link
Contributor

@DroZ-hun DroZ-hun commented Feb 4, 2018

Following extra functionalities are implemented in separate commits:

  • Option to disable preview window.
  • When jumping to declaration print whether we go jump to a virtual method to warn user that actually other derived function could be called.
  • Possibility and keybinding to print type of identifiers and if identifier is an enum, then it's value as well.
  • Remove extra =? in optional argument in newer clang libraries, which supports printing default value.
  • Making it possible to disable/change the mappings.

…hod.

If method in class (or base class) is virtual, then error highlight is
used to indicate that it is possible that this is not the function which will
will be really called.
Mapping can be changed with global variable, and enum value is also printed,
if element is an enum constant.
@xaizek
Copy link
Collaborator

xaizek commented Feb 4, 2018

@DroZ-hun, are you actively using the plugin? You have made changes in pretty much every part of the plugin properly documenting them along the way, I'm thinking maybe it makes sense to ask Rip-Rip to give you write access in case you can and are willing to maintain the plugin in some way?

@DroZ-hun
Copy link
Contributor Author

DroZ-hun commented Feb 4, 2018

Well, I am actively using the plugin, these are changes, which I have made over the time, but had no time until now to shape them in a way to be able to merge them back (follow conventions, etc.).

So I would gladly accept the push permission, but I do not think I will have the time to regularly maintain the repo, so maybe it is not worth it.

@DroZ-hun
Copy link
Contributor Author

DroZ-hun commented Feb 6, 2018

Adding two fixes:

  • one is fixing an old bug, which bothered me some times back, but decided, that I will just not use that preview setting,
  • the other is again something I have not used but other could have, this later only comes out when default mapping is changed for snippet jumping in clang snippet and completion menu is closed by or .

…s not the default ...

When g:clang_complete_snippet_jump_map is not the default then two things broke:
- snippet jumping after completion and
- using mapped key when there is nothing to jump to (there is nothing to replace)
This commit fixes that.
…key (like semicolon) to close selection ...

When g:clang_close_preview is set to 1 then preview window should close whenever completion is selected.
This worked when enter key was pressed or <c-y>, but when user just wanted to continue the code for example
they pressed a semicolon, then preview window did not close, just the selection menu.

After this it will close even in this scenario (if g:clang_close_preview is set to 1).
Intentionallly in this case the first replacable is not selected (TriggerSnippet() is not called),
this is as it was before in this scenario, so user can continue the writing of the code as they started.
(They already started typing the code after completion and exited from completion selection menu by doing so.)
@DroZ-hun
Copy link
Contributor Author

I think that few pull requests I do (up till now I have this and had an other 2 and a half years back) does not worth to have write permission, but if you think otherwise, then I can request it form Rip-Rip via email.

@xaizek
Copy link
Collaborator

xaizek commented Feb 10, 2018

Well, if you don't have much time, then it's probably not worth it. The problem with the project is that there seem to be no more people who both have write permissions and still use the plugin. That's why I don't even merge things much as I'm not able to test them adequately, and it's probably better to keep what's already there working than break things by merging untested changes.

Thanks for the changes either way, somebody might find them helpful.

@DroZ-hun
Copy link
Contributor Author

That's too bad, this is a nice plugin.
Well I am pretty sure lot's of people chose this plugin when working with c/c++ using vim, so I am hoping someone will have time to maintain it, and will chose to do so.

When printing type (g:clang_print_type_key),
also print constant value if known.

Currently macros can only be calculated if you assign them.

In this example, value is not shown when cursor is over MACRO1,
but it is when cursor is over MYCONST1 (14 is shown)
or MYCONST2 (30 is shown):

  #define MACRO1 14
  #define MACRO2(x,y) ((x)*(y))
  const int MYCONST1 = MACRO1;
  const int MYCONST2 = MACRO2(6,5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants