Skip to content

Commit

Permalink
Update widgets (#59)
Browse files Browse the repository at this point in the history
* remove taskbar widget

* update lsp widget entry

- add the biome icon
- add button to the settings page
  • Loading branch information
JohannesIBK committed May 19, 2024
1 parent 5717ad0 commit c23e69c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 113 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.github.biomejs.intellijbiome

import com.intellij.openapi.util.IconLoader

object BiomeIcons {
@JvmField
val BiomeIcon = IconLoader.getIcon("/icons/pluginIcon.svg", javaClass)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.github.biomejs.intellijbiome.lsp

import com.github.biomejs.intellijbiome.BiomeBundle
import com.github.biomejs.intellijbiome.BiomeIcons
import com.github.biomejs.intellijbiome.BiomePackage
import com.github.biomejs.intellijbiome.extensions.runBiomeCLI
import com.github.biomejs.intellijbiome.listeners.BIOME_CONFIG_RESOLVED_TOPIC
import com.github.biomejs.intellijbiome.services.BiomeServerService
import com.github.biomejs.intellijbiome.settings.BiomeConfigurable
import com.github.biomejs.intellijbiome.settings.BiomeSettings
import com.intellij.execution.ExecutionException
import com.intellij.execution.configurations.GeneralCommandLine
Expand All @@ -13,6 +15,7 @@ import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.platform.lsp.api.*
import com.intellij.platform.lsp.api.customization.LspFormattingSupport
import com.intellij.platform.lsp.api.lsWidget.LspServerWidgetItem
import com.intellij.util.SmartList


Expand All @@ -34,6 +37,11 @@ class BiomeLspServerSupportProvider : LspServerSupportProvider {
val executable = BiomePackage(project).binaryPath(configPath, false) ?: return
serverStarter.ensureServerStarted(BiomeLspServerDescriptor(project, executable, configPath))
}

override fun createLspServerWidgetItem(lspServer: LspServer, currentFile: VirtualFile?) = LspServerWidgetItem(
lspServer, currentFile,
BiomeIcons.BiomeIcon, BiomeConfigurable::class.java
)
}

@Suppress("UnstableApiUsage")
Expand Down

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

<extensions defaultExtensionNs="com.intellij">
<notificationGroup id="Biome" displayType="BALLOON"/>
<statusBarWidgetFactory implementation="com.github.biomejs.intellijbiome.widgets.BiomeStatusBarWidgetFactory"
id="BiomeWidget"/>
<platform.lsp.serverSupportProvider
implementation="com.github.biomejs.intellijbiome.lsp.BiomeLspServerSupportProvider"/>
<projectConfigurable id="Settings.Biome"
Expand Down
4 changes: 0 additions & 4 deletions src/main/resources/messages/BiomeBundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ biome.settings.name=Biome
biome.path.executable=Biome executable
biome.config.path.label=Path of biome.json
biome.language.server.not.found=Biome language server is not found, make sure you have @biomejs/biome installed.
biome.loading=Biome is loading...
biome.language.server.is.running=Biome server is running
biome.language.server.is.stopped=Biome server is stopped
biome.language.server.restarted=Biome server restarted
biome.interpreter.not.configured=Your node interpreter not configured.
biome.invalid.pattern=Invalid pattern
Expand All @@ -19,6 +16,5 @@ biome.run.safe.fixes.on.save.checkbox.on.actions.on.save.page=Run Biome check wi
biome.run.unsafe.fixes.on.save.checkbox.on.actions.on.save.page=Run Biome check with --apply-unsafe
biome.run.biome.check.with.features=Running Biome check with {0}
biome.failed.to.run.biome.check.with.features=Failed to run Biome check with {0} for file {1}
biome.widget.version=Biome {0}
biome.run.on.save.package.not.specified.warning=Biome package not specified
biome.run.on.save.version.and.files.pattern=Version {0}. Run for: {1}

0 comments on commit c23e69c

Please sign in to comment.