Closed jvillasante closed 6 years ago
This means that ycmd found more than 30 diagnostics when parsing the translation unit. This limit is configurable through the max_diagnostics_to_display
option (a value of 0
means no limit). However, emacs-ycmd doesn't seem to provide a way to configure this option.
But why or how does ycmd gets to that number of diagnostincs. The file compiles with all -Wall -Werror et. al. without any warnings.
Here's the code that compiles just fine without any warnings:
#include <iostream>
#include <string>
#include <algorithm>
#include <iterator>
#include <list>
template <typename InIt, typename OutIt, typename T, typename F>
InIt split(InIt it, InIt end_it, OutIt out_it, const T& split_val,
F&& bin_func) {
while (it != end_it) {
auto slice_end{std::find(it, end_it, split_val)};
*out_it++ = bin_func(it, slice_end);
if (slice_end == end_it) {
return end_it;
}
it = std::next(slice_end);
}
return it;
}
int main() {
const std::string s{"a-b-c-d-e-f-g"};
auto binfunc{[](auto it_a, auto it_b) { return std::string{it_a, it_b}; }};
std::list<std::string> l;
split(std::begin(s), std::end(s), std::back_inserter(l), '-', binfunc);
std::copy(std::begin(l), std::end(l),
std::ostream_iterator<std::string>{std::cout, "\n"});
return 0;
}
It seems that ycmd is trying to parse system files as can be seen in this extract of the ycmd logs
(((kind . "ERROR")
(text . "use of undeclared identifier 'wcschr'")
(ranges)
(location
(filepath . "/usr/local/opt/llvm/include/c++/v1/wchar.h")
(column_num . 77)
(line_num . 137))
(location_extent
(start
(filepath . "/usr/local/opt/llvm/include/c++/v1/wchar.h")
(column_num . 77)
(line_num . 137))
(end
(filepath . "/usr/local/opt/llvm/include/c++/v1/wchar.h")
(column_num . 83)
(line_num . 137)))
(fixit_available . :json-false))
Is there a way to overcome this?
Changing .ycm_extra_config.py
to this .ycm_extra_config file solves the issue. This one can be closed.
Thanks!
I have the same problems and this ycmd extra config does not solve it. I am wondering why ycmd diagnostics does not show first max_diagnostics_to_display
entries, rather showing one message that the limit is exceeded. What could be helpful if I could see first errors and may be figure out what am I missing, what is wrong with the code.
I have just cloned the repo and loaded from source. where I changed max_diagnostics_to_display
to 0
. After that I was able to see some helpful information, it was a single warning. Weird...
I keep getting this warning on a compilation unit that otherwise compiles without warnings. Don't know if this is the right place to ask but is there something that I don't know about this warning?
I'm using defaults with
.ycm_extra_conf.py
from ycmd.Here's my debug info:
Also, there are some flags that I'm not setting myself, does ycmd does this by itself? All of this flags are not added by me:
For completion, here's my
.ycm_extra_conf.py
Thanks in advance!