Skip to content

Commit 79ce3d0

Browse files
committed
verilog: tools: ls: hover: Changed IsStringViewContained to IsSubRange
Signed-off-by: Grzegorz Latosinski <[email protected]>
1 parent 09ab5f1 commit 79ce3d0

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

verilog/tools/ls/BUILD

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,13 @@ cc_library(
111111
deps = [
112112
":lsp-parse-buffer",
113113
":symbol-table-handler",
114-
"//common/util:casts",
115-
"//verilog/CST:seq_block",
116114
"//common/lsp:lsp-protocol",
117-
"//verilog/CST:verilog_nonterminals",
118-
"//common/text:tree_context_visitor",
119-
"//verilog/parser:verilog_token_enum",
115+
"//common/text:tree-context-visitor",
116+
"//common/util:casts",
117+
"//common/util:range",
118+
"//verilog/CST:seq-block",
119+
"//verilog/CST:verilog-nonterminals",
120+
"//verilog/parser:verilog-token-enum",
120121
],
121122
)
122123

verilog/tools/ls/hover.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "common/text/tree_context_visitor.h"
1919
#include "common/util/casts.h"
20+
#include "common/util/range.h"
2021
#include "verilog/CST/seq_block.h"
2122
#include "verilog/CST/verilog_nonterminals.h"
2223
#include "verilog/analysis/symbol_table.h"
@@ -52,7 +53,7 @@ class FindBeginLabel : public TreeContextVisitor {
5253

5354
private:
5455
void Visit(const SyntaxTreeLeaf &leaf) override {
55-
if (IsStringViewContained(leaf.get().text(), substring_)) {
56+
if (verible::IsSubRange(leaf.get().text(), substring_)) {
5657
substring_found_ = true;
5758
}
5859
}

verilog/tools/ls/symbol-table-handler.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ namespace verilog {
3333
// Looks for FileList file for SymbolTableHandler
3434
std::string FindFileList(absl::string_view current_dir);
3535

36-
// Checks if one string_view is contained in another
37-
bool IsStringViewContained(absl::string_view origin, absl::string_view substr);
38-
3936
// A class interfacing the SymbolTable with the LSP messages.
4037
// It manages the SymbolTable and its necessary components,
4138
// and provides such information as symbol definitions

0 commit comments

Comments
 (0)