mirror of https://github.com/dense-analysis/ale
Fix broken tag references and the broken script to check them
This commit is contained in:
parent
e1ae009bac
commit
da5fa17df1
|
@ -168,7 +168,7 @@ g:ale_c_cc_header_exts *g:ale_c_cc_header_exts*
|
||||||
considered as header files.
|
considered as header files.
|
||||||
|
|
||||||
This variable is only used when `'-x c-header'` is used instead of `'-x c'`,
|
This variable is only used when `'-x c-header'` is used instead of `'-x c'`,
|
||||||
see |ale_c_cc_use_header_lang_flag|.
|
see |g:ale_c_cc_use_header_lang_flag|.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
|
|
|
@ -97,7 +97,7 @@ g:ale_cpp_cc_header_exts *g:ale_cpp_cc_header_exts*
|
||||||
considered as header files.
|
considered as header files.
|
||||||
|
|
||||||
This variable is only used when `'-x c++-header'` is used instead of `'-x c++'`,
|
This variable is only used when `'-x c++-header'` is used instead of `'-x c++'`,
|
||||||
see |ale_cpp_cc_use_header_lang_flag|.
|
see |g:ale_cpp_cc_use_header_lang_flag|.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
|
|
|
@ -17,7 +17,7 @@ CONTENTS *ale-contents*
|
||||||
5.1 Completion........................|ale-completion|
|
5.1 Completion........................|ale-completion|
|
||||||
5.2 Go To Definition..................|ale-go-to-definition|
|
5.2 Go To Definition..................|ale-go-to-definition|
|
||||||
5.3 Go To Type Definition.............|ale-go-to-type-definition|
|
5.3 Go To Type Definition.............|ale-go-to-type-definition|
|
||||||
5.4 Go To Implementation..............|ale-go-to-type-implementation|
|
5.4 Go To Implementation..............|ale-go-to-implementation|
|
||||||
5.5 Find References...................|ale-find-references|
|
5.5 Find References...................|ale-find-references|
|
||||||
5.6 Hovering..........................|ale-hover|
|
5.6 Hovering..........................|ale-hover|
|
||||||
5.7 Symbol Search.....................|ale-symbol-search|
|
5.7 Symbol Search.....................|ale-symbol-search|
|
||||||
|
|
|
@ -7,16 +7,24 @@ tag_regex='[gb]\?:\?\(ale\|ALE\)[a-zA-Z_\-]\+'
|
||||||
|
|
||||||
tags="$(mktemp -t tags.XXXXXXXX)"
|
tags="$(mktemp -t tags.XXXXXXXX)"
|
||||||
refs="$(mktemp -t refs.XXXXXXXX)"
|
refs="$(mktemp -t refs.XXXXXXXX)"
|
||||||
|
result="$(mktemp -t refs.XXXXXXXX)"
|
||||||
# Grep for tags and references, and complain if we find a reference without
|
# Grep for tags and references, and complain if we find a reference without
|
||||||
# a tag for the reference. Only our tags will be included.
|
# a tag for the reference. Only our tags will be included.
|
||||||
grep --exclude=tags -roh "\\*$tag_regex\\*" doc | sed 's/*//g' | sort -u > "$tags"
|
grep --exclude=tags -roh "\\*$tag_regex\\*" doc | sed 's/*//g' | sort -u > "$tags"
|
||||||
grep --exclude=tags -roh "|$tag_regex|" doc | sed 's/|//g' | sort -u > "$refs"
|
grep --exclude=tags -roh "|$tag_regex|" doc | sed 's/|//g' | sort -u > "$refs"
|
||||||
|
|
||||||
|
# Collect tags in a file we can display to the user if there are differences.
|
||||||
|
comm -23 "$refs" "$tags" > "$result"
|
||||||
|
|
||||||
exit_code=0
|
exit_code=0
|
||||||
|
|
||||||
if ! [[ $(comm -23 $refs $tags | wc -l) -eq 0 ]]; then
|
# If there are differences, show them and error out.
|
||||||
exit_code=1
|
if ! [[ $(wc -l < "$result") -eq 0 ]]; then
|
||||||
|
cat "$result"
|
||||||
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm "$tags"
|
rm "$tags"
|
||||||
rm "$refs"
|
rm "$refs"
|
||||||
|
rm "$result"
|
||||||
|
exit $exit_code
|
||||||
|
|
Loading…
Reference in New Issue