MLIR  19.0.0git
Public Member Functions | Protected Member Functions | List of all members
mlir::AsmParserCodeCompleteContext Class Referenceabstract

This class provides an abstract interface into the parser for hooking in code completion events. More...

#include "mlir/AsmParser/CodeComplete.h"

Public Member Functions

virtual ~AsmParserCodeCompleteContext ()
 
SMLoc getCodeCompleteLoc () const
 Return the source location used to provide code completion. More...
 
virtual void completeDialectName (StringRef prefix)=0
 Signal code completion for a dialect name, with an optional prefix. More...
 
void completeDialectName ()
 
virtual void completeOperationName (StringRef dialectName)=0
 Signal code completion for an operation name within the given dialect. More...
 
virtual void appendSSAValueCompletion (StringRef name, std::string typeData)=0
 Append the given SSA value as a code completion result for SSA value completions. More...
 
virtual void appendBlockCompletion (StringRef name)=0
 Append the given block as a code completion result for block name completions. More...
 
virtual void completeExpectedTokens (ArrayRef< StringRef > tokens, bool optional)=0
 Signal a completion for the given expected tokens, which are optional if optional is set. More...
 
virtual void completeAttribute (const llvm::StringMap< Attribute > &aliases)=0
 Signal a completion for an attribute. More...
 
virtual void completeDialectAttributeOrAlias (const llvm::StringMap< Attribute > &aliases)=0
 
virtual void completeType (const llvm::StringMap< Type > &aliases)=0
 Signal a completion for a type. More...
 
virtual void completeDialectTypeOrAlias (const llvm::StringMap< Type > &aliases)=0
 

Protected Member Functions

 AsmParserCodeCompleteContext (SMLoc codeCompleteLoc)
 Create a new code completion context with the given code complete location. More...
 

Detailed Description

This class provides an abstract interface into the parser for hooking in code completion events.

This class is only really useful for providing language tooling for MLIR, general clients should not need to use this class.

Definition at line 24 of file CodeComplete.h.

Constructor & Destructor Documentation

◆ ~AsmParserCodeCompleteContext()

AsmParserCodeCompleteContext::~AsmParserCodeCompleteContext ( )
virtualdefault

◆ AsmParserCodeCompleteContext()

mlir::AsmParserCodeCompleteContext::AsmParserCodeCompleteContext ( SMLoc  codeCompleteLoc)
inlineexplicitprotected

Create a new code completion context with the given code complete location.

Definition at line 69 of file CodeComplete.h.

Member Function Documentation

◆ appendBlockCompletion()

virtual void mlir::AsmParserCodeCompleteContext::appendBlockCompletion ( StringRef  name)
pure virtual

Append the given block as a code completion result for block name completions.

◆ appendSSAValueCompletion()

virtual void mlir::AsmParserCodeCompleteContext::appendSSAValueCompletion ( StringRef  name,
std::string  typeData 
)
pure virtual

Append the given SSA value as a code completion result for SSA value completions.

◆ completeAttribute()

virtual void mlir::AsmParserCodeCompleteContext::completeAttribute ( const llvm::StringMap< Attribute > &  aliases)
pure virtual

Signal a completion for an attribute.

Referenced by mlir::detail::Parser::codeCompleteAttribute().

◆ completeDialectAttributeOrAlias()

virtual void mlir::AsmParserCodeCompleteContext::completeDialectAttributeOrAlias ( const llvm::StringMap< Attribute > &  aliases)
pure virtual

◆ completeDialectName() [1/2]

void mlir::AsmParserCodeCompleteContext::completeDialectName ( )
inline

Definition at line 37 of file CodeComplete.h.

References completeDialectName().

Referenced by completeDialectName().

◆ completeDialectName() [2/2]

virtual void mlir::AsmParserCodeCompleteContext::completeDialectName ( StringRef  prefix)
pure virtual

Signal code completion for a dialect name, with an optional prefix.

Referenced by mlir::detail::Parser::codeCompleteDialectName().

◆ completeDialectTypeOrAlias()

virtual void mlir::AsmParserCodeCompleteContext::completeDialectTypeOrAlias ( const llvm::StringMap< Type > &  aliases)
pure virtual

◆ completeExpectedTokens()

virtual void mlir::AsmParserCodeCompleteContext::completeExpectedTokens ( ArrayRef< StringRef >  tokens,
bool  optional 
)
pure virtual

Signal a completion for the given expected tokens, which are optional if optional is set.

Referenced by mlir::detail::Parser::codeCompleteExpectedTokens(), and mlir::detail::Parser::codeCompleteOptionalTokens().

◆ completeOperationName()

virtual void mlir::AsmParserCodeCompleteContext::completeOperationName ( StringRef  dialectName)
pure virtual

Signal code completion for an operation name within the given dialect.

Referenced by mlir::detail::Parser::codeCompleteOperationName().

◆ completeType()

virtual void mlir::AsmParserCodeCompleteContext::completeType ( const llvm::StringMap< Type > &  aliases)
pure virtual

Signal a completion for a type.

Referenced by mlir::detail::Parser::codeCompleteType().

◆ getCodeCompleteLoc()

SMLoc mlir::AsmParserCodeCompleteContext::getCodeCompleteLoc ( ) const
inline

Return the source location used to provide code completion.

Definition at line 29 of file CodeComplete.h.

Referenced by mlir::Lexer::Lexer().


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