Skip to content

Support java raw snippets in .md inputs  #1601

Open
@Gedochao

Description

@Gedochao

Is your feature request related to a problem? Please describe.
We currently support compilation of plain scala snippets (as an equivalent of .sc Scala script inputs) and scala raw snippets (as an equivalent of .scala inputs) inside of Markdown sources. (relevant docs for scala raw code blocks)
To be consistent, we could support java raw snippets as an equivalent of .java inputs.

Describe the solution you'd like
Code blocks tagged as java raw inside of Markdown inputs should be compiled as Java code.
No wrapping should take place, similarly to how scala raw is handled with Scala.

# Java Snippet
```java raw
public class Main { 
  public static void main(String[] args) { 
    System.out.println("Hello"); 
  } 
}
```

Describe alternatives you've considered
Theoretically, we could support raw Java code in plain java snippets, if we decide that wrapped Java code similar to scala snippets isn't to be supported, anyway.
However, that'd be inconsistent with how Scala is handled and should probably be avoided. The keyword raw should be required.

Additional context
If plain java snippets were to be supported, we'd have to implement wrapping of Java code on par with Scala CLI's implementation of Scala scripts, which is a considerably bigger effort. (#1602)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Community help wantedIssues that idicate features that are nice-to-have but core team does not have time to work on itenhancementNew feature or requestgood first issueGood for newcomersjavaIssues tied to compiling & running of Java codemarkdownspree

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions