Restore include completion on #

This commit is contained in:
Jacob Dufault 2018-03-19 19:50:22 -07:00
parent 6d42b40319
commit 3f5e34ef20

View File

@ -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 {