| 490 | } |
| 491 | |
| 492 | bool ParseJob::isUpdateRequired(const IndexedString& languageString) |
| 493 | { |
| 494 | if (abortRequested()) { |
| 495 | return false; |
| 496 | } |
| 497 | |
| 498 | if (minimumFeatures() & TopDUContext::ForceUpdate) { |
| 499 | return true; |
| 500 | } |
| 501 | |
| 502 | DUChainReadLocker lock; |
| 503 | if (abortRequested()) { |
| 504 | return false; |
| 505 | } |
| 506 | const auto files = DUChain::self()->allEnvironmentFiles(document()); |
| 507 | for (const ParsingEnvironmentFilePointer& file : files) { |
| 508 | if (file->language() != languageString) { |
| 509 | continue; |
| 510 | } |
| 511 | if (!file->needsUpdate(environment()) && file->featuresSatisfied(minimumFeatures())) { |
| 512 | qCDebug(LANGUAGE) << "Already up to date" << document().str(); |
| 513 | setDuChain(file->topContext()); |
| 514 | lock.unlock(); |
| 515 | highlightDUChain(); |
| 516 | return false; |
| 517 | } |
| 518 | break; |
| 519 | } |
| 520 | |
| 521 | return !abortRequested(); |
| 522 | } |
| 523 | |
| 524 | const ParsingEnvironment* ParseJob::environment() const |
| 525 | { |
nothing calls this directly
no test coverage detected