Skip to content

Commit

Permalink
100% CPU Usage since version 0.18.3
Browse files Browse the repository at this point in the history
Fixes eclipse-lemminx#1175

Signed-off-by: azerr <[email protected]>
  • Loading branch information
angelozerr committed Feb 15, 2022
1 parent 953af82 commit fb2fd23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ public List<Diagnostic> doDiagnostics(DOMDocument xmlDocument, XMLValidationSett
public CompletableFuture<Path> publishDiagnostics(DOMDocument xmlDocument,
Consumer<PublishDiagnosticsParams> publishDiagnostics, Consumer<TextDocument> triggerValidation,
XMLValidationSettings validationSettings, CancelChecker cancelChecker) {
if (validationSettings != null && !validationSettings.isEnabled()) {
// Validation is disabled
return null;
}
// Process validation
String uri = xmlDocument.getDocumentURI();
TextDocument document = xmlDocument.getTextDocument();

Expand Down Expand Up @@ -271,7 +276,7 @@ public Position getMatchingTagPosition(DOMDocument xmlDocument, Position positio
/**
* Returns the linked editing ranges for the given <code>xmlDocument</code> at
* the given <code>position</code> and null otherwise.
*
*
* @param xmlDocument the DOM document.
* @param position the position.
* @param cancelChecker the cancel checker.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@

/**
* This class is the result of a diagnostic process. It contains:
*
*
* <ul>
* <li>list of diagnostics.</li>
* <li>list of completable future which are not done(ex : download some external
* resources XSD, DTD). This list of future gives the capability to refresh
* again the diagnostics once all completable futures are finished (ex : all
* download are finished).</li>
* </ul>
*
*
* @author Angelo ZERR
*
*/
Expand All @@ -41,7 +41,7 @@ public class DiagnosticsResult extends ArrayList<Diagnostic> {

static {
EMPTY = new DiagnosticsResult();
EMPTY.futures = Collections.emptyList();
EMPTY.futures = null;
}

private transient List<CompletableFuture<?>> futures;
Expand All @@ -56,7 +56,7 @@ public void addFuture(CompletableFuture<?> future) {
/**
* Returns the completable futures used in a diagnostics (ex : completeable
* future to download external resources XSD, DTD) and null otherwise.
*
*
* @return the completable futures used in a diagnostics (ex : completeable
* future to download external resources XSD, DTD) and null otherwise.
*/
Expand Down

0 comments on commit fb2fd23

Please sign in to comment.