14 #ifndef MLIR_TOOLS_LSPSERVERSUPPORT_SOURCEMGRUTILS_H
15 #define MLIR_TOOLS_LSPSERVERSUPPORT_SOURCEMGRUTILS_H
18 #include "llvm/Support/SourceMgr.h"
40 bool contains(SMRange range, SMLoc loc);
URI in "file" scheme for a file.
void gatherIncludeFiles(llvm::SourceMgr &sourceMgr, SmallVectorImpl< SourceMgrInclude > &includes)
Given a source manager, gather all of the processed include files.
bool contains(SMRange range, SMLoc loc)
Returns true if the given range contains the given source location.
std::optional< std::string > extractSourceDocComment(llvm::SourceMgr &sourceMgr, SMLoc loc)
Extract a documentation comment for the given location within the source manager.
SMRange convertTokenLocToRange(SMLoc loc, StringRef identifierChars="")
Returns the range of a lexical token given a SMLoc corresponding to the start of an token location.
Include the generated interface declarations.
This class represents a single include within a root file.
Hover buildHover() const
Build a hover for the current include file.
lsp::Range range
The range of the include directive.
SourceMgrInclude(const lsp::URIForFile &uri, const lsp::Range &range)
lsp::URIForFile uri
The URI of the file that is included.