1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-18 00:42:13 +03:00

Show brief comments in clang completion description

This commit is contained in:
Maxime Coste 2014-11-20 13:18:01 +00:00
parent 314d662c5f
commit b3a2e4bd25

View File

@ -29,20 +29,21 @@ def clang-complete %{
pos=-:${kak_cursor_line}:${kak_cursor_column}
cd $(dirname ${kak_buffile})
header="${kak_cursor_line}.${kak_cursor_column}@${kak_timestamp}"
compl=$(clang++ -x c++ -fsyntax-only ${kak_opt_clang_options} -Xclang -code-completion-at=${pos} - < ${dir}/buf 2> ${dir}/errors |
compl=$(clang++ -x ${ft} -fsyntax-only ${kak_opt_clang_options} -Xclang -code-completion-brief-comments -Xclang -code-completion-at=${pos} - < ${dir}/buf 2> ${dir}/errors |
awk -F ': ' -e '
/^COMPLETION:/ && ! /\(Hidden\)/ {
gsub(/[[{<]#|#[}>]/, "", $3)
gsub(/#]/, " ", $3)
gsub(/:: /, "::", $3)
gsub(/ +$/, "", $3)
gsub(/:/, "\\:", $2)
gsub(/:/, "\\:", $3)
id=substr($2, 1, length($2)-1)
gsub(/:/, "\\:", id)
desc=$4 ? $3 "\\n" $4 : $3
gsub(/:/, "\\:", desc)
if (id in completions)
completions[id]=completions[id] "\\n" $3
completions[id]=completions[id] "\\n" desc
else
completions[id]=$3
completions[id]=desc
}
END {
for (id in completions)