Skip to content

inner "record"s not properly formatted #1442

@gabrielbcn

Description

@gabrielbcn

[provide a description of the issue]

The keyword record, equivalent to simple classes to hold immutable data (JEP359 https://openjdk.java.net/jeps/359) is not properly recognised when used inside a method (inner record): the keyword and the type get split by a new line (see attached picture).

It does work correctly for nested or top-level records.

Environment
  • Operating System: MacOS10.15
  • JDK version: JDK-14
  • Visual Studio Code version: 1.45.0
  • Java extension version: 0.61.0
Steps To Reproduce
  1. [step 1]

Inside a method, type the following:

record Pair(int number,int weight){}

  1. [step 2]

it will split into two lines and won't show the right colours

record
Pair(int number,int weight){}

[Please attach a sample project reproducing the error]
Please attach logs

Current Result

This happens for inner record: ( while it does work correctly for inner class)

Screenshot 2020-05-12 at 23 02 09

Expected Result

It works correctly when nested or top level:

Screenshot 2020-05-12 at 23 09 20

Additional Informations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions