Changeset View
Changeset View
Standalone View
Standalone View
plugins/clang/util/clangutils.cpp
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | 61 | foreach(auto document, ICore::self()->documentController()->openDocuments()) { | |||
---|---|---|---|---|---|
73 | ret << UnsavedFile(textDocument->url().toLocalFile(), | 73 | ret << UnsavedFile(textDocument->url().toLocalFile(), | ||
74 | textDocument->textLines(textDocument->documentRange())); | 74 | textDocument->textLines(textDocument->documentRange())); | ||
75 | } | 75 | } | ||
76 | return ret; | 76 | return ret; | ||
77 | } | 77 | } | ||
78 | 78 | | |||
79 | KTextEditor::Range ClangUtils::rangeForIncludePathSpec(const QString& line, const KTextEditor::Range& originalRange) | 79 | KTextEditor::Range ClangUtils::rangeForIncludePathSpec(const QString& line, const KTextEditor::Range& originalRange) | ||
80 | { | 80 | { | ||
81 | static const QRegularExpression pattern(QStringLiteral("^\\s*(#include|#import)")); | 81 | static const QRegularExpression pattern(QStringLiteral("^\\s*(#\\s*include|#\\s*import)")); | ||
82 | if (!line.contains(pattern)) { | 82 | if (!line.contains(pattern)) { | ||
83 | return KTextEditor::Range::invalid(); | 83 | return KTextEditor::Range::invalid(); | ||
84 | } | 84 | } | ||
85 | 85 | | |||
86 | KTextEditor::Range range = originalRange; | 86 | KTextEditor::Range range = originalRange; | ||
87 | int pos = 0; | 87 | int pos = 0; | ||
88 | char term_char = 0; | 88 | char term_char = 0; | ||
89 | for (; pos < line.size(); ++pos) { | 89 | for (; pos < line.size(); ++pos) { | ||
▲ Show 20 Lines • Show All 346 Lines • Show Last 20 Lines |