Changeset View
Changeset View
Standalone View
Standalone View
phpparsejob.cpp
Show All 24 Lines | |||||
25 | 25 | | |||
26 | #include <language/duchain/duchainlock.h> | 26 | #include <language/duchain/duchainlock.h> | ||
27 | #include <language/duchain/duchain.h> | 27 | #include <language/duchain/duchain.h> | ||
28 | #include <language/duchain/topducontext.h> | 28 | #include <language/duchain/topducontext.h> | ||
29 | #include <interfaces/icore.h> | 29 | #include <interfaces/icore.h> | ||
30 | #include <interfaces/ilanguagecontroller.h> | 30 | #include <interfaces/ilanguagecontroller.h> | ||
31 | #include <language/backgroundparser/backgroundparser.h> | 31 | #include <language/backgroundparser/backgroundparser.h> | ||
32 | #include <language/backgroundparser/urlparselock.h> | 32 | #include <language/backgroundparser/urlparselock.h> | ||
33 | #include <language/editor/documentrange.h> | ||||
33 | 34 | | |||
34 | #include "editorintegrator.h" | 35 | #include "editorintegrator.h" | ||
35 | #include "parsesession.h" | 36 | #include "parsesession.h" | ||
36 | #include "phplanguagesupport.h" | 37 | #include "phplanguagesupport.h" | ||
37 | #include "phpdebugvisitor.h" | 38 | #include "phpdebugvisitor.h" | ||
38 | #include "duchain/builders/declarationbuilder.h" | 39 | #include "duchain/builders/declarationbuilder.h" | ||
39 | #include "duchain/builders/usebuilder.h" | 40 | #include "duchain/builders/usebuilder.h" | ||
40 | #include "duchain/helper.h" | 41 | #include "duchain/helper.h" | ||
41 | #include "phpducontext.h" | 42 | #include "phpducontext.h" | ||
42 | #include "phpdebug.h" | 43 | #include "phpdebug.h" | ||
43 | 44 | | |||
44 | #include <QtCore/QReadLocker> | 45 | #include <QtCore/QReadLocker> | ||
45 | #include <QtCore/QThread> | 46 | #include <QtCore/QThread> | ||
46 | #include <language/duchain/duchainutils.h> | 47 | #include <language/duchain/duchainutils.h> | ||
47 | 48 | | |||
48 | #include <mutex> | 49 | #include <mutex> | ||
49 | 50 | | |||
50 | using namespace KDevelop; | 51 | using namespace KDevelop; | ||
51 | 52 | | |||
52 | namespace Php | 53 | namespace Php | ||
53 | { | 54 | { | ||
54 | 55 | | |||
55 | ParseJob::ParseJob(const IndexedString& url, ILanguageSupport* languageSupport) | 56 | ParseJob::ParseJob(const IndexedString& url, ILanguageSupport* languageSupport) | ||
56 | : KDevelop::ParseJob(url, languageSupport) | 57 | : KDevelop::ParseJob(url, languageSupport) | ||
57 | , m_parentJob(0) | 58 | , m_parentJob(nullptr) | ||
58 | { | 59 | { | ||
59 | } | 60 | } | ||
60 | 61 | | |||
61 | ParseJob::~ParseJob() | 62 | ParseJob::~ParseJob() | ||
62 | { | 63 | { | ||
63 | } | 64 | } | ||
64 | 65 | | |||
65 | LanguageSupport* ParseJob::php() const | 66 | LanguageSupport* ParseJob::php() const | ||
Show All 30 Lines | 72 | { | |||
96 | } | 97 | } | ||
97 | 98 | | |||
98 | ParseSession session; | 99 | ParseSession session; | ||
99 | //TODO: support different charsets | 100 | //TODO: support different charsets | ||
100 | session.setContents(QString::fromUtf8(contents().contents)); | 101 | session.setContents(QString::fromUtf8(contents().contents)); | ||
101 | session.setCurrentDocument(document()); | 102 | session.setCurrentDocument(document()); | ||
102 | 103 | | |||
103 | // 2) parse | 104 | // 2) parse | ||
104 | StartAst* ast = 0; | 105 | StartAst* ast = nullptr; | ||
105 | bool matched = session.parse(&ast); | 106 | bool matched = session.parse(&ast); | ||
106 | 107 | | |||
107 | if (abortRequested() || ICore::self()->shuttingDown()) { | 108 | if (abortRequested() || ICore::self()->shuttingDown()) { | ||
108 | return abortJob(); | 109 | return abortJob(); | ||
109 | } | 110 | } | ||
110 | 111 | | |||
111 | KDevelop::ReferencedTopDUContext toUpdate; | 112 | KDevelop::ReferencedTopDUContext toUpdate; | ||
112 | { | 113 | { | ||
▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines |