Skip to content

Commit

Permalink
verilog: tools: ls: hover: Changed IsStringViewContained to IsSubRange
Browse files Browse the repository at this point in the history
Signed-off-by: Grzegorz Latosinski <[email protected]>
  • Loading branch information
glatosinski committed May 18, 2023
1 parent 09ab5f1 commit 79ce3d0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
11 changes: 6 additions & 5 deletions verilog/tools/ls/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,13 @@ cc_library(
deps = [
":lsp-parse-buffer",
":symbol-table-handler",
"//common/util:casts",
"//verilog/CST:seq_block",
"//common/lsp:lsp-protocol",
"//verilog/CST:verilog_nonterminals",
"//common/text:tree_context_visitor",
"//verilog/parser:verilog_token_enum",
"//common/text:tree-context-visitor",
"//common/util:casts",
"//common/util:range",
"//verilog/CST:seq-block",
"//verilog/CST:verilog-nonterminals",
"//verilog/parser:verilog-token-enum",
],
)

Expand Down
3 changes: 2 additions & 1 deletion verilog/tools/ls/hover.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "common/text/tree_context_visitor.h"
#include "common/util/casts.h"
#include "common/util/range.h"
#include "verilog/CST/seq_block.h"
#include "verilog/CST/verilog_nonterminals.h"
#include "verilog/analysis/symbol_table.h"
Expand Down Expand Up @@ -52,7 +53,7 @@ class FindBeginLabel : public TreeContextVisitor {

private:
void Visit(const SyntaxTreeLeaf &leaf) override {
if (IsStringViewContained(leaf.get().text(), substring_)) {
if (verible::IsSubRange(leaf.get().text(), substring_)) {
substring_found_ = true;
}
}
Expand Down
3 changes: 0 additions & 3 deletions verilog/tools/ls/symbol-table-handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ namespace verilog {
// Looks for FileList file for SymbolTableHandler
std::string FindFileList(absl::string_view current_dir);

// Checks if one string_view is contained in another
bool IsStringViewContained(absl::string_view origin, absl::string_view substr);

// A class interfacing the SymbolTable with the LSP messages.
// It manages the SymbolTable and its necessary components,
// and provides such information as symbol definitions
Expand Down

0 comments on commit 79ce3d0

Please sign in to comment.