Fix clang completion output parsing

This commit is contained in:
Maxime Coste 2019-12-15 10:32:14 +11:00
parent 4d240b670c
commit 90ec9434b7

View File

@ -55,13 +55,14 @@ The syntaxic errors detected during parsing are shown when auto-diagnostics are
awk -F ': ' ' awk -F ': ' '
/^COMPLETION:/ && $2 !~ /[(,](Hidden|Inaccessible)[),]/ { /^COMPLETION:/ && $2 !~ /[(,](Hidden|Inaccessible)[),]/ {
candidate=$3 candidate=$3
gsub(/[[<{]#.+?#[]>}]/, "", candidate) gsub(/[[<{]#[^#]*#[]>}]/, "", candidate)
gsub(/~/, "~~", candidate) gsub(/~/, "~~", candidate)
gsub(/\|/, "\\|", candidate) gsub(/\|/, "\\|", candidate)
gsub(/[[{<]#|#[]}>]/, " ", $3) gsub(/[[{<]#|#[]}>]/, " ", $3)
gsub(/:: /, "::", $3) gsub(/:: /, "::", $3)
gsub(/ +$/, "", $3) gsub(/ ,/, ",", $3)
gsub(/^ +| +$/, "", $3)
docstring=$4 ? $3 "\n" $4 : $3 docstring=$4 ? $3 "\n" $4 : $3
gsub(/~|!/, "&&", docstring) gsub(/~|!/, "&&", docstring)