Microsoft/monaco-editor

[Bug] Freemarker

Open

#3,426 建立於 2022年11月18日

在 GitHub 查看
 (1 留言) (2 反應) (0 負責人)JavaScript (1,283 fork)batch import
feature-requestgrammarshelp wanted

倉庫指標

Star
 (14,836 star)
PR 合併指標
 (平均合併 6小時 26分鐘) (30 天內合併 15 個 PR)

描述

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: 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: 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.

貢獻者指南