PT #153100339 Don't cache CU unless there is a project for it

This commit is contained in:
BoykoAlex
2017-11-22 14:20:31 -05:00
parent 8c956bf962
commit a50c09097a
7 changed files with 108 additions and 61 deletions

View File

@@ -334,14 +334,19 @@ public class PropertiesCompletionProposalsCalculator {
DocumentEdits docEdits;
try {
docEdits = LazyProposalApplier.from(() -> {
Type type = TypeParser.parse(match.data.getType());
DocumentEdits edits = new DocumentEdits(doc);
edits.delete(offset-prefix.length(), offset);
edits.insert(offset, match.data.getId() + propertyCompletionPostfix(typeUtil, type));
return edits;
try {
Type type = TypeParser.parse(match.data.getType());
DocumentEdits edits = new DocumentEdits(doc);
edits.delete(offset-prefix.length(), offset);
edits.insert(offset, match.data.getId() + propertyCompletionPostfix(typeUtil, type));
return edits;
} catch (Throwable t) {
Log.log(t);
return new DocumentEdits(doc);
}
});
proposals.add(completionFactory.property(doc, docEdits, match, typeUtil));
} catch (Exception e) {
} catch (Throwable e) {
Log.log(e);
}
}