Вопрос

I thought that both of emacs default completion an semantic completions does their job based on the same tag file but now I see sth else:

this is the result of emacs default completion via ESC + TAB: enter image description here

and this is the result of semantic completion:

enter image description here

What's going on?! don't they use the same tag file? how to find the tag files being used for them?

Это было полезно?

Решение

There are multiple tag tables, and multiple ways to scan through the tag tables.

I did: C-h k M-TAB and it said:

Perform tags completion on the text around point.
If a tags table is loaded, call `complete-tag'.
Otherwise, if Semantic is active, call `semantic-ia-complete-symbol'.

Complete-tag uses a tags table from etags. It is a file probably called TAGS, and if you had previously used M-. to jump to a tag, it will use that.

It then tries to use the semantic function listed. That first tries to use 'smart completion'. That basically means it will analyze the local context, and try to figure out a short smart list of options, filtered by data type and such. If that fails, it then accesses the rest of semantic's tag table restricted to the current file to prevent symbol overload. Semantic's tags are in ~/.semanticdb which is saved via files named by directory. Those tables were also used for smart completion, and have a lot more info in them than TAGS, including data types and arguments that can be used to improve the quality of smart completion filtering.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top