mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-27 18:11:57 +00:00
Restore include completion on #
This commit is contained in:
parent
6d42b40319
commit
3f5e34ef20
@ -115,7 +115,7 @@ ParseIncludeLineResult ParseIncludeLine(const std::string& line) {
|
|||||||
"(.*)"); // [7]: suffix after quote char
|
"(.*)"); // [7]: suffix after quote char
|
||||||
std::smatch match;
|
std::smatch match;
|
||||||
bool ok = std::regex_match(line, match, pattern);
|
bool ok = std::regex_match(line, match, pattern);
|
||||||
std::string text = match[6].str();
|
std::string text = match[3].str() + match[6].str();
|
||||||
return {ok, text, match};
|
return {ok, text, match};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,8 +298,6 @@ struct TextDocumentCompletionHandler : MessageHandler {
|
|||||||
Out_TextDocumentComplete out;
|
Out_TextDocumentComplete out;
|
||||||
out.id = request->id;
|
out.id = request->id;
|
||||||
|
|
||||||
std::string text = result.match[3];
|
|
||||||
if (std::string_view("include").compare(0, text.size(), text) == 0) {
|
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(
|
std::unique_lock<std::mutex> lock(
|
||||||
include_complete->completion_items_mutex, std::defer_lock);
|
include_complete->completion_items_mutex, std::defer_lock);
|
||||||
@ -325,7 +323,6 @@ struct TextDocumentCompletionHandler : MessageHandler {
|
|||||||
item.textEdit->range.end.line = request->params.position.line;
|
item.textEdit->range.end.line = request->params.position.line;
|
||||||
item.textEdit->range.end.character = (int)buffer_line.size();
|
item.textEdit->range.end.character = (int)buffer_line.size();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
QueueManager::WriteStdout(IpcId::TextDocumentCompletion, out);
|
QueueManager::WriteStdout(IpcId::TextDocumentCompletion, out);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user