Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Dart syntax highlighting #477

Open
Wdestroier opened this issue Dec 17, 2024 · 3 comments
Open

Feature request: Dart syntax highlighting #477

Wdestroier opened this issue Dec 17, 2024 · 3 comments

Comments

@Wdestroier
Copy link

The editor theme is great, but without syntax highlight it's much harder to read the code. Would be great if it supported Dart.

Other questions:
The scroll width is too small, can it be increased in the configuration?
Can Focus open files in a single instance by default? Everytime it opens a new window. For example: when I try to open a zipped dart file.
Can Focus keep a list of open files? And persist it when the editor is closed and reopened? Similar to Notepad++.

@focus-editor
Copy link
Owner

focus-editor commented Dec 17, 2024 via email

@Wdestroier
Copy link
Author

Wdestroier commented Dec 17, 2024

It's only possible to support Dart if someone familiar with Dart sends a PR
adding the support, or at the very least provides a complete list of
keywords and parsing rules for other things so that we can implement it.

Highlighting all keywords is probably a good start.

keywords :: {
    "abstract", "as", "assert", "async",
    "await", "base", "break", "case",
    "catch", "class", "const", "continue",
    "covariant", "default", "deferred", "do",
    "dynamic", "else", "enum", "export",
    "extends", "extension", "external", "factory",
    "false", "final", "finally",
    "for", "Function", "get", "hide",
    "if", "implements", "import", "in",
    "interface", "is", "late", "library",
    "mixin", "new", "null", "of",
    "on", "operator", "part", "required",
    "rethrow", "return", "sealed", "set",
    "show", "static", "super", "switch",
    "sync", "this", "throw", "true",
    "try", "type", "typedef", "var",
    "void", "when", "with", "while",
}

For the other questions it's best to ask them on discord and not under an
unrelated feature request.

Thank you.

EDIT:
If you want a grammar:
https://github.com/dart-lang/sdk/blob/0a5a8f17af8e0514762390c1b64fa52387253b39/tools/spec_parser/Dart.g

@keyle
Copy link

keyle commented Jan 7, 2025

Users can't create syntaxes without recompiling the editor... Typically that'd be fine, but most users don't have the Jai compiler including myself... So that's a limiting factor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants