0
0
mirror of https://github.com/vim/vim.git synced 2025-10-16 07:24:23 -04:00
Files
vim/runtime/syntax/testdir/input/java_unfoldment.java
Aliaksei Budavei 143686b3c4 runtime(java): Fold adjacent "import" declarations
Also, distinguish (by abbreviating their names) and manage
foldable kinds of syntax items: blocks of code ("b"), plain
comments ("c"), Javadoc comments ("d"), adjacent "import"
declarations ("i").  Fold all qualifying items by default;
otherwise, do not fold items of explicitly delisted kinds.
For example,
------------------------------------------------------------
	let g:java_ignore_folding = "bcdi"
------------------------------------------------------------

Resolves zzzyxwvut/java-vim#12.

closes: #18492

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-10-08 16:45:28 +00:00

146 lines
2.0 KiB
Java
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// VIM_TEST_SETUP setlocal fen fdc=2 fdl=8 fdm=syntax
// VIM_TEST_SETUP let g:java_highlight_java_lang = 1
// VIM_TEST_SETUP let g:java_ignore_folding = "bcdi"
// VIM_TEST_SETUP let g:java_lookbehind_byte_counts = {'javaBlock': -1}
// VIM_TEST_SETUP let g:java_mark_braces_in_parens_as_errors = 1
// VIM_TEST_SETUP highlight link javaBlockOtherStart Structure
// VIM_TEST_SETUP highlight link javaBlockStart Todo
/***/ import java.lang.Comparable; /*
import java.lang.Object;
import java.lang.String;
*/
import java.lang.String;
import java.lang.Comparable; /***/
import java.lang.Object; // //
import java.lang.String; /***/
import java.util.function.Function;
@SuppressWarnings({
"""
bespoke
/*
*
*/
/**
*
*/
///
///
///
//
//
//
{
}
"""
})
class UnfoldingTests {
interface Unfoldable
{
}
static {
String import$ = """
import java.lang.String;
""";
new Object() {
{
{
new Object() {{{
new Object() {{{}}};
}}};
}
}
};
switch (0) {
case 0:
case 1: {
break;
}
default: ;
}
}
{ Object bb = ((Object) new byte[]{}); }
{
out: {
do {
if (true)
break out;
} while (false);
}
}
/*\\\*/ {
(new Function<Object, Object>() {
/**
* {@inheritDoc} */
public Object apply(Object o) { return o; };
}).apply(
(new Function<Object, Object>() {
/** {@inheritDoc}
*/
public Object apply(Object o) { return o; };
}));
}
/**
* No operation.
*/
void noOp1() { }
/** No operation. */
void noOp2()
{
}
/** No operation. */
void noOp3() {
}
/** No operation. */
void noOp4() {
/*/\/\/\*/ ; }
/// No operation.
///
///
void noOp5() { }
/// No operation.
void noOp6()
{
}
/// No operation.
void noOp7() {
}
/// No operation.
void noOp8() {
/*/\/\/\*/ ; }
}
/*
* Some note.
* {
* }
*/
/**
* A summary.
* {
* }
*/
/// A summary.
/// {
/// }
//
// {
// }
/* 120|........................................................................................*/ interface Unfoldable {
}