microsoft / microsoft/monaco-editor

[Bug] Freemarker

Open
#3,426 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Reproducible in vscode.dev or in VS Code Desktop?
  • Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
Monaco Editor Playground Code
monaco.editor.create(document.getElementById('container'), {
	value: "function hello() {\n\talert('Hello world!');\n}",
	language: 'freemarker2'
});
Reproduction Steps

Make sure "freemarker2" language is selected. Enter the Freemarker sample from the official site:

<html>
<head>
  <title>Welcome!</title>
</head>
<body>
  <h1>
    Welcome ${user}<#if user == "Big Joe">, our beloved leader</#if>!
  </h1>
  <p>Our latest product:
  <a href="${latestProduct.url}">${latestProduct.name}</a>!
</body>
</html>
Actual (Problematic) Behavior

This is how the code is highlighted in Monaco:
image
The HTML tags receive no highlighting whatsoever, and FTL-specific features are only highlighted partially.

Expected Behavior

This is how the same code is highlighted by Visual Studio Code with the Freemarker plugin:
image
Code highlighting is a lot more detailed and verbose. HTML tags are treated appropriately.

Additional Context

I don't see a way to select Freemarker language in Visual Studio Code, despite it using Monaco under the hood.

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 with the Monaco Editor Playground and select the freemarker2 language, then reproduce the official Freemarker sample from the issue. Compare the highlighting with the linked Visual Studio Code plugin example; done means HTML tags and the Freemarker-specific features are highlighted appropriately.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
frontend, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.