loom
28 строк · 960.0 Байт
1#include "simodo/lsp-server/ReportCombiner.h"
2
3#include <algorithm>
4#include <mutex>
5
6namespace simodo::lsp
7{
8void ReportCombiner::report(const inout::SeverityLevel level,
9const inout::Location & location,
10const std::string & briefly,
11const std::string & atlarge)
12{
13static std::mutex report_mutex;
14std::lock_guard locker(report_mutex);
15
16if (!briefly.empty() && briefly[0] == '#')
17;
18else if ( _messages.end() != std::find_if(_messages.begin(), _messages.end(),
19[location,briefly](const MessageFullContent & cont){
20return cont.location.uri() == location.uri()
21&& cont.briefly == briefly;
22}))
23return;
24
25_messages.push_back({level,location,briefly,atlarge});
26}
27
28}