Commit 92b09633 authored by Ole Christian Eidheim's avatar Ole Christian Eidheim

Renamed enum class enumerators

parent ada70868
Pipeline #94171239 passed with stages
in 18 minutes and 3 seconds
......@@ -10,7 +10,7 @@ Autocomplete::Autocomplete(Gtk::TextView *view, bool &interactive_completion, gu
}
if(!this->view->has_focus())
return;
if(is_continue_key(last_keyval) && (this->interactive_completion || state != State::IDLE))
if(is_continue_key(last_keyval) && (this->interactive_completion || state != State::idle))
run();
else {
stop();
......@@ -44,13 +44,13 @@ void Autocomplete::run() {
if(!is_processing())
return;
if(state == State::CANCELED)
state = State::RESTARTING;
if(state == State::canceled)
state = State::restarting;
if(state != State::IDLE)
if(state != State::idle)
return;
state = State::STARTING;
state = State::starting;
before_add_rows();
......@@ -83,13 +83,13 @@ void Autocomplete::run() {
if(is_processing()) {
dispatcher.post([this]() {
after_add_rows();
if(state == State::RESTARTING) {
state = State::IDLE;
if(state == State::restarting) {
state = State::idle;
reparse();
run();
}
else if(state == State::CANCELED || rows.empty()) {
state = State::IDLE;
else if(state == State::canceled || rows.empty()) {
state = State::idle;
reparse();
}
else {
......@@ -100,7 +100,7 @@ void Autocomplete::run() {
prefix_size = prefix.size();
}
if(prefix_size > 0 && !start_iter.backward_chars(prefix_size)) {
state = State::IDLE;
state = State::idle;
reparse();
return;
}
......@@ -110,7 +110,7 @@ void Autocomplete::run() {
CompletionDialog::get()->add_row(row);
row.clear();
}
state = State::IDLE;
state = State::idle;
view->get_buffer()->begin_user_action();
CompletionDialog::get()->show();
......@@ -119,20 +119,20 @@ void Autocomplete::run() {
}
else {
dispatcher.post([this] {
state = State::CANCELED;
state = State::canceled;
on_add_rows_error();
});
}
});
}
if(state != State::IDLE)
if(state != State::idle)
cancel_reparse();
}
void Autocomplete::stop() {
if(state == State::STARTING || state == State::RESTARTING)
state = State::CANCELED;
if(state == State::starting || state == State::restarting)
state = State::canceled;
}
void Autocomplete::setup_dialog() {
......
......@@ -15,14 +15,14 @@ class Autocomplete {
Dispatcher dispatcher;
public:
enum class State { IDLE, STARTING, RESTARTING, CANCELED };
enum class State { idle, starting, restarting, canceled };
Mutex prefix_mutex;
Glib::ustring prefix GUARDED_BY(prefix_mutex);
std::vector<std::string> rows;
Tooltips tooltips;
std::atomic<State> state = {State::IDLE};
std::atomic<State> state = {State::idle};
std::thread thread;
......
......@@ -718,12 +718,12 @@ void Directories::add_or_update_path(const boost::filesystem::path &dir_path, co
grandchild->set_value(column_record.is_directory, false);
grandchild->set_value(column_record.name, std::string("(empty)"));
grandchild->set_value(column_record.markup, Glib::Markup::escape_text("(empty)"));
grandchild->set_value(column_record.type, PathType::UNKNOWN);
grandchild->set_value(column_record.type, PathType::unknown);
}
else {
auto language = Source::guess_language(it->path().filename());
if(!language)
child->set_value(column_record.type, PathType::UNKNOWN);
child->set_value(column_record.type, PathType::unknown);
}
}
}
......@@ -741,7 +741,7 @@ void Directories::add_or_update_path(const boost::filesystem::path &dir_path, co
child->set_value(column_record.is_directory, false);
child->set_value(column_record.name, std::string("(empty)"));
child->set_value(column_record.markup, Glib::Markup::escape_text("(empty)"));
child->set_value(column_record.type, PathType::UNKNOWN);
child->set_value(column_record.type, PathType::unknown);
}
colorize_path(dir_path, include_parent_paths);
......@@ -768,7 +768,7 @@ void Directories::remove_path(const boost::filesystem::path &dir_path) {
child->set_value(column_record.is_directory, false);
child->set_value(column_record.name, std::string("(empty)"));
child->set_value(column_record.markup, Glib::Markup::escape_text("(empty)"));
child->set_value(column_record.type, PathType::UNKNOWN);
child->set_value(column_record.type, PathType::unknown);
}
}
......@@ -840,7 +840,7 @@ void Directories::colorize_path(boost::filesystem::path dir_path_, bool include_
child.set_value(column_record.markup, "<span foreground=\"" + ss.str() + "\">" + name + "</span>");
auto type = child.get_value(column_record.type);
if(type == PathType::UNKNOWN)
if(type == PathType::unknown)
child.set_value(column_record.markup, "<i>" + child.get_value(column_record.markup) + "</i>");
}
......
......@@ -19,7 +19,7 @@ class Directories : public Gtk::ListViewText {
std::shared_ptr<sigc::connection> connection;
};
enum class PathType { KNOWN, UNKNOWN };
enum class PathType { known, unknown };
class TreeStore : public Gtk::TreeStore {
protected:
......
......@@ -141,32 +141,19 @@ Git::Repository::Status Git::Repository::get_status() {
error.code = git_status_foreach(repository.get(), [](const char *path, unsigned int status_flags, void *payload) {
auto data = static_cast<Data *>(payload);
STATUS status;
bool new_ = false;
bool modified = false;
if((status_flags & (GIT_STATUS_INDEX_NEW | GIT_STATUS_WT_NEW)) > 0)
status = STATUS::NEW;
new_ = true;
else if((status_flags & (GIT_STATUS_INDEX_MODIFIED | GIT_STATUS_WT_MODIFIED)) > 0)
status = STATUS::MODIFIED;
else if((status_flags & (GIT_STATUS_INDEX_DELETED | GIT_STATUS_WT_DELETED)) > 0)
status = STATUS::DELETED;
else if((status_flags & (GIT_STATUS_INDEX_RENAMED | GIT_STATUS_WT_RENAMED)) > 0)
status = STATUS::RENAMED;
else if((status_flags & (GIT_STATUS_INDEX_TYPECHANGE | GIT_STATUS_WT_TYPECHANGE)) > 0)
status = STATUS::TYPECHANGE;
else if((status_flags & (GIT_STATUS_WT_UNREADABLE)) > 0)
status = STATUS::UNREADABLE;
else if((status_flags & (GIT_STATUS_IGNORED)) > 0)
status = STATUS::IGNORED;
else if((status_flags & (GIT_STATUS_CONFLICTED)) > 0)
status = STATUS::CONFLICTED;
else
status = STATUS::CURRENT;
modified = true;
boost::filesystem::path rel_path(path);
do {
if(status == STATUS::MODIFIED)
data->status.modified.emplace((data->work_path / rel_path).generic_string());
if(status == STATUS::NEW)
if(new_)
data->status.added.emplace((data->work_path / rel_path).generic_string());
else if(modified)
data->status.modified.emplace((data->work_path / rel_path).generic_string());
rel_path = rel_path.parent_path();
} while(!rel_path.empty());
......
......@@ -52,7 +52,6 @@ public:
std::string get_details(const std::string &buffer, int line_nr);
};
enum class STATUS { CURRENT, NEW, MODIFIED, DELETED, RENAMED, TYPECHANGE, UNREADABLE, IGNORED, CONFLICTED };
class Status {
public:
std::unordered_set<std::string> added;
......
......@@ -76,12 +76,12 @@ Glib::RefPtr<Gsv::Language> Source::guess_language(const boost::filesystem::path
Source::FixIt::FixIt(std::string source_, std::pair<Offset, Offset> offsets_) : source(std::move(source_)), offsets(std::move(offsets_)) {
if(this->source.size() == 0)
type = Type::ERASE;
type = Type::erase;
else {
if(this->offsets.first == this->offsets.second)
type = Type::INSERT;
type = Type::insert;
else
type = Type::REPLACE;
type = Type::replace;
}
}
......@@ -92,11 +92,11 @@ std::string Source::FixIt::string(const Glib::RefPtr<Gtk::TextBuffer> &buffer) {
unsigned second_line_offset = iter.get_line_offset() + 1;
std::string text;
if(type == Type::INSERT) {
if(type == Type::insert) {
text += "Insert " + source + " at ";
text += std::to_string(offsets.first.line + 1) + ":" + std::to_string(first_line_offset);
}
else if(type == Type::REPLACE) {
else if(type == Type::replace) {
text += "Replace ";
text += std::to_string(offsets.first.line + 1) + ":" + std::to_string(first_line_offset) + " - ";
text += std::to_string(offsets.second.line + 1) + ":" + std::to_string(second_line_offset);
......
......@@ -41,7 +41,7 @@ namespace Source {
class FixIt {
public:
enum class Type { INSERT, REPLACE, ERASE };
enum class Type { insert, replace, erase };
FixIt(std::string source_, std::pair<Offset, Offset> offsets_);
......
......@@ -93,8 +93,8 @@ void Source::ClangViewParse::parse_initialize() {
parsed = false;
if(parse_thread.joinable())
parse_thread.join();
parse_state = ParseState::PROCESSING;
parse_process_state = ParseProcessState::STARTING;
parse_state = ParseState::processing;
parse_process_state = ParseProcessState::starting;
auto buffer_ = get_buffer()->get_text();
auto &buffer_raw = const_cast<std::string &>(buffer_.raw());
......@@ -138,31 +138,31 @@ void Source::ClangViewParse::parse_initialize() {
update_status_state(this);
parse_thread = std::thread([this]() {
while(true) {
while(parse_state == ParseState::PROCESSING && parse_process_state != ParseProcessState::STARTING && parse_process_state != ParseProcessState::PROCESSING)
while(parse_state == ParseState::processing && parse_process_state != ParseProcessState::starting && parse_process_state != ParseProcessState::processing)
std::this_thread::sleep_for(std::chrono::milliseconds(10));
if(parse_state != ParseState::PROCESSING)
if(parse_state != ParseState::processing)
break;
auto expected = ParseProcessState::STARTING;
if(parse_process_state.compare_exchange_strong(expected, ParseProcessState::PREPROCESSING)) {
auto expected = ParseProcessState::starting;
if(parse_process_state.compare_exchange_strong(expected, ParseProcessState::preprocessing)) {
dispatcher.post([this] {
auto expected = ParseProcessState::PREPROCESSING;
auto expected = ParseProcessState::preprocessing;
if(parse_mutex.try_lock()) {
if(parse_process_state.compare_exchange_strong(expected, ParseProcessState::PROCESSING))
if(parse_process_state.compare_exchange_strong(expected, ParseProcessState::processing))
parse_thread_buffer = get_buffer()->get_text();
parse_mutex.unlock();
}
else
parse_process_state.compare_exchange_strong(expected, ParseProcessState::STARTING);
parse_process_state.compare_exchange_strong(expected, ParseProcessState::starting);
});
}
else if(parse_process_state == ParseProcessState::PROCESSING && parse_mutex.try_lock()) {
else if(parse_process_state == ParseProcessState::processing && parse_mutex.try_lock()) {
auto &parse_thread_buffer_raw = const_cast<std::string &>(parse_thread_buffer.raw());
if(this->language && (this->language->get_id() == "chdr" || this->language->get_id() == "cpphdr"))
clangmm::remove_include_guard(parse_thread_buffer_raw);
auto status = clang_tu->reparse(parse_thread_buffer_raw);
if(status == 0) {
auto expected = ParseProcessState::PROCESSING;
if(parse_process_state.compare_exchange_strong(expected, ParseProcessState::POSTPROCESSING)) {
auto expected = ParseProcessState::processing;
if(parse_process_state.compare_exchange_strong(expected, ParseProcessState::postprocessing)) {
clang_tokens = clang_tu->get_tokens();
clang_tokens_offsets.clear();
clang_tokens_offsets.reserve(clang_tokens->size());
......@@ -172,8 +172,8 @@ void Source::ClangViewParse::parse_initialize() {
parse_mutex.unlock();
dispatcher.post([this] {
if(parse_mutex.try_lock()) {
auto expected = ParseProcessState::POSTPROCESSING;
if(parse_process_state.compare_exchange_strong(expected, ParseProcessState::IDLE)) {
auto expected = ParseProcessState::postprocessing;
if(parse_process_state.compare_exchange_strong(expected, ParseProcessState::idle)) {
update_syntax();
update_diagnostics();
parsed = true;
......@@ -189,7 +189,7 @@ void Source::ClangViewParse::parse_initialize() {
parse_mutex.unlock();
}
else {
parse_state = ParseState::STOP;
parse_state = ParseState::stop;
parse_mutex.unlock();
dispatcher.post([this] {
Terminal::get().print("Error: failed to reparse " + this->file_path.string() + ".\n", true);
......@@ -211,15 +211,15 @@ void Source::ClangViewParse::soft_reparse(bool delayed) {
parsed = false;
delayed_reparse_connection.disconnect();
if(parse_state != ParseState::PROCESSING)
if(parse_state != ParseState::processing)
return;
parse_process_state = ParseProcessState::IDLE;
parse_process_state = ParseProcessState::idle;
auto reparse = [this] {
parsed = false;
auto expected = ParseProcessState::IDLE;
if(parse_process_state.compare_exchange_strong(expected, ParseProcessState::STARTING)) {
auto expected = ParseProcessState::idle;
if(parse_process_state.compare_exchange_strong(expected, ParseProcessState::starting)) {
status_state = "parsing...";
if(update_status_state)
update_status_state(this);
......@@ -556,7 +556,7 @@ Source::ClangViewAutocomplete::ClangViewAutocomplete(const boost::filesystem::pa
};
autocomplete.is_processing = [this] {
return parse_state == ParseState::PROCESSING;
return parse_state == ParseState::processing;
};
autocomplete.reparse = [this] {
......@@ -574,7 +574,7 @@ Source::ClangViewAutocomplete::ClangViewAutocomplete(const boost::filesystem::pa
};
autocomplete.stop_parse = [this]() {
parse_process_state = ParseProcessState::IDLE;
parse_process_state = ParseProcessState::idle;
};
// Activate argument completions
......@@ -712,12 +712,12 @@ Source::ClangViewAutocomplete::ClangViewAutocomplete(const boost::filesystem::pa
clangmm::remove_include_guard(buffer);
code_complete_results = std::make_unique<clangmm::CodeCompleteResults>(clang_tu->get_code_completions(buffer, line_number, column));
if(code_complete_results->cx_results == nullptr) {
auto expected = ParseState::PROCESSING;
parse_state.compare_exchange_strong(expected, ParseState::RESTARTING);
auto expected = ParseState::processing;
parse_state.compare_exchange_strong(expected, ParseState::restarting);
return;
}
if(autocomplete.state == Autocomplete::State::STARTING) {
if(autocomplete.state == Autocomplete::State::starting) {
std::string prefix;
{
LockGuard lock(autocomplete.prefix_mutex);
......@@ -1881,7 +1881,7 @@ void Source::ClangView::full_reparse() {
delayed_reparse_connection.disconnect();
delayed_full_reparse_connection.disconnect();
if(parse_state != ParseState::PROCESSING)
if(parse_state != ParseState::processing)
return;
if(full_reparse_running) {
......@@ -1894,10 +1894,10 @@ void Source::ClangView::full_reparse() {
full_reparse_needed = false;
parse_process_state = ParseProcessState::IDLE;
autocomplete.state = Autocomplete::State::IDLE;
auto expected = ParseState::PROCESSING;
if(!parse_state.compare_exchange_strong(expected, ParseState::RESTARTING))
parse_process_state = ParseProcessState::idle;
autocomplete.state = Autocomplete::State::idle;
auto expected = ParseState::processing;
if(!parse_state.compare_exchange_strong(expected, ParseState::restarting))
return;
full_reparse_running = true;
......@@ -1938,9 +1938,9 @@ void Source::ClangView::async_delete() {
auto before_parse_time = std::time(nullptr);
delete_thread = std::thread([this, before_parse_time, project_paths_in_use = std::move(project_paths_in_use), buffer_modified = get_buffer()->get_modified()] {
while(!parsed && parse_state != ParseState::STOP)
while(!parsed && parse_state != ParseState::stop)
std::this_thread::sleep_for(std::chrono::milliseconds(10));
parse_state = ParseState::STOP;
parse_state = ParseState::stop;
if(buffer_modified) {
std::ifstream stream(file_path.string(), std::ios::binary);
......
......@@ -13,8 +13,8 @@
namespace Source {
class ClangViewParse : public View {
protected:
enum class ParseState { PROCESSING, RESTARTING, STOP };
enum class ParseProcessState { IDLE, STARTING, PREPROCESSING, PROCESSING, POSTPROCESSING };
enum class ParseState { processing, restarting, stop };
enum class ParseProcessState { idle, starting, preprocessing, processing, postprocessing };
public:
ClangViewParse(const boost::filesystem::path &file_path, const Glib::RefPtr<Gsv::Language> &language);
......
......@@ -95,7 +95,7 @@ void Source::DiffView::configure() {
}
get_gutter(Gtk::TextWindowType::TEXT_WINDOW_LEFT)->insert(renderer.get(), -40);
parse_state = ParseState::STARTING;
parse_state = ParseState::starting;
parse_stop = false;
monitor_changed = false;
......@@ -120,10 +120,10 @@ void Source::DiffView::configure() {
get_buffer()->remove_tag(renderer->tag_removed_above, start_iter, end_iter);
get_buffer()->remove_tag(renderer->tag_removed_below, start_iter, end_iter);
}
parse_state = ParseState::IDLE;
parse_state = ParseState::idle;
delayed_buffer_changed_connection.disconnect();
delayed_buffer_changed_connection = Glib::signal_timeout().connect([this]() {
parse_state = ParseState::STARTING;
parse_state = ParseState::starting;
return false;
}, 250);
}, false);
......@@ -133,10 +133,10 @@ void Source::DiffView::configure() {
if(start_iter.get_line() == end_iter.get_line() && start_iter.has_tag(renderer->tag_added))
return;
parse_state = ParseState::IDLE;
parse_state = ParseState::idle;
delayed_buffer_changed_connection.disconnect();
delayed_buffer_changed_connection = Glib::signal_timeout().connect([this]() {
parse_state = ParseState::STARTING;
parse_state = ParseState::starting;
return false;
}, 250);
}, false);
......@@ -148,7 +148,7 @@ void Source::DiffView::configure() {
delayed_monitor_changed_connection.disconnect();
delayed_monitor_changed_connection = Glib::signal_timeout().connect([this]() {
monitor_changed = true;
parse_state = ParseState::STARTING;
parse_state = ParseState::starting;
LockGuard lock(parse_mutex);
diff = nullptr;
return false;
......@@ -176,24 +176,24 @@ void Source::DiffView::configure() {
try {
while(true) {
while(!parse_stop && parse_state != ParseState::STARTING && parse_state != ParseState::PROCESSING)
while(!parse_stop && parse_state != ParseState::starting && parse_state != ParseState::processing)
std::this_thread::sleep_for(std::chrono::milliseconds(10));
if(parse_stop)
break;
auto expected = ParseState::STARTING;
if(parse_state.compare_exchange_strong(expected, ParseState::PREPROCESSING)) {
auto expected = ParseState::starting;
if(parse_state.compare_exchange_strong(expected, ParseState::preprocessing)) {
dispatcher.post([this] {
auto expected = ParseState::PREPROCESSING;
auto expected = ParseState::preprocessing;
if(parse_mutex.try_lock()) {
if(parse_state.compare_exchange_strong(expected, ParseState::PROCESSING))
if(parse_state.compare_exchange_strong(expected, ParseState::processing))
parse_buffer = get_buffer()->get_text();
parse_mutex.unlock();
}
else
parse_state.compare_exchange_strong(expected, ParseState::STARTING);
parse_state.compare_exchange_strong(expected, ParseState::starting);
});
}
else if(parse_state == ParseState::PROCESSING && parse_mutex.try_lock()) {
else if(parse_state == ParseState::processing && parse_mutex.try_lock()) {
bool expected_monitor_changed = true;
if(monitor_changed.compare_exchange_strong(expected_monitor_changed, false)) {
try {
......@@ -225,13 +225,13 @@ void Source::DiffView::configure() {
lines.modified.clear();
lines.removed.clear();
}
auto expected = ParseState::PROCESSING;
if(parse_state.compare_exchange_strong(expected, ParseState::POSTPROCESSING)) {
auto expected = ParseState::processing;
if(parse_state.compare_exchange_strong(expected, ParseState::postprocessing)) {
parse_mutex.unlock();
dispatcher.post([this] {
if(parse_mutex.try_lock()) {
auto expected = ParseState::POSTPROCESSING;
if(parse_state.compare_exchange_strong(expected, ParseState::IDLE))
auto expected = ParseState::postprocessing;
if(parse_state.compare_exchange_strong(expected, ParseState::idle))
update_lines();
parse_mutex.unlock();
}
......
......@@ -11,7 +11,7 @@
namespace Source {
class DiffView : virtual public Source::BaseView {
enum class ParseState { IDLE, STARTING, PREPROCESSING, PROCESSING, POSTPROCESSING };
enum class ParseState { idle, starting, preprocessing, processing, postprocessing };
class Renderer : public Gsv::GutterRenderer {
public:
......
......@@ -42,7 +42,7 @@ Source::GenericView::GenericView(const boost::filesystem::path &file_path, const
}
Source::GenericView::~GenericView() {
autocomplete.state = Autocomplete::State::IDLE;
autocomplete.state = Autocomplete::State::idle;
if(autocomplete.thread.joinable())
autocomplete.thread.join();
}
......@@ -254,7 +254,7 @@ void Source::GenericView::setup_autocomplete() {
};
autocomplete.add_rows = [this](std::string &buffer, int line_number, int column) {
if(autocomplete.state == Autocomplete::State::STARTING) {
if(autocomplete.state == Autocomplete::State::starting) {
autocomplete_comment.clear();
autocomplete_insert.clear();
......
......@@ -373,9 +373,9 @@ Source::LanguageProtocolView::LanguageProtocolView(const boost::filesystem::path
get_buffer()->signal_insert().connect([this](const Gtk::TextBuffer::iterator &start, const Glib::ustring &text_, int bytes) {
std::string content_changes;
if(capabilities.text_document_sync == LanguageProtocol::Capabilities::TextDocumentSync::NONE)
if(capabilities.text_document_sync == LanguageProtocol::Capabilities::TextDocumentSync::none)
return;
if(capabilities.text_document_sync == LanguageProtocol::Capabilities::TextDocumentSync::INCREMENTAL) {
if(capabilities.text_document_sync == LanguageProtocol::Capabilities::TextDocumentSync::incremental) {
std::string text = text_;
escape_text(text);
content_changes = R"({"range":{"start":{"line": )" + std::to_string(start.get_line()) + ",\"character\":" + std::to_string(start.get_line_offset()) + R"(},"end":{"line":)" + std::to_string(start.get_line()) + ",\"character\":" + std::to_string(start.get_line_offset()) + R"(}},"text":")" + text + "\"}";
......@@ -390,9 +390,9 @@ Source::LanguageProtocolView::LanguageProtocolView(const boost::filesystem::path
get_buffer()->signal_erase().connect([this](const Gtk::TextBuffer::iterator &start, const Gtk::TextBuffer::iterator &end) {
std::string content_changes;
if(capabilities.text_document_sync == LanguageProtocol::Capabilities::TextDocumentSync::NONE)
if(capabilities.text_document_sync == LanguageProtocol::Capabilities::TextDocumentSync::none)
return;
if(capabilities.text_document_sync == LanguageProtocol::Capabilities::TextDocumentSync::INCREMENTAL)
if(capabilities.text_document_sync == LanguageProtocol::Capabilities::TextDocumentSync::incremental)
content_changes = R"({"range":{"start":{"line": )" + std::to_string(start.get_line()) + ",\"character\":" + std::to_string(start.get_line_offset()) + R"(},"end":{"line":)" + std::to_string(end.get_line()) + ",\"character\":" + std::to_string(end.get_line_offset()) + R"(}},"text":""})";
else {
std::string text = get_buffer()->get_text();
......@@ -450,7 +450,7 @@ void Source::LanguageProtocolView::close() {
if(initialize_thread.joinable())
initialize_thread.join();
autocomplete.state = Autocomplete::State::IDLE;
autocomplete.state = Autocomplete::State::idle;
if(autocomplete.thread.joinable())
autocomplete.thread.join();
......@@ -1346,7 +1346,7 @@ void Source::LanguageProtocolView::setup_autocomplete() {
};
autocomplete.add_rows = [this](std::string &buffer, int line_number, int column) {
if(autocomplete.state == Autocomplete::State::STARTING) {
if(autocomplete.state == Autocomplete::State::starting) {
autocomplete_comment.clear();
autocomplete_insert.clear();
std::promise<void> result_processed;
......
......@@ -80,10 +80,10 @@ namespace LanguageProtocol {
class Capabilities {
public:
enum class TextDocumentSync { NONE = 0,
FULL,
INCREMENTAL };
TextDocumentSync text_document_sync = TextDocumentSync::NONE;
enum class TextDocumentSync { none = 0,
full,
incremental };
TextDocumentSync text_document_sync = TextDocumentSync::none;
bool hover = false;
bool completion = false;
bool signature_help = false;
......
......@@ -1108,14 +1108,14 @@ void Window::set_menu_actions() {
size_t c = 0;
buffer->begin_user_action();
for(auto &fix_it : fix_its) {
if(fix_it.type == Source::FixIt::Type::INSERT) {
if(fix_it.type == Source::FixIt::Type::insert) {
buffer->insert(fix_it_marks[c].first->get_iter(), fix_it.source);
}
if(fix_it.type == Source::FixIt::Type::REPLACE) {
if(fix_it.type == Source::FixIt::Type::replace) {
buffer->erase(fix_it_marks[c].first->get_iter(), fix_it_marks[c].second->get_iter());
buffer->insert(fix_it_marks[c].first->get_iter(), fix_it.source);
}
if(fix_it.type == Source::FixIt::Type::ERASE) {
if(fix_it.type == Source::FixIt::Type::erase) {
buffer->erase(fix_it_marks[c].first->get_iter(), fix_it_marks[c].second->get_iter());
}
c++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment