From 6a1dd637ce3fc106c4eb180a53808e922bf6bc58 Mon Sep 17 00:00:00 2001 From: Sonny Date: Sun, 14 Jul 2024 23:13:59 +0200 Subject: [PATCH] Remove Biome (#973) We switched to TypeScript Language Server so we don't need it anymore. --- build-aux/modules/biome.json | 21 --------------------- build-aux/re.sonny.Workbench.Devel.json | 1 - build-aux/re.sonny.Workbench.json | 1 - data/app.metainfo.xml | 2 +- src/application.js | 20 -------------------- src/langs/css/CssDocument.js | 2 +- src/langs/javascript/JavaScriptDocument.js | 4 ---- src/langs/javascript/biome.json | 19 ------------------- src/meson.build | 1 - 9 files changed, 2 insertions(+), 69 deletions(-) delete mode 100644 build-aux/modules/biome.json delete mode 100644 src/langs/javascript/biome.json diff --git a/build-aux/modules/biome.json b/build-aux/modules/biome.json deleted file mode 100644 index 6de6f5f89..000000000 --- a/build-aux/modules/biome.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "biome", - "buildsystem": "simple", - "build-commands": ["chmod +x biome", "cp biome /app/bin/biome"], - "sources": [ - { - "type": "file", - "dest-filename": "biome", - "only-arches": ["aarch64"], - "url": "https://github.com/biomejs/biome/releases/download/cli%2Fv1.8.3/biome-linux-arm64", - "sha256": "d134e89f6f4fc29d32c8101efb074969ac263ebdb0303e07039e3735002c6a2d" - }, - { - "type": "file", - "dest-filename": "biome", - "only-arches": ["x86_64"], - "url": "https://github.com/biomejs/biome/releases/download/cli%2Fv1.8.3/biome-linux-x64", - "sha256": "5495f2f69edd94e9f26ed1adb9ed8023d7c143c3cc6f275f90abdded612217e4" - } - ] -} diff --git a/build-aux/re.sonny.Workbench.Devel.json b/build-aux/re.sonny.Workbench.Devel.json index 590268b4c..3f731a2fd 100644 --- a/build-aux/re.sonny.Workbench.Devel.json +++ b/build-aux/re.sonny.Workbench.Devel.json @@ -39,7 +39,6 @@ ], "modules": [ "modules/blueprint-compiler.json", - "modules/biome.json", "modules/gst-plugin-gtk4.json", "modules/vte.json", "modules/libshumate.json", diff --git a/build-aux/re.sonny.Workbench.json b/build-aux/re.sonny.Workbench.json index 2d697faf5..29718089e 100644 --- a/build-aux/re.sonny.Workbench.json +++ b/build-aux/re.sonny.Workbench.json @@ -39,7 +39,6 @@ ], "modules": [ "modules/blueprint-compiler.json", - "modules/biome.json", "modules/gst-plugin-gtk4.json", "modules/vte.json", "modules/libshumate.json", diff --git a/data/app.metainfo.xml b/data/app.metainfo.xml index 54d0744a7..cb68dc228 100644 --- a/data/app.metainfo.xml +++ b/data/app.metainfo.xml @@ -55,7 +55,7 @@
    -
  • Update Biome to 1.8.3
  • +
  • Replace Biome with TypeScript Language Server
  • Update gst-plugin-gtk4 to 1.12.7
diff --git a/src/application.js b/src/application.js index 25acd8d74..a7c31b487 100644 --- a/src/application.js +++ b/src/application.js @@ -64,23 +64,7 @@ application.connect("open", (_self, files, hint) => { load().catch(console.error); }); -let proc_biome; - application.connect("startup", () => { - // biome lsp-proxy starts a background server - // it does not get stopped and leaves a process hanging - // so manage it manually instead - // See https://github.com/workbenchdev/Workbench/issues/828 - const subprocess_launcher = Gio.SubprocessLauncher.new( - Gio.SubprocessFlags.STDERR_SILENCE, - ); - proc_biome = subprocess_launcher.spawnv([ - "biome", - "__run_server", - "--config-path", - pkg.pkgdatadir, - ]); - Library({ application, }); @@ -90,10 +74,6 @@ application.connect("startup", () => { restoreSessions().catch(console.error); }); -application.connect("shutdown", () => { - proc_biome?.force_exit(); -}); - application.connect("activate", () => { if (application.is_remote) { bootstrap().catch(console.error); diff --git a/src/langs/css/CssDocument.js b/src/langs/css/CssDocument.js index cced3fce0..733d0cd77 100644 --- a/src/langs/css/CssDocument.js +++ b/src/langs/css/CssDocument.js @@ -25,7 +25,7 @@ export class CssDocument extends Document { }, }); - // Biome doesn't support diff - it just returns one edit + // GTKCssLanguageServer doesn't support diff - it just returns one edit // we don't want to loose the cursor position so we use this const state = this.code_view.saveState(); applyTextEdits(text_edits, this.buffer); diff --git a/src/langs/javascript/JavaScriptDocument.js b/src/langs/javascript/JavaScriptDocument.js index 7bc14f468..a3bc46e3f 100644 --- a/src/langs/javascript/JavaScriptDocument.js +++ b/src/langs/javascript/JavaScriptDocument.js @@ -26,10 +26,6 @@ export class JavaScriptDocument extends Document { }, }); - // Biome doesn't support diff - it just returns one edit - // we don't want to loose the cursor position so we use this - const state = this.code_view.saveState(); applyTextEdits(text_edits, this.buffer); - await this.code_view.restoreState(state); } } diff --git a/src/langs/javascript/biome.json b/src/langs/javascript/biome.json deleted file mode 100644 index 4786af4fb..000000000 --- a/src/langs/javascript/biome.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/1.3.3/schema.json", - "javascript": { - "globals": ["workbench"] - }, - "formatter": { - "indentStyle": "space", - "indentWidth": 2 - }, - "linter": { - "rules": { - "recommended": false, - "correctness": { - "noUndeclaredVariables": "error", - "noUnusedVariables": "warn" - } - } - } -} diff --git a/src/meson.build b/src/meson.build index 4c7b76e13..2a4bef688 100644 --- a/src/meson.build +++ b/src/meson.build @@ -47,7 +47,6 @@ configure_file( ) install_data('langs/vala/workbench.vala', install_dir: pkgdatadir) -install_data('langs/javascript/biome.json', install_dir: pkgdatadir) install_data('project-readme.md', install_dir: pkgdatadir) subdir('libworkbench') subdir('Previewer')