diff --git a/mlir/lib/Tools/lsp-server-support/CompilationDatabase.h b/mlir/include/mlir/Tools/lsp-server-support/CompilationDatabase.h rename from mlir/lib/Tools/lsp-server-support/CompilationDatabase.h rename to mlir/include/mlir/Tools/lsp-server-support/CompilationDatabase.h --- a/mlir/lib/Tools/lsp-server-support/CompilationDatabase.h +++ b/mlir/include/mlir/Tools/lsp-server-support/CompilationDatabase.h @@ -13,8 +13,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LIB_MLIR_TOOLS_LSPSERVERSUPPORT_COMPILATIONDATABASE_H_ -#define LIB_MLIR_TOOLS_LSPSERVERSUPPORT_COMPILATIONDATABASE_H_ +#ifndef MLIR_TOOLS_LSPSERVERSUPPORT_COMPILATIONDATABASE_H +#define MLIR_TOOLS_LSPSERVERSUPPORT_COMPILATIONDATABASE_H #include "mlir/Support/LLVM.h" #include "llvm/ADT/StringMap.h" @@ -67,4 +67,4 @@ } // namespace lsp } // namespace mlir -#endif // LIB_MLIR_TOOLS_LSPSERVERSUPPORT_COMPILATIONDATABASE_H_ +#endif // MLIR_TOOLS_LSPSERVERSUPPORT_COMPILATIONDATABASE_H diff --git a/mlir/lib/Tools/lsp-server-support/Logging.h b/mlir/include/mlir/Tools/lsp-server-support/Logging.h rename from mlir/lib/Tools/lsp-server-support/Logging.h rename to mlir/include/mlir/Tools/lsp-server-support/Logging.h --- a/mlir/lib/Tools/lsp-server-support/Logging.h +++ b/mlir/include/mlir/Tools/lsp-server-support/Logging.h @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LIB_MLIR_TOOLS_LSPSERVERSUPPORT_LOGGING_H -#define LIB_MLIR_TOOLS_LSPSERVERSUPPORT_LOGGING_H +#ifndef MLIR_TOOLS_LSPSERVERSUPPORT_LOGGING_H +#define MLIR_TOOLS_LSPSERVERSUPPORT_LOGGING_H #include "mlir/Support/LLVM.h" #include "llvm/Support/Debug.h" @@ -62,4 +62,4 @@ } // namespace lsp } // namespace mlir -#endif // LIB_MLIR_TOOLS_LSPSERVERSUPPORT_LOGGING_H +#endif // MLIR_TOOLS_LSPSERVERSUPPORT_LOGGING_H diff --git a/mlir/lib/Tools/lsp-server-support/Protocol.h b/mlir/include/mlir/Tools/lsp-server-support/Protocol.h rename from mlir/lib/Tools/lsp-server-support/Protocol.h rename to mlir/include/mlir/Tools/lsp-server-support/Protocol.h --- a/mlir/lib/Tools/lsp-server-support/Protocol.h +++ b/mlir/include/mlir/Tools/lsp-server-support/Protocol.h @@ -20,8 +20,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LIB_MLIR_TOOLS_LSPSERVERSUPPORT_PROTOCOL_H_ -#define LIB_MLIR_TOOLS_LSPSERVERSUPPORT_PROTOCOL_H_ +#ifndef MLIR_TOOLS_LSPSERVERSUPPORT_PROTOCOL_H +#define MLIR_TOOLS_LSPSERVERSUPPORT_PROTOCOL_H #include "mlir/Support/LLVM.h" #include "llvm/Support/JSON.h" @@ -29,10 +29,10 @@ #include "llvm/Support/raw_ostream.h" #include #include +#include #include #include #include -#include namespace mlir { struct LogicalResult; diff --git a/mlir/lib/Tools/lsp-server-support/SourceMgrUtils.h b/mlir/include/mlir/Tools/lsp-server-support/SourceMgrUtils.h rename from mlir/lib/Tools/lsp-server-support/SourceMgrUtils.h rename to mlir/include/mlir/Tools/lsp-server-support/SourceMgrUtils.h --- a/mlir/lib/Tools/lsp-server-support/SourceMgrUtils.h +++ b/mlir/include/mlir/Tools/lsp-server-support/SourceMgrUtils.h @@ -11,10 +11,10 @@ // //===----------------------------------------------------------------------===// -#ifndef LIB_MLIR_TOOLS_LSPSERVERSUPPORT_TRANSPORT_H_ -#define LIB_MLIR_TOOLS_LSPSERVERSUPPORT_TRANSPORT_H_ +#ifndef MLIR_TOOLS_LSPSERVERSUPPORT_TRANSPORT_H +#define MLIR_TOOLS_LSPSERVERSUPPORT_TRANSPORT_H -#include "Protocol.h" +#include "mlir/Tools/lsp-server-support/Protocol.h" #include "llvm/Support/SourceMgr.h" #include @@ -27,7 +27,7 @@ /// Returns the range of a lexical token given a SMLoc corresponding to the /// start of an token location. The range is computed heuristically, and /// supports identifier-like tokens, strings, etc. -SMRange convertTokenLocToRange(SMLoc loc); +SMRange convertTokenLocToRange(SMLoc loc, StringRef identifierChars = ""); /// Extract a documentation comment for the given location within the source /// manager. Returns std::nullopt if no comment could be computed. diff --git a/mlir/lib/Tools/lsp-server-support/Transport.h b/mlir/include/mlir/Tools/lsp-server-support/Transport.h rename from mlir/lib/Tools/lsp-server-support/Transport.h rename to mlir/include/mlir/Tools/lsp-server-support/Transport.h --- a/mlir/lib/Tools/lsp-server-support/Transport.h +++ b/mlir/include/mlir/Tools/lsp-server-support/Transport.h @@ -12,13 +12,13 @@ // //===----------------------------------------------------------------------===// -#ifndef LIB_MLIR_TOOLS_LSPSERVERSUPPORT_TRANSPORT_H_ -#define LIB_MLIR_TOOLS_LSPSERVERSUPPORT_TRANSPORT_H_ +#ifndef MLIR_TOOLS_LSPSERVERSUPPORT_TRANSPORT_H +#define MLIR_TOOLS_LSPSERVERSUPPORT_TRANSPORT_H -#include "Logging.h" -#include "Protocol.h" #include "mlir/Support/LLVM.h" #include "mlir/Support/LogicalResult.h" +#include "mlir/Tools/lsp-server-support/Logging.h" +#include "mlir/Tools/lsp-server-support/Protocol.h" #include "llvm/ADT/FunctionExtras.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" diff --git a/mlir/lib/Tools/lsp-server-support/CMakeLists.txt b/mlir/lib/Tools/lsp-server-support/CMakeLists.txt --- a/mlir/lib/Tools/lsp-server-support/CMakeLists.txt +++ b/mlir/lib/Tools/lsp-server-support/CMakeLists.txt @@ -6,7 +6,7 @@ Transport.cpp ADDITIONAL_HEADER_DIRS - ${MLIR_MAIN_INCLUDE_DIR}/mlir/Tools/lsp-server + ${MLIR_MAIN_INCLUDE_DIR}/mlir/Tools/lsp-server-support LINK_LIBS PUBLIC MLIRSupport diff --git a/mlir/lib/Tools/lsp-server-support/CompilationDatabase.cpp b/mlir/lib/Tools/lsp-server-support/CompilationDatabase.cpp --- a/mlir/lib/Tools/lsp-server-support/CompilationDatabase.cpp +++ b/mlir/lib/Tools/lsp-server-support/CompilationDatabase.cpp @@ -6,10 +6,10 @@ // //===----------------------------------------------------------------------===// -#include "CompilationDatabase.h" -#include "../lsp-server-support/Logging.h" -#include "Protocol.h" +#include "mlir/Tools/lsp-server-support/CompilationDatabase.h" #include "mlir/Support/FileUtilities.h" +#include "mlir/Tools/lsp-server-support/Logging.h" +#include "mlir/Tools/lsp-server-support/Protocol.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/YAMLTraits.h" diff --git a/mlir/lib/Tools/lsp-server-support/Logging.cpp b/mlir/lib/Tools/lsp-server-support/Logging.cpp --- a/mlir/lib/Tools/lsp-server-support/Logging.cpp +++ b/mlir/lib/Tools/lsp-server-support/Logging.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "Logging.h" +#include "mlir/Tools/lsp-server-support/Logging.h" #include "llvm/Support/Chrono.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/raw_ostream.h" diff --git a/mlir/lib/Tools/lsp-server-support/Protocol.cpp b/mlir/lib/Tools/lsp-server-support/Protocol.cpp --- a/mlir/lib/Tools/lsp-server-support/Protocol.cpp +++ b/mlir/lib/Tools/lsp-server-support/Protocol.cpp @@ -10,9 +10,9 @@ // //===----------------------------------------------------------------------===// -#include "Protocol.h" -#include "Logging.h" +#include "mlir/Tools/lsp-server-support/Protocol.h" #include "mlir/Support/LogicalResult.h" +#include "mlir/Tools/lsp-server-support/Logging.h" #include "llvm/ADT/Hashing.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringSet.h" diff --git a/mlir/lib/Tools/lsp-server-support/SourceMgrUtils.cpp b/mlir/lib/Tools/lsp-server-support/SourceMgrUtils.cpp --- a/mlir/lib/Tools/lsp-server-support/SourceMgrUtils.cpp +++ b/mlir/lib/Tools/lsp-server-support/SourceMgrUtils.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "SourceMgrUtils.h" +#include "mlir/Tools/lsp-server-support/SourceMgrUtils.h" #include "llvm/Support/Path.h" #include @@ -43,7 +43,7 @@ return curPtr - 1; } -SMRange lsp::convertTokenLocToRange(SMLoc loc) { +SMRange lsp::convertTokenLocToRange(SMLoc loc, StringRef identifierChars) { if (!loc.isValid()) return SMRange(); const char *curPtr = loc.getPointer(); @@ -55,8 +55,8 @@ // Otherwise, default to handling an identifier. } else { // Return if the given character is a valid identifier character. - auto isIdentifierChar = [](char c) { - return isalnum(c) || c == '$' || c == '.' || c == '_' || c == '-'; + auto isIdentifierChar = [=](char c) { + return isalnum(c) || c == '_' || identifierChars.contains(c); }; while (*curPtr && isIdentifierChar(*(++curPtr))) diff --git a/mlir/lib/Tools/lsp-server-support/Transport.cpp b/mlir/lib/Tools/lsp-server-support/Transport.cpp --- a/mlir/lib/Tools/lsp-server-support/Transport.cpp +++ b/mlir/lib/Tools/lsp-server-support/Transport.cpp @@ -6,15 +6,15 @@ // //===----------------------------------------------------------------------===// -#include "Transport.h" -#include "Logging.h" -#include "Protocol.h" +#include "mlir/Tools/lsp-server-support/Transport.h" +#include "mlir/Tools/lsp-server-support/Logging.h" +#include "mlir/Tools/lsp-server-support/Protocol.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/Errno.h" #include "llvm/Support/Error.h" +#include #include #include -#include using namespace mlir; using namespace mlir::lsp; diff --git a/mlir/lib/Tools/mlir-lsp-server/LSPServer.cpp b/mlir/lib/Tools/mlir-lsp-server/LSPServer.cpp --- a/mlir/lib/Tools/mlir-lsp-server/LSPServer.cpp +++ b/mlir/lib/Tools/mlir-lsp-server/LSPServer.cpp @@ -7,10 +7,10 @@ //===----------------------------------------------------------------------===// #include "LSPServer.h" -#include "../lsp-server-support/Logging.h" -#include "../lsp-server-support/Transport.h" #include "MLIRServer.h" #include "Protocol.h" +#include "mlir/Tools/lsp-server-support/Logging.h" +#include "mlir/Tools/lsp-server-support/Transport.h" #include "llvm/ADT/FunctionExtras.h" #include "llvm/ADT/StringMap.h" #include diff --git a/mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp b/mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp --- a/mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp +++ b/mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp @@ -7,8 +7,6 @@ //===----------------------------------------------------------------------===// #include "MLIRServer.h" -#include "../lsp-server-support/Logging.h" -#include "../lsp-server-support/SourceMgrUtils.h" #include "Protocol.h" #include "mlir/AsmParser/AsmParser.h" #include "mlir/AsmParser/AsmParserState.h" @@ -17,12 +15,21 @@ #include "mlir/IR/FunctionInterfaces.h" #include "mlir/IR/Operation.h" #include "mlir/Parser/Parser.h" +#include "mlir/Tools/lsp-server-support/Logging.h" +#include "mlir/Tools/lsp-server-support/SourceMgrUtils.h" #include "llvm/Support/Base64.h" #include "llvm/Support/SourceMgr.h" #include using namespace mlir; +/// Returns the range of a lexical token given a SMLoc corresponding to the +/// start of an token location. The range is computed heuristically, and +/// supports identifier-like tokens, strings, etc. +static SMRange convertTokenLocToRange(SMLoc loc) { + return lsp::convertTokenLocToRange(loc, "$-."); +} + /// Returns a language server location from the given MLIR file location. /// `uriScheme` is the scheme to use when building new uris. static std::optional getLocationFromLoc(StringRef uriScheme, @@ -65,7 +72,7 @@ // Use range of potential identifier starting at location, else length 1 // range. location->range.end.character += 1; - if (std::optional range = lsp::convertTokenLocToRange(loc)) { + if (std::optional range = convertTokenLocToRange(loc)) { auto lineCol = sourceMgr.getLineAndColumn(range->End); location->range.end.character = std::max(fileLoc.getColumn() + 1, lineCol.second - 1); diff --git a/mlir/lib/Tools/mlir-lsp-server/MlirLspServerMain.cpp b/mlir/lib/Tools/mlir-lsp-server/MlirLspServerMain.cpp --- a/mlir/lib/Tools/mlir-lsp-server/MlirLspServerMain.cpp +++ b/mlir/lib/Tools/mlir-lsp-server/MlirLspServerMain.cpp @@ -7,11 +7,11 @@ //===----------------------------------------------------------------------===// #include "mlir/Tools/mlir-lsp-server/MlirLspServerMain.h" -#include "../lsp-server-support/Logging.h" -#include "../lsp-server-support/Transport.h" #include "LSPServer.h" #include "MLIRServer.h" #include "mlir/IR/Dialect.h" +#include "mlir/Tools/lsp-server-support/Logging.h" +#include "mlir/Tools/lsp-server-support/Transport.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Program.h" diff --git a/mlir/lib/Tools/mlir-lsp-server/Protocol.h b/mlir/lib/Tools/mlir-lsp-server/Protocol.h --- a/mlir/lib/Tools/mlir-lsp-server/Protocol.h +++ b/mlir/lib/Tools/mlir-lsp-server/Protocol.h @@ -20,7 +20,7 @@ #ifndef LIB_MLIR_TOOLS_MLIRLSPSERVER_PROTOCOL_H_ #define LIB_MLIR_TOOLS_MLIRLSPSERVER_PROTOCOL_H_ -#include "../lsp-server-support/Protocol.h" +#include "mlir/Tools/lsp-server-support/Protocol.h" namespace mlir { namespace lsp { diff --git a/mlir/lib/Tools/mlir-pdll-lsp-server/LSPServer.cpp b/mlir/lib/Tools/mlir-pdll-lsp-server/LSPServer.cpp --- a/mlir/lib/Tools/mlir-pdll-lsp-server/LSPServer.cpp +++ b/mlir/lib/Tools/mlir-pdll-lsp-server/LSPServer.cpp @@ -8,10 +8,10 @@ #include "LSPServer.h" -#include "../lsp-server-support/Logging.h" -#include "../lsp-server-support/Transport.h" #include "PDLLServer.h" #include "Protocol.h" +#include "mlir/Tools/lsp-server-support/Logging.h" +#include "mlir/Tools/lsp-server-support/Transport.h" #include "llvm/ADT/FunctionExtras.h" #include "llvm/ADT/StringMap.h" #include diff --git a/mlir/lib/Tools/mlir-pdll-lsp-server/MlirPdllLspServerMain.cpp b/mlir/lib/Tools/mlir-pdll-lsp-server/MlirPdllLspServerMain.cpp --- a/mlir/lib/Tools/mlir-pdll-lsp-server/MlirPdllLspServerMain.cpp +++ b/mlir/lib/Tools/mlir-pdll-lsp-server/MlirPdllLspServerMain.cpp @@ -7,10 +7,10 @@ //===----------------------------------------------------------------------===// #include "mlir/Tools/mlir-pdll-lsp-server/MlirPdllLspServerMain.h" -#include "../lsp-server-support/Logging.h" -#include "../lsp-server-support/Transport.h" #include "LSPServer.h" #include "PDLLServer.h" +#include "mlir/Tools/lsp-server-support/Logging.h" +#include "mlir/Tools/lsp-server-support/Transport.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Program.h" diff --git a/mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp b/mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp --- a/mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp +++ b/mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp @@ -8,9 +8,6 @@ #include "PDLLServer.h" -#include "../lsp-server-support/CompilationDatabase.h" -#include "../lsp-server-support/Logging.h" -#include "../lsp-server-support/SourceMgrUtils.h" #include "Protocol.h" #include "mlir/IR/BuiltinOps.h" #include "mlir/Tools/PDLL/AST/Context.h" @@ -24,6 +21,9 @@ #include "mlir/Tools/PDLL/ODS/Operation.h" #include "mlir/Tools/PDLL/Parser/CodeComplete.h" #include "mlir/Tools/PDLL/Parser/Parser.h" +#include "mlir/Tools/lsp-server-support/CompilationDatabase.h" +#include "mlir/Tools/lsp-server-support/Logging.h" +#include "mlir/Tools/lsp-server-support/SourceMgrUtils.h" #include "llvm/ADT/IntervalMap.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringSet.h" diff --git a/mlir/lib/Tools/mlir-pdll-lsp-server/Protocol.h b/mlir/lib/Tools/mlir-pdll-lsp-server/Protocol.h --- a/mlir/lib/Tools/mlir-pdll-lsp-server/Protocol.h +++ b/mlir/lib/Tools/mlir-pdll-lsp-server/Protocol.h @@ -20,7 +20,7 @@ #ifndef LIB_MLIR_TOOLS_MLIRPDLLLSPSERVER_PROTOCOL_H_ #define LIB_MLIR_TOOLS_MLIRPDLLLSPSERVER_PROTOCOL_H_ -#include "../lsp-server-support/Protocol.h" +#include "mlir/Tools/lsp-server-support/Protocol.h" namespace mlir { namespace lsp { diff --git a/mlir/lib/Tools/tblgen-lsp-server/LSPServer.cpp b/mlir/lib/Tools/tblgen-lsp-server/LSPServer.cpp --- a/mlir/lib/Tools/tblgen-lsp-server/LSPServer.cpp +++ b/mlir/lib/Tools/tblgen-lsp-server/LSPServer.cpp @@ -8,10 +8,10 @@ #include "LSPServer.h" -#include "../lsp-server-support/Logging.h" -#include "../lsp-server-support/Protocol.h" -#include "../lsp-server-support/Transport.h" #include "TableGenServer.h" +#include "mlir/Tools/lsp-server-support/Logging.h" +#include "mlir/Tools/lsp-server-support/Protocol.h" +#include "mlir/Tools/lsp-server-support/Transport.h" #include "llvm/ADT/FunctionExtras.h" #include "llvm/ADT/StringMap.h" #include diff --git a/mlir/lib/Tools/tblgen-lsp-server/TableGenLspServerMain.cpp b/mlir/lib/Tools/tblgen-lsp-server/TableGenLspServerMain.cpp --- a/mlir/lib/Tools/tblgen-lsp-server/TableGenLspServerMain.cpp +++ b/mlir/lib/Tools/tblgen-lsp-server/TableGenLspServerMain.cpp @@ -7,10 +7,10 @@ //===----------------------------------------------------------------------===// #include "mlir/Tools/tblgen-lsp-server/TableGenLspServerMain.h" -#include "../lsp-server-support/Logging.h" -#include "../lsp-server-support/Transport.h" #include "LSPServer.h" #include "TableGenServer.h" +#include "mlir/Tools/lsp-server-support/Logging.h" +#include "mlir/Tools/lsp-server-support/Transport.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Program.h" diff --git a/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp b/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp --- a/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp +++ b/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp @@ -8,12 +8,12 @@ #include "TableGenServer.h" -#include "../lsp-server-support/CompilationDatabase.h" -#include "../lsp-server-support/Logging.h" -#include "../lsp-server-support/Protocol.h" -#include "../lsp-server-support/SourceMgrUtils.h" #include "mlir/Support/IndentedOstream.h" #include "mlir/Support/LogicalResult.h" +#include "mlir/Tools/lsp-server-support/CompilationDatabase.h" +#include "mlir/Tools/lsp-server-support/Logging.h" +#include "mlir/Tools/lsp-server-support/Protocol.h" +#include "mlir/Tools/lsp-server-support/SourceMgrUtils.h" #include "llvm/ADT/IntervalMap.h" #include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/StringMap.h" @@ -27,6 +27,13 @@ using namespace mlir; +/// Returns the range of a lexical token given a SMLoc corresponding to the +/// start of an token location. The range is computed heuristically, and +/// supports identifier-like tokens, strings, etc. +static SMRange convertTokenLocToRange(SMLoc loc) { + return lsp::convertTokenLocToRange(loc, "$"); +} + /// Returns a language server uri for the given source location. `mainFileURI` /// corresponds to the uri for the main file of the source manager. static lsp::URIForFile getURIFromLoc(const llvm::SourceMgr &mgr, SMLoc loc, @@ -51,7 +58,7 @@ } static lsp::Location getLocationFromLoc(llvm::SourceMgr &mgr, SMLoc loc, const lsp::URIForFile &uri) { - return getLocationFromLoc(mgr, lsp::convertTokenLocToRange(loc), uri); + return getLocationFromLoc(mgr, convertTokenLocToRange(loc), uri); } /// Convert the given TableGen diagnostic to the LSP form. @@ -139,10 +146,9 @@ struct TableGenIndexSymbol { TableGenIndexSymbol(const llvm::Record *record) : definition(record), - defLoc(lsp::convertTokenLocToRange(record->getLoc().front())) {} + defLoc(convertTokenLocToRange(record->getLoc().front())) {} TableGenIndexSymbol(const llvm::RecordVal *value) - : definition(value), - defLoc(lsp::convertTokenLocToRange(value->getLoc())) {} + : definition(value), defLoc(convertTokenLocToRange(value->getLoc())) {} virtual ~TableGenIndexSymbol() = default; // The main definition of the symbol. @@ -256,7 +262,7 @@ // If the location we got was empty, try to lex a token from the start // location. if (startLoc == endLoc) { - refLoc = lsp::convertTokenLocToRange(SMLoc::getFromPointer(startLoc)); + refLoc = convertTokenLocToRange(SMLoc::getFromPointer(startLoc)); startLoc = refLoc.Start.getPointer(); endLoc = refLoc.End.getPointer(); @@ -286,7 +292,7 @@ // Add references to the definition. for (SMLoc loc : def.getLoc().drop_front()) - insertRef(sym, lsp::convertTokenLocToRange(loc)); + insertRef(sym, convertTokenLocToRange(loc)); for (SMRange loc : def.getReferenceLocs()) insertRef(sym, loc);