mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 19:02:13 +07:00
[by: cdr] EA-31437 - assert: DocumentFoldingInfo.writeExternal
1. Don't create name-based signature for PsiNamedElement with undefined name; 2. Debug info is added;
This commit is contained in:
+12
-2
@@ -76,6 +76,12 @@ public class PsiNamesElementSignatureProvider extends AbstractElementSignaturePr
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (processingInfoStorage != null) {
|
||||
processingInfoStorage.append(String.format(
|
||||
"Finished processing of '%s' provider because all of its top-level children have been processed: %s",
|
||||
getClass().getName(), Arrays.toString(children)
|
||||
));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else if (DOC_COMMENT_MARKER.equals(elementMarker)) {
|
||||
@@ -141,12 +147,16 @@ public class PsiNamesElementSignatureProvider extends AbstractElementSignaturePr
|
||||
private static StringBuilder getSignature(@NotNull PsiElement element, @Nullable StringBuilder buffer) {
|
||||
if (element instanceof PsiNamedElement) {
|
||||
PsiNamedElement named = (PsiNamedElement)element;
|
||||
int index = getChildIndex(named, element.getParent(), named.getName(), (Class<PsiNamedElement>)named.getClass());
|
||||
final String name = named.getName();
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
int index = getChildIndex(named, element.getParent(), name, (Class<PsiNamedElement>)named.getClass());
|
||||
StringBuilder bufferToUse = buffer;
|
||||
if (bufferToUse == null) {
|
||||
bufferToUse = new StringBuilder();
|
||||
}
|
||||
bufferToUse.append(TYPE_MARKER).append(ELEMENT_TOKENS_SEPARATOR).append(named.getName())
|
||||
bufferToUse.append(TYPE_MARKER).append(ELEMENT_TOKENS_SEPARATOR).append(name)
|
||||
.append(ELEMENT_TOKENS_SEPARATOR).append(index);
|
||||
return bufferToUse;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user