• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/language/duchain

  • KDevelop
  • Problem
Public Types | Public Member Functions | List of all members
KDevelop::Problem Class Reference

#include <problem.h>

Inheritance diagram for KDevelop::Problem:
Inheritance graph
[legend]

Public Types

enum  { Identity = 15 }
 
using Ptr = QExplicitlySharedDataPointer< Problem >
 
- Public Types inherited from KDevelop::DUChainBase
enum  { Identity = 1 }
 

Public Member Functions

 Problem ()
 
 Problem (ProblemData &data)
 
 ~Problem () override
 
void addDiagnostic (const IProblem::Ptr &diagnostic) override
 
void clearDiagnostics () override
 
QString description () const override
 
QVector< IProblem::Ptr > diagnostics () const override
 
QString explanation () const override
 
DocumentRange finalLocation () const override
 
FinalLocationMode finalLocationMode () const override
 
void setDescription (const QString &description) override
 
void setDiagnostics (const QVector< IProblem::Ptr > &diagnostics) override
 
void setExplanation (const QString &explanation) override
 
void setFinalLocation (const DocumentRange &location) override
 
void setFinalLocationMode (FinalLocationMode mode) override
 
void setSeverity (Severity severity) override
 
void setSource (IProblem::Source source) override
 
Severity severity () const override
 
QString severityString () const override
 
QExplicitlySharedDataPointer< IAssistant > solutionAssistant () const override
 
Source source () const override
 
QString sourceString () const override
 
TopDUContext * topContext () const override
 
virtual QString toString () const
 
KDevelop::IndexedString url () const override
 
- Public Member Functions inherited from KDevelop::DUChainBase
 DUChainBase (const RangeInRevision &range)
 
 DUChainBase (DUChainBaseData &dd)
 
virtual ~DUChainBase ()
 
PersistentMovingRange::Ptr createRangeMoving () const
 
void makeDynamic ()
 
DUChainBase & operator= (const DUChainBase &rhs)=delete
 
RangeInRevision range () const
 
KTextEditor::Range rangeInCurrentRevision () const
 
virtual void setData (DUChainBaseData *, bool constructorCalled=true)
 
void setRange (const RangeInRevision &range)
 
KTextEditor::Cursor transformFromLocalRevision (const CursorInRevision &cursor) const
 
KTextEditor::Range transformFromLocalRevision (const RangeInRevision &range) const
 
CursorInRevision transformToLocalRevision (const KTextEditor::Cursor &cursor) const
 
RangeInRevision transformToLocalRevision (const KTextEditor::Range &range) const
 
const QExplicitlySharedDataPointer< DUChainPointerData > & weakPointer () const
 

Additional Inherited Members

- Protected Member Functions inherited from KDevelop::DUChainBase
 DUChainBase (DUChainBase &rhs)
 
 DUChainBase (DUChainBaseData &dd, const RangeInRevision &range)
 
- Protected Attributes inherited from KDevelop::DUChainBase
DUChainBaseData * d_ptr
 

Detailed Description

An object representing a problem in preprocessing, parsing, definition-use chain compilation, etc.

You should always use ProblemPointer, because Problem may be subclassed. The subclass would be lost while copying.

Warning
Access to problems must be serialized through DUChainLock.

Definition at line 129 of file problem.h.

Member Typedef Documentation

◆ Ptr

using KDevelop::Problem::Ptr = QExplicitlySharedDataPointer<Problem>

Definition at line 134 of file problem.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Identity 

Definition at line 217 of file problem.h.

Constructor & Destructor Documentation

◆ Problem() [1/2]

Problem::Problem ( )

Definition at line 69 of file problem.cpp.

◆ Problem() [2/2]

Problem::Problem ( ProblemData &  data)
explicit

Definition at line 75 of file problem.cpp.

◆ ~Problem()

Problem::~Problem ( )
override

Definition at line 80 of file problem.cpp.

Member Function Documentation

◆ addDiagnostic()

void Problem::addDiagnostic ( const IProblem::Ptr &  diagnostic)
override

Definition at line 142 of file problem.cpp.

◆ clearDiagnostics()

void Problem::clearDiagnostics ( )
override

Returns child diagnostics of this particular problem.

Example:

void foo(unsigned int);
void foo(const char*);
int main() { foo(0); }

=> foo(0) is ambiguous. This will give us a ProblemPointer pointing to 'foo(0)'.

Additionally, diagnostics may return the two locations to the ambiguous overloads, with descriptions such as 'test.cpp:1: candidate : ...'

Definition at line 115 of file problem.cpp.

◆ description()

QString Problem::description ( ) const
override

A brief description of the problem.

Definition at line 152 of file problem.cpp.

◆ diagnostics()

QVector< IProblem::Ptr > Problem::diagnostics ( ) const
override

Definition at line 122 of file problem.cpp.

◆ explanation()

QString Problem::explanation ( ) const
override

A (detailed) explanation of why the problem occurred.

Definition at line 162 of file problem.cpp.

◆ finalLocation()

DocumentRange Problem::finalLocation ( ) const
override

Location where this problem occurred.

Warning
Must only be called from the foreground

Definition at line 94 of file problem.cpp.

◆ finalLocationMode()

IProblem::FinalLocationMode Problem::finalLocationMode ( ) const
override

Definition at line 105 of file problem.cpp.

◆ setDescription()

void Problem::setDescription ( const QString &  description)
override

Definition at line 157 of file problem.cpp.

◆ setDiagnostics()

void Problem::setDiagnostics ( const QVector< IProblem::Ptr > &  diagnostics)
override

Definition at line 133 of file problem.cpp.

◆ setExplanation()

void Problem::setExplanation ( const QString &  explanation)
override

Definition at line 167 of file problem.cpp.

◆ setFinalLocation()

void Problem::setFinalLocation ( const DocumentRange &  location)
override

Definition at line 99 of file problem.cpp.

◆ setFinalLocationMode()

void Problem::setFinalLocationMode ( FinalLocationMode  mode)
override

Definition at line 110 of file problem.cpp.

◆ setSeverity()

void Problem::setSeverity ( Severity  severity)
override

Set the severity of this problem.

Definition at line 192 of file problem.cpp.

◆ setSource()

void Problem::setSource ( IProblem::Source  source)
override

Definition at line 177 of file problem.cpp.

◆ severity()

IProblem::Severity Problem::severity ( ) const
override

Get the severity of this problem.

This is used for example to decide for a highlighting color.

See also
setSeverity()

Definition at line 187 of file problem.cpp.

◆ severityString()

QString Problem::severityString ( ) const
override

Returns a string representation of the severity.

Definition at line 197 of file problem.cpp.

◆ solutionAssistant()

QExplicitlySharedDataPointer< IAssistant > Problem::solutionAssistant ( ) const
override

If this problem can be solved, this may return an assistant for the solution.

Definition at line 182 of file problem.cpp.

◆ source()

IProblem::Source Problem::source ( ) const
override

Definition at line 172 of file problem.cpp.

◆ sourceString()

QString Problem::sourceString ( ) const
override

Returns a string version of the problem source.

Definition at line 212 of file problem.cpp.

◆ topContext()

TopDUContext * Problem::topContext ( ) const
overridevirtual

Determine the top context to which this object belongs.

Todo:
Move the reference to the top-context right into this class, as it's common to all inheriters

Reimplemented from KDevelop::DUChainBase.

Definition at line 84 of file problem.cpp.

◆ toString()

QString Problem::toString ( ) const
virtual

Returns a string representation of this problem, useful for debugging.

Definition at line 235 of file problem.cpp.

◆ url()

IndexedString Problem::url ( ) const
overridevirtual

Reimplemented from KDevelop::DUChainBase.

Definition at line 89 of file problem.cpp.


The documentation for this class was generated from the following files:
  • problem.h
  • problem.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Mar 7 2021 23:29:31 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevplatform/language/duchain

Skip menu "kdevplatform/language/duchain"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal