Skip to content

Commit

Permalink
Ignore XML Schema loading for completion (see #159)
Browse files Browse the repository at this point in the history
  • Loading branch information
angelozerr committed Oct 28, 2018
1 parent cd7c84e commit 8348cc6
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void onTagOpen(ICompletionRequest request, ICompletionResponse response)
}
}
} catch (CacheResourceDownloadingException e) {
addCacheWarningItem(e, response);
// XML Schema, DTD is loading, ignore this error
}
}

Expand Down Expand Up @@ -147,7 +147,7 @@ public void onAttributeName(boolean generateValue, Range fullRange, ICompletionR
}
}
} catch (CacheResourceDownloadingException e) {
addCacheWarningItem(e, response);
// XML Schema, DTD is loading, ignore this error
}
}

Expand All @@ -173,16 +173,7 @@ public void onAttributeValue(String valuePrefix, Range fullRange, boolean addQuo
}
}
} catch (CacheResourceDownloadingException e) {
addCacheWarningItem(e, response);
// XML Schema, DTD is loading, ignore this error
}
}

private void addCacheWarningItem(CacheResourceDownloadingException e, ICompletionResponse response) {
// Here cache is enabled and some XML Schema, DTD, etc are loading
CompletionItem item = new CompletionItem(
"Cannot process " + (e.isDTD() ? "DTD" : "XML Schema") + " completion: " + e.getMessage());
item.setInsertText("");
response.addCompletionItem(item);
}

}

0 comments on commit 8348cc6

Please sign in to comment.