Skip to content

Commit

Permalink
verilog: tools: ls: Changed return value for LSPUriToPath to std::string
Browse files Browse the repository at this point in the history
Signed-off-by: Grzegorz Latosinski <glatosinski@antmicro.com>
  • Loading branch information
glatosinski committed Jun 6, 2023
1 parent 7dd12cd commit a51bfee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion verilog/tools/ls/lsp-parse-buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static absl::StatusOr<std::vector<verible::LintRuleStatus>> RunLinter(
const auto &text_structure = parser.Data();

verilog::LinterConfiguration config;
const absl::string_view file_path = verible::lsp::LSPUriToPath(filename);
const std::string file_path = verible::lsp::LSPUriToPath(filename);
if (auto from_flags = LinterConfigurationFromFlags(file_path);
from_flags.ok()) {
config = *from_flags;
Expand Down
2 changes: 1 addition & 1 deletion verilog/tools/ls/symbol-table-handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ std::vector<verible::lsp::Location> SymbolTableHandler::FindDefinitionLocation(
const verilog::BufferTrackerContainer &parsed_buffers) {
// TODO add iterating over multiple definitions
Prepare();
const absl::string_view filepath = LSPUriToPath(params.textDocument.uri);
const std::string filepath = LSPUriToPath(params.textDocument.uri);
std::string relativepath = curr_project_->GetRelativePathToSource(filepath);
absl::string_view symbol =
GetTokenAtTextDocumentPosition(params, parsed_buffers);
Expand Down
4 changes: 2 additions & 2 deletions verilog/tools/ls/verilog-language-server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ verible::lsp::InitializeResult VerilogLanguageServer::InitializeRequestHandler(
const verible::lsp::InitializeParams &p) {
// set VerilogProject for the symbol table, if possible
if (!p.rootUri.empty()) {
absl::string_view path = verible::lsp::LSPUriToPath(p.rootUri);
std::string path = verible::lsp::LSPUriToPath(p.rootUri);
if (path.empty()) {
LOG(ERROR) << "Unsupported rootUri in initialize request: " << p.rootUri
<< std::endl;
Expand Down Expand Up @@ -232,7 +232,7 @@ void VerilogLanguageServer::SendDiagnostics(

void VerilogLanguageServer::UpdateEditedFileInProject(
const std::string &uri, const verilog::BufferTracker *buffer_tracker) {
const absl::string_view path = verible::lsp::LSPUriToPath(uri);
const std::string path = verible::lsp::LSPUriToPath(uri);
if (path.empty()) {
LOG(ERROR) << "Could not convert LS URI to path: " << uri;
return;
Expand Down

0 comments on commit a51bfee

Please sign in to comment.