MLIR  16.0.0git
Classes | Public Member Functions | List of all members
mlir::lsp::MLIRServer Class Reference

This class implements all of the MLIR related functionality necessary for a language server. More...

#include "Tools/mlir-lsp-server/MLIRServer.h"

Classes

struct  Impl
 

Public Member Functions

 MLIRServer (DialectRegistry &registry)
 Construct a new server with the given dialect regitstry. More...
 
 ~MLIRServer ()
 
void addOrUpdateDocument (const URIForFile &uri, StringRef contents, int64_t version, std::vector< Diagnostic > &diagnostics)
 Add or update the document, with the provided version, at the given URI. More...
 
Optional< int64_t > removeDocument (const URIForFile &uri)
 Remove the document with the given uri. More...
 
void getLocationsOf (const URIForFile &uri, const Position &defPos, std::vector< Location > &locations)
 Return the locations of the object pointed at by the given position. More...
 
void findReferencesOf (const URIForFile &uri, const Position &pos, std::vector< Location > &references)
 Find all references of the object pointed at by the given position. More...
 
Optional< HoverfindHover (const URIForFile &uri, const Position &hoverPos)
 Find a hover description for the given hover position, or None if one couldn't be found. More...
 
void findDocumentSymbols (const URIForFile &uri, std::vector< DocumentSymbol > &symbols)
 Find all of the document symbols within the given file. More...
 
CompletionList getCodeCompletion (const URIForFile &uri, const Position &completePos)
 Get the code completion list for the position within the given file. More...
 
void getCodeActions (const URIForFile &uri, const Range &pos, const CodeActionContext &context, std::vector< CodeAction > &actions)
 Get the set of code actions within the file. More...
 

Detailed Description

This class implements all of the MLIR related functionality necessary for a language server.

This class allows for keeping the MLIR specific logic separate from the logic that involves LSP server/client communication.

Definition at line 33 of file MLIRServer.h.

Constructor & Destructor Documentation

◆ MLIRServer()

lsp::MLIRServer::MLIRServer ( DialectRegistry registry)

Construct a new server with the given dialect regitstry.

Definition at line 1152 of file MLIRServer.cpp.

References ~MLIRServer().

◆ ~MLIRServer()

lsp::MLIRServer::~MLIRServer ( )
default

Referenced by MLIRServer().

Member Function Documentation

◆ addOrUpdateDocument()

void lsp::MLIRServer::addOrUpdateDocument ( const URIForFile uri,
StringRef  contents,
int64_t  version,
std::vector< Diagnostic > &  diagnostics 
)

Add or update the document, with the provided version, at the given URI.

Any diagnostics emitted for this document should be added to diagnostics.

Definition at line 1156 of file MLIRServer.cpp.

References mlir::lsp::URIForFile::file().

◆ findDocumentSymbols()

void lsp::MLIRServer::findDocumentSymbols ( const URIForFile uri,
std::vector< DocumentSymbol > &  symbols 
)

Find all of the document symbols within the given file.

Definition at line 1197 of file MLIRServer.cpp.

References mlir::lsp::URIForFile::file().

◆ findHover()

Optional< lsp::Hover > lsp::MLIRServer::findHover ( const URIForFile uri,
const Position hoverPos 
)

Find a hover description for the given hover position, or None if one couldn't be found.

Definition at line 1189 of file MLIRServer.cpp.

References mlir::lsp::URIForFile::file(), and mlir::lsp::None.

◆ findReferencesOf()

void lsp::MLIRServer::findReferencesOf ( const URIForFile uri,
const Position pos,
std::vector< Location > &  references 
)

Find all references of the object pointed at by the given position.

Definition at line 1181 of file MLIRServer.cpp.

References mlir::lsp::URIForFile::file().

◆ getCodeActions()

void lsp::MLIRServer::getCodeActions ( const URIForFile uri,
const Range pos,
const CodeActionContext context,
std::vector< CodeAction > &  actions 
)

Get the set of code actions within the file.

Definition at line 1213 of file MLIRServer.cpp.

References mlir::lsp::URIForFile::file().

◆ getCodeCompletion()

lsp::CompletionList lsp::MLIRServer::getCodeCompletion ( const URIForFile uri,
const Position completePos 
)

Get the code completion list for the position within the given file.

Definition at line 1205 of file MLIRServer.cpp.

References mlir::lsp::URIForFile::file().

◆ getLocationsOf()

void lsp::MLIRServer::getLocationsOf ( const URIForFile uri,
const Position defPos,
std::vector< Location > &  locations 
)

Return the locations of the object pointed at by the given position.

Definition at line 1173 of file MLIRServer.cpp.

References mlir::lsp::URIForFile::file().

◆ removeDocument()

Optional< int64_t > lsp::MLIRServer::removeDocument ( const URIForFile uri)

Remove the document with the given uri.

Returns the version of the removed document, or None if the uri did not have a corresponding document within the server.

Definition at line 1163 of file MLIRServer.cpp.

References mlir::lsp::URIForFile::file(), and mlir::lsp::None.


The documentation for this class was generated from the following files: