microsoft / microsoft/vscode

Indented code blocks are not supported in Java Markdown documentation comments

Open
#333,770 0 comments 0 reactions 1 assignee Claimed by @aiday-mar View on GitHub
bug editor-autoindent
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Type: Bug

## **Steps to reproduce**

1. Observe that [JEP 467](https://openjdk.org/jeps/467) explicitly mentions [indented code blocks](https://www.markdownguide.org/basic-syntax/#code-blocks).

2. Create an identifier that can have a Markdown documentation comment. For example:

```java
class A {
}
```

3. Add a Markdown documentation comment, with an indented code block:

````java
/// Testing code blocks
///
/// /// @brief A function.
/// /// @param input Input.
/// /// @return The result.
/// ```
/// int func1(int input);
class A {
}
````

4. Observe that VS Code does not render the code block. Instead the four leading spaces are stripped, and the text is interpreted as regular text.

## Expected result

VS Code should render the code block correctly, as specified by JEP 467 and as the official JavaDoc tool does. it should look like this:

Image

## Actual result

The code block is ignored, and the text is rendered as regular text. This looks like so:

Image

## Additional information

VS Code version: Code 1.135.0 (08d4889f9ec4a1685d257b9b95de036c8e1ce1e5, 2026-08-25T14:26:52Z)
OS version: Linux x64 6.18.48-1-cachyos-lts
Modes:

System Info

|Item|Value|
|---|---|
|CPUs|AMD Ryzen 9 8940HX with Radeon Graphics (32 x 3642)|
|GPU Status|2d_canvas: enabled
GPU0: VENDOR= 0x1002, DEVICE=0x164e, DRIVER_VENDOR=Mesa, DRIVER_VERSION=26.2.1 *ACTIVE*
GPU1: VENDOR= 0x10de, DEVICE=0x2d18
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgpu: enabled
webgpu_on_vk_via_gl_interop: disabled_off
webnn: disabled_off|
|Load (avg)|0, 0, 0|
|Memory (System)|30.39GB (26.80GB free)|
|Process Argv|--crash-reporter-id 5e679389-3e6e-4be5-8aad-f169dcf09e62|
|Screen Reader|no|
|VM|0%|
|DESKTOP_SESSION|/usr/share/wayland-sessions/plasma.desktop|
|XDG_CURRENT_DESKTOP|KDE|
|XDG_SESSION_DESKTOP|KDE|
|XDG_SESSION_TYPE|wayland|
Extensions (14)

Name|Identifier|Author|Version
---|---|---|---
Dev Containers|ms-vscode-remote.remote-containers|ms-vscode-remote|0.466.0
Remote - SSH|ms-vscode-remote.remote-ssh|ms-vscode-remote|0.128.0
Remote - SSH: Editing Configuration Files|ms-vscode-remote.remote-ssh-edit|ms-vscode-remote|0.87.0
WSL|ms-vscode-remote.remote-wsl|ms-vscode-remote|0.104.3
Remote Development|ms-vscode-remote.vscode-remote-extensionpack|ms-vscode-remote|0.26.0
Remote Explorer|ms-vscode.remote-explorer|ms-vscode|0.5.0
Remote - Tunnels|ms-vscode.remote-server|ms-vscode|1.5.3
Language Support for Java(TM) by Red Hat|redhat.java|redhat|1.55.0
Gradle for Java|vscjava.vscode-gradle|vscjava|3.18.0
Debugger for Java|vscjava.vscode-java-debug|vscjava|0.59.0
Project Manager for Java|vscjava.vscode-java-dependency|vscjava|0.27.6
Extension Pack for Java|vscjava.vscode-java-pack|vscjava|0.31.1
Test Runner for Java|vscjava.vscode-java-test|vscjava|0.46.0
Maven for Java|vscjava.vscode-maven|vscjava|0.45.3

A/B Experiments

```
vsliv368:30146709
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
envsactivate1:31551504
cloudbuttont:31379625
3efgi100_wstrepl:31403338
839jf696:31457053
ec5jj548:31422691
cp_cls_t_966_ss:31526232
4je02754:31466945
8hhj4413:31478653
cp_cls_c_1081:31454833
conptydll_true:31498968
e9c30283:31461165
c9b86496:31447327
ei9d7968:31496641
chat:31457767
23c7c724:31520045
ddid_t:31478206
hmra_i5g22:31518061
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
db5d2638:31499441
jb_cp_cls_t_632:31543129
56dj4588:31512888
32d76977:31512328
ha629193:31508444
a1ije391_t:31540920
jbcp_cls_pctr_t:31531130
61138546:31518536
cp_intellij_t_nes:31548657
jf4hg949:31526829
ahp-both-windows:31556933
ihg5j128:31534457
f412h606:31551416
7g2b5551:31542111
sandbox-ui-on-2:31543161
enable_editor_pane_layout:31569726
allow-none:31555437
ac562147:31564510
c7c27ce7:31554789
1h923230:31564177
0dg73464:31554319
treatment-23-1:31555779
unuse_dynamic_mcp:31555281
0d8dfbc3:31570291
nemo-v2:31565334
0c1h4866:31566224
session-archive:31558132
5b8j3302:31564601
mangle-name-control:31572633
multiv2:31574985
permission_prompt_treatment:1332566
ccr_pr_nudge_control:1319470
vsc_wsm_t:1340632
eh853263:1355661
auto_mode_control:1367906
h5e14506:1348996

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.