citre icon indicating copy to clipboard operation
citre copied to clipboard

No completion after dot typed

Open wanghaiqiangk opened this issue 2 years ago • 2 comments

There is a misleading in the README, though not sure if that is only restricted to me.

It's said that if a dot is typed, the citre then guesses the following symbol should be a struct member and so that completion is limited to member. But when I type, e.g. foo., no completion pops up. Only after continuing to type partial member's name does the completion appear.

And another one. The candidates of a struct are not exactly constrained to THAT struct. Instead, all candidates, as long as they are tagged as member, are listed.

I guess these two phenomena are intrinsic drawbacks from the backend of ctags. It's good at searching with a well defined name at a global scope, but weak at completion or semantics. I mean it cannot find the relationship between two related symbols and tag such attribution.

Is my assumption correct? Do you have any idea about how to make it more completion friendly? Thanks in advacne.

wanghaiqiangk avatar Sep 03 '21 03:09 wanghaiqiangk

It's said that if a dot is typed, the citre then guesses the following symbol should be a struct member

The condition, according to README, is "If the current symbol is after a dot", not "if a dot is typed".

Is my assumption correct?

Mostly correct. But using universal ctags, since we have all those fields (kind, scope, inherit...), it is possible to "find the relationship between two related symbols". This requires Citre to code for every specific language and specific case.

Do you have any idea about how to make it more completion friendly?

See #83. It needs much work and I'm currently not focusing on it (I plan to write a gtags plugin for citre recently).

AmaiKinono avatar Sep 03 '21 04:09 AmaiKinono

Pedantically, we do need to type partial symbol's name after the dot to enable completion as the README says. But that doesn't necessarily imply that there wasn't any completion if only a dot presented.

While, the natural concept of completion contains the ability to show all object's members if a member accessing specifier is typed. Otherwise, people won't suggest and require this feature. Therefore, I would like to propose that you can mention this glitch and your ongoing plans in README.

wanghaiqiangk avatar Sep 03 '21 04:09 wanghaiqiangk