@@ -82,6 +82,13 @@ protected void buildLanguageFoldRegions(@NotNull final List<FoldingDescriptor> r
8282 }
8383 }
8484
85+ for (GoConstDeclaration constDeclaration : PsiTreeUtil .findChildrenOfType (file , GoConstDeclaration .class )) {
86+ TextRange range = processList (constDeclaration .getLparen (), constDeclaration .getRparen (), constDeclaration .getConstSpecList ().size ());
87+ if (range != null ) {
88+ result .add (new FoldingDescriptor (constDeclaration , range ));
89+ }
90+ }
91+
8592 for (GoTypeDeclaration typeDeclaration : PsiTreeUtil .findChildrenOfType (file , GoTypeDeclaration .class )) {
8693 TextRange range = processList (typeDeclaration .getLparen (), typeDeclaration .getRparen (), typeDeclaration .getTypeSpecList ().size ());
8794 if (range != null ) {
@@ -172,7 +179,8 @@ private static void addCommentFolds(@NotNull PsiElement comment,
172179 }
173180
174181 if (end != null ) {
175- foldElements .add (new FoldingDescriptor (comment , new TextRange (comment .getTextRange ().getStartOffset (), end .getTextRange ().getEndOffset ())));
182+ foldElements
183+ .add (new FoldingDescriptor (comment , new TextRange (comment .getTextRange ().getStartOffset (), end .getTextRange ().getEndOffset ())));
176184 }
177185 }
178186
@@ -182,8 +190,13 @@ protected String getLanguagePlaceholderText(@NotNull ASTNode node, @NotNull Text
182190 PsiElement psi = node .getPsi ();
183191 IElementType type = node .getElementType ();
184192 if (psi instanceof GoBlock || psi instanceof GoStructType ||
185- psi instanceof GoInterfaceType || psi instanceof GoLiteralValue ) return "{...}" ;
186- if (psi instanceof GoVarDeclaration || psi instanceof GoTypeDeclaration ) return "(...)" ;
193+ psi instanceof GoInterfaceType || psi instanceof GoLiteralValue ) {
194+ return "{...}" ;
195+ }
196+ if (psi instanceof GoVarDeclaration || psi instanceof GoConstDeclaration
197+ || psi instanceof GoTypeDeclaration ) {
198+ return "(...)" ;
199+ }
187200 if (psi instanceof GoImportDeclaration ) return "..." ;
188201 if (GoParserDefinition .LINE_COMMENT == type ) return "/.../" ;
189202 if (GoParserDefinition .MULTILINE_COMMENT == type ) return "/*...*/" ;
0 commit comments