MCPcopy Create free account
hub / github.com/KDE/kdevelop / insertionRange

Method insertionRange

plugins/clang/codegen/sourcemanipulation.cpp:175–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175KTextEditor::Range SourceCodeInsertion::insertionRange(int line)
176{
177 if (line == 0 || !m_codeRepresentation) {
178 return KTextEditor::Range(line, 0, line, 0);
179 }
180
181 KTextEditor::Range range(line - 1, m_codeRepresentation->line(line - 1).size(), line - 1,
182 m_codeRepresentation->line(line - 1).size());
183 // If the context finishes on that line, then this will need adjusting
184 if (!m_context->rangeInCurrentRevision().contains(range)) {
185 range.start() = m_context->rangeInCurrentRevision().end();
186 if (range.start().column() > 0) {
187 range.start() = range.start() - KTextEditor::Cursor(0, 1);
188 }
189 range.end() = range.start();
190 }
191
192 return range;
193}
194
195bool SourceCodeInsertion::insertFunctionDeclaration(KDevelop::Declaration* declaration, const Identifier& id, const QString& body)
196{

Callers

nothing calls this directly

Calls 9

RangeClass · 0.50
CursorClass · 0.50
sizeMethod · 0.45
lineMethod · 0.45
containsMethod · 0.45
startMethod · 0.45
endMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected