0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00
vim/runtime/syntax/testdir/input/java_unfoldment.java
Aliaksei Budavei e73e5b889b
runtime(java): Optionally highlight the :: token for method references
This token will be highlighted, similar to the arrow of
lambda expressions, whenever "g:java_highlight_functions" is
defined.

Also:

- Improve the recognition of _switch-case_ labels
  (D-Cysteine).
- Remove insignificant empty statements in syntax test
  files.

closes: #15322

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.13
https://github.com/fleiner/vim/pull/1

Co-authored-by: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com>
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-24 20:17:43 +02:00

99 lines
1.2 KiB
Java

// VIM_TEST_SETUP setlocal nofoldenable
// VIM_TEST_SETUP let g:java_mark_braces_in_parens_as_errors = 1
@SuppressWarnings({
"""
bespoke
/*
*
*/
/**
*
*/
//
//
//
{
}
"""
})
class UnfoldingTests {
interface Unfoldenable
{
}
static {
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 java.util.function.Function<Object, Object>() {
/**
* {@inheritDoc} */
public Object apply(Object o) { return o; };
}).apply(
(new java.util.function.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() {
/*/\/\/\*/ ; }
}
/*
* Some note.
* {
* }
*/
/**
* A summary.
* {
* }
*/
//
// {
// }
/* 122|........................................................................................*/ interface Unfoldenable {
}