From ee2880b985177f763f2718c28eb3177dc17ce807 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Mon, 19 Feb 2024 21:17:20 -0500 Subject: [PATCH] lsp: revert unnamed variable labelling (#3381) This didn't really pan out as I hoped since files can have thousands of these and there is a limit to how many diagnostics are shown (starting from the top of the file). This also may have caused the recent instability in the LSP, disabling this i wasn't able to reproduce an LSP crash cycling through 50-100 files. --- lsp/state/workspace.cpp | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/lsp/state/workspace.cpp b/lsp/state/workspace.cpp index e8ac977f57c..6f9599365d6 100644 --- a/lsp/state/workspace.cpp +++ b/lsp/state/workspace.cpp @@ -408,8 +408,6 @@ void WorkspaceIRFile::find_function_symbol(const uint32_t line_num_zero_based, void WorkspaceIRFile::identify_diagnostics(const uint32_t line_num_zero_based, const std::string& line, const bool in_opengoal_block) { - std::regex unnamed_variables_regex( - "(?:(?:arg\\d+)|(?:f\\d+|at|v[0-1]|a[0-3]|t[0-9]|s[0-7]|k[0-1]|gp|sp|sv|fp|ra)\\-\\d+)"); std::regex info_regex(";; INFO: (.*)"); std::regex warn_regex(";; WARN: (.*)"); std::regex error_regex(";; ERROR: (.*)"); @@ -417,24 +415,6 @@ void WorkspaceIRFile::identify_diagnostics(const uint32_t line_num_zero_based, std::smatch warn_matches; std::smatch error_matches; - if (in_opengoal_block) { - for (auto regex_iterator = - std::sregex_iterator(line.begin(), line.end(), unnamed_variables_regex); - regex_iterator != std::sregex_iterator(); ++regex_iterator) { - std::smatch match = *regex_iterator; - LSPSpec::Diagnostic new_diag; - new_diag.m_severity = LSPSpec::DiagnosticSeverity::Warning; - new_diag.m_message = fmt::format("{} - Unnamed variable", match.str()); - LSPSpec::Range diag_range; - diag_range.m_start = {line_num_zero_based, (u32)match.position(0)}; - diag_range.m_end = {line_num_zero_based, - diag_range.m_start.m_character + (u32)match.length()}; - new_diag.m_range = diag_range; - new_diag.m_source = "OpenGOAL LSP"; - m_diagnostics.push_back(new_diag); - } - } - LSPSpec::Range diag_range; diag_range.m_start = {line_num_zero_based, 0}; diag_range.m_end = {line_num_zero_based, (uint32_t)line.length() - 1};