diff --git a/README.md b/README.md index bd00009..5ead1c5 100644 --- a/README.md +++ b/README.md @@ -54,33 +54,6 @@ This extension comes with 2 actions that you can configure the way you want and ![MultiFormat available actions](image/README/MultiFormat%20available%20actions.png) -## Supported languages and frameworks - -- Astro -- CSS -- ERB -- Haskell -- HTML -- JavaScript -- JSON -- Markdown -- MATLAB -- MDX -- PHP -- PostCSS -- Python -- React (JSX and TSX) -- Robotframework -- Rust -- SCSS -- Svelte -- Twig -- TypeScript -- Vue -- Ruby - -It's probably easy to add more of them to the list as this depends on other formatters and it's not a formatter by itself, so feel free to add by yourself any language you want in the `package.json` under `activationEvents` and also in the file `src\supported-languages.ts`, test it and create a pull request to this repo 🧐👍. - # License This code is licensed under [GNU GPLv3](./LICENSE) diff --git a/package-lock.json b/package-lock.json index f2f28f0..6b470bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "multi-formatter", - "version": "1.6.2", + "version": "1.7.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "multi-formatter", - "version": "1.6.2", + "version": "1.7.0", "license": "GNU GPLv3", "devDependencies": { "@types/vscode": "^1.75.0", diff --git a/package.json b/package.json index 4a98954..f708674 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "multi-formatter", "displayName": "Multiple Formatters", "publisher": "Jota0222", - "version": "1.6.2", + "version": "1.7.0", "description": "It allows to use multiple formatters as a composite formatter in just one run in Visual Studio Code", "repository": { "url": "https://github.com/jota0222/MultiFormatterVSCode.git" @@ -55,31 +55,7 @@ } }, "activationEvents": [ - "onLanguage:astro", - "onLanguage:css", - "onLanguage:erb", - "onLanguage:haskell", - "onLanguage:html", - "onLanguage:javascript", - "onLanguage:javascriptreact", - "onLanguage:json", - "onLanguage:markdown", - "onLanguage:matlab", - "onLanguage:mdx", - "onLanguage:php", - "onLanguage:postcss", - "onLanguage:python", - "onLanguage:robotframework", - "onLanguage:ruby", - "onLanguage:rust", - "onLanguage:scss", - "onLanguage:svelte", - "onLanguage:twig", - "onLanguage:typescript", - "onLanguage:typescriptreact", - "onLanguage:vue-html", - "onLanguage:vue-postcss", - "onLanguage:vue" + "onLanguage" ], "devDependencies": { "@types/vscode": "^1.75.0", diff --git a/src/formatter.ts b/src/formatter.ts index 3f043d1..62806d8 100644 --- a/src/formatter.ts +++ b/src/formatter.ts @@ -10,7 +10,6 @@ import { WorkspaceConfiguration, ConfigurationTarget, } from "vscode"; -import supportedLanguages from "./supported-languages"; export default class Formatter { private readonly FORMAT_DOCUMENT_ACTION = "editor.action.formatDocument"; @@ -33,11 +32,11 @@ export default class Formatter { } init(context: ExtensionContext) { - this.logger.appendLine(`Registering actions and formatter for supported languages`); + this.logger.appendLine(`Registering actions and formatter`); context.subscriptions.push( commands.registerCommand("multiFormatter.formatSelection", this.formatSelection.bind(this)), commands.registerCommand("multiFormatter.formatDocument", this.formatDocument.bind(this)), - languages.registerDocumentRangeFormattingEditProvider(supportedLanguages, { + languages.registerDocumentRangeFormattingEditProvider('*', { provideDocumentRangeFormattingEdits: this.selectFormattingAction.bind(this), }), ); diff --git a/src/supported-languages.ts b/src/supported-languages.ts deleted file mode 100644 index ce2364f..0000000 --- a/src/supported-languages.ts +++ /dev/null @@ -1,27 +0,0 @@ -export default [ - 'astro', - 'css', - 'erb', - 'haskell', - 'html', - 'javascript', - 'javascriptreact', - 'json', - 'markdown', - 'matlab', - 'mdx', - 'php', - 'postcss', - 'python', - 'robotframework', - 'ruby', - 'rust', - 'scss', - 'svelte', - 'twig', - 'typescript', - 'typescriptreact', - 'vue-html', - 'vue-postcss', - 'vue', -]