Microsoft/monaco-editor

Improve Python syntax highlighting

Open

#1,762 opened on Jan 12, 2020

 (7 comments) (3 reactions) (0 assignees)JavaScript (4,064 forks)batch import
feature-requestgrammarshelp wanted

Repository metrics

Stars
 (46,002 stars)
PR merge metrics
 (Avg merge 6h 26m) (15 merged PRs in 30d)

Description

monaco-editor version: 0.19.2 Browser: Chrome 79 maybe OS: macOS Mojave Playground code that reproduces the issue:

monaco.editor.create(document.getElementById("container"), {
	value: "from functions import sum, average",
	language: "python"
});

Basically some import statements in Python aren't highlighted properly.

How Monaco/Monarch highlights things:

image

How VSCode highlights things:

image

Contributor guide