microsoft / monaco-editor

A browser based code editor
https://microsoft.github.io/monaco-editor/
MIT License
40.63k stars 3.61k forks source link

Feature request: Implement syntax highlighting support for Dart/Flutter #1827

Open sabolch opened 4 years ago

sabolch commented 4 years ago

Feature request

Add syntax highlighting support for the Dart (and Flutter) programming language. Official Dart VS Code extension syntax files https://github.com/Dart-Code/Dart-Code/tree/master/syntaxes Monaco language configuration for Dart

const dartConfiguration = {
    comments: {
        lineComment: "//",
        blockComment: [ "/*", "*/" ]
    },
    brackets: [
        ["{", "}"],
        ["[", "]"],
        ["(", ")"]
    ],
    autoClosingPairs: [
        { open: "{", close: "}" },
        { open: "[", close: "]" },
        { open: "(", close: ")" },
        { open: "'", close: "'", notIn: ["string", "comment"] },
        { open: "\"", close: "\"", notIn: ["string"] },
        { open: "`", close: "`", notIn: ["string", "comment"] },
        { open: "/**", close: " */", notIn: ["string"] }
    ],
    surroundingPairs: [
        ["{", "}"],
        ["[", "]"],
        ["(", ")"],
        ["<", ">"],
        ["'", "'"],
        ["\"", "\""],
        ["`", "`"]
    ]
};

Help Wanted

nrayburn-tech commented 4 years ago

@VarghaSabee Would you be able to provide a program sample, so that I have something to test the syntax against? Something similar to the examples from the monarch page would be very helpful.

sabolch commented 4 years ago

@nrayburn-tech you can edit and test dart syntax (real time) in codesandbox follow this link https://codesandbox.io/s/monaco-editor-zpept?fontsize=14&hidenavigation=1&theme=dark, I also forked the monaco-languages respository and added a basic dart syntax support, but is very weak and needs to improve https://github.com/VarghaSabee/monaco-languages (feature branch)

mafreud commented 3 years ago

I need dart/flutter version of https://www.npmjs.com/package/monaco-yaml.

rcjsuen commented 3 years ago

I need dart/flutter version of https://www.npmjs.com/package/monaco-yaml.

Should this issue be closed because the original request is resolved due to https://github.com/microsoft/monaco-languages/pull/84 being merged or should it stay open to track the above feature request?