clang-tools  14.0.0git
Static Public Member Functions | Public Attributes | List of all members
clang::clangd::Tweak::Effect Struct Reference

#include <Tweak.h>

Collaboration diagram for clang::clangd::Tweak::Effect:
Collaboration graph
[legend]

Static Public Member Functions

static Effect showMessage (StringRef S)
 
static llvm::Expected< std::pair< Path, Edit > > fileEdit (const SourceManager &SM, FileID FID, tooling::Replacements Replacements)
 Path is the absolute, symlink-resolved path for the file pointed by FID in SM. More...
 
static llvm::Expected< Tweak::EffectmainFileEdit (const SourceManager &SM, tooling::Replacements Replacements)
 Creates an effect with an Edit for the main file. More...
 

Public Attributes

llvm::Optional< std::string > ShowMessage
 A message to be displayed to the user. More...
 
FileEdits ApplyEdits
 
bool FormatEdits = true
 Whether the edits should be formatted before presenting to the client. More...
 

Detailed Description

Definition at line 77 of file Tweak.h.

Member Function Documentation

◆ fileEdit()

llvm::Expected< std::pair< Path, Edit > > clang::clangd::Tweak::Effect::fileEdit ( const SourceManager &  SM,
FileID  FID,
tooling::Replacements  Replacements 
)
static

Path is the absolute, symlink-resolved path for the file pointed by FID in SM.

Edit is generated from Replacements. Fails if cannot figure out absolute path for FID.

Definition at line 106 of file Tweak.cpp.

◆ mainFileEdit()

llvm::Expected< Tweak::Effect > clang::clangd::Tweak::Effect::mainFileEdit ( const SourceManager &  SM,
tooling::Replacements  Replacements 
)
static

Creates an effect with an Edit for the main file.

Fails if cannot figure out absolute path for main file.

Definition at line 116 of file Tweak.cpp.

◆ showMessage()

static Effect clang::clangd::Tweak::Effect::showMessage ( StringRef  S)
inlinestatic

Definition at line 85 of file Tweak.h.

References E.

Member Data Documentation

◆ ApplyEdits

FileEdits clang::clangd::Tweak::Effect::ApplyEdits

Definition at line 80 of file Tweak.h.

◆ FormatEdits

bool clang::clangd::Tweak::Effect::FormatEdits = true

Whether the edits should be formatted before presenting to the client.

Note that it applies to all files.

Definition at line 83 of file Tweak.h.

◆ ShowMessage

llvm::Optional<std::string> clang::clangd::Tweak::Effect::ShowMessage

A message to be displayed to the user.

Definition at line 79 of file Tweak.h.


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