microsoft / microsoft/monaco-editor

[Feature Request] Bump Java language support to latest version

Open
#3,582 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request help wanted languages-basic
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Context
  • This issue is not a bug report. (please use a different template for reporting a bug)
  • This issue is not a duplicate of an existing issue. (please use the search to find existing issues)
Description

The language definitions for Java seem to be fairly out of date and don't include some of the latest features included in Java 11+ (var keyword, etc.).

This is a request to update the language definition files for the Java language to use the latest (or at least a reasonably recent version).

Note that var is not highlighted while int is:

Screen Shot 2023-02-21 at 3 23 35 PM

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.35.0#XQAAAAL0AQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw0RZ0mzaBHJP4s4S3McZzzqAtzEMonf6gHsbSOm4AqX1NrZ8a07x7C6Vce1r32vCt8I-LUEEDJe3AfVo51z8Qqtn6YUpo1pzuPaXm8B5CglDhuDj3FZ9bqdVrGFxBnWSPo5W8eL27Fuo56nfAU9PC2SkflRORYnScsRhRDb_NCNCQR3V9D3rQZDDO6vYWY2mZjdORnsyYGZMRVj2MAvDUuR-cFSbdgu07gaFxU2q2bduQo67KzHpAg113V-nwSxllirmLTLX4KE-vswNay4wqJaiptZYaXpU5gh3grxLFHcgBA0xz8Izx0hqP9N1EmaxTmxwcAxGSBSYtM79Gk_1oTLLSKNeh0bclpMsp0OepPudV4NV7H3qw4ud8D9JEVZwZXJi1XqEyQEkDh-VWj_pGJD0

Monaco Editor Playground Code
// The Monaco Editor can be easily created, given an
// empty container and an options literal.
// Two members of the literal are "value" and "language".
// The editor takes the full size of its container.

monaco.editor.create(document.getElementById("container"), {
	value: 'class Program { \n\t public static void main(String[] args) { \n\t\t var myVar = "this is a var"; \n\t\t int myInt = 12; \n\t} \n}',
	language: "java",
});

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/basic-languages/java, using the linked Monaco Editor Playground example to reproduce the missing highlighting for var. Review the Java language definition files and verify that the requested recent Java syntax is recognized in the playground; done means the demonstrated Java code receives appropriate highlighting.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.