summaryrefslogtreecommitdiffstats
path: root/objects/cppeditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'objects/cppeditor.cpp')
-rw-r--r--objects/cppeditor.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/objects/cppeditor.cpp b/objects/cppeditor.cpp
index c408e43..0226ca7 100644
--- a/objects/cppeditor.cpp
+++ b/objects/cppeditor.cpp
@@ -3,6 +3,7 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <cppeditor/cppeditorconstants.h>
#include "utils/signalwaiter.h"
+#include "cppfunction.h"
namespace Scripting {
namespace Internal {
@@ -17,6 +18,15 @@ void CppEditor::switchDeclarationDefinition()
Core::ActionManager::command(::CppEditor::Constants::SWITCH_DECLARATION_DEFINITION)->action()->trigger();
}
+CppFunction *CppEditor::currentFunction() const
+{
+ return functionAt(editor()->currentLine(), editor()->currentColumn());
+}
+
+CppFunction* CppEditor::functionAt(int line, int column) const
+{
+ return CppFunction::create(line, column, editor()->document()->fileName());
+}
/**
\brief Wait for the editor to signal that it has been initialized after opening a file