Skip to content
119 changes: 119 additions & 0 deletions editors/vscode/client/tools/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,90 @@ export default class FormatterTool implements ToolInterface {
// https://github.com/oxc-project/oxc/blob/f3e9913f534e36195b9b5a6244dd21076ed8715e/crates/oxc_formatter/src/service/parse_utils.rs#L73
// allow `*.start.frag` and `*.end.frag`,
"frag",
// https://github.com/oxc-project/oxc/pull/16524/
// JSON
"json",
"4DForm",
"4DProject",
"avsc",
"geojson",
"gltf",
"har",
"ice",
"JSON-tmLanguage",
"json.example",
"mcmeta",
"sarif",
"tact",
"tfstate",
"tfstate.backup",
"topojson",
"webapp",
"webmanifest",
"yy",
"yyp",
// JSONC
"jsonc",
"code-snippets",
"code-workspace",
"sublime-build",
"sublime-color-scheme",
"sublime-commands",
"sublime-completions",
"sublime-keymap",
"sublime-macro",
"sublime-menu",
"sublime-mousemap",
"sublime-project",
"sublime-settings",
"sublime-theme",
"sublime-workspace",
"sublime_metrics",
"sublime_session",
// HTML
"html",
"hta",
"htm",
"inc",
"xht",
"xhtml",
// CSS
"css",
"wxss",
"pcss",
"postcss",
// GraphQL
"graphql",
"gql",
"graphqls",
// Handlebars
"handlebars",
"hbs",
// Markdown
"md",
"livemd",
"markdown",
"mdown",
"mdwn",
"mkd",
"mkdn",
"mkdown",
"ronn",
"scd",
"workbook",
// YAML
"yml",
"mir",
"reek",
"rviz",
"sublime-syntax",
"syntax",
"yaml",
"yaml-tmlanguage",
// https://github.com/oxc-project/oxc/pull/17113/
// TOML
"toml",
"toml.example",
];

// Special filenames that are valid JS files
Expand All @@ -118,6 +202,41 @@ export default class FormatterTool implements ToolInterface {
// covered by the "frag" extension above
// "start.frag",
// "end.frag",

// JSON filenames
".all-contributorsrc",
".arcconfig",
".auto-changelog",
".c8rc",
".htmlhintrc",
".imgbotconfig",
".nycrc",
".tern-config",
".tern-project",
".watchmanconfig",
".babelrc",
".jscsrc",
".jshintrc",
".jslintrc",
".swcrc",
// Markdown filenames
"contents.lr",
"README",
// YAML filenames
".clang-format",
".clang-tidy",
".clangd",
".gemrc",
"CITATION.cff",
"glide.lock",
"pixi.lock",
".prettierrc",
".stylelintrc",
".lintstagedrc",
// https://github.com/oxc-project/oxc/pull/17113/
// TOML filenames
"Pipfile",
"Cargo.toml.orig",
];

// If the extension is launched in debug mode then the debug server options are used
Expand Down
Loading