Skip to content

Commit

Permalink
Fix biome's entry point resolution on Windows (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
mataha authored Dec 6, 2023
1 parent 8cb17df commit 5def955
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
import os
import sublime

BIOME_EXECUTABLE = 'biome.cmd' if sublime.platform == 'windows' else 'biome'


class LspBiomePlugin(NpmClientHandler):
package_name = __package__
server_directory = 'language-server'
server_binary_path = os.path.join(server_directory, 'node_modules', '.bin', 'biome')
server_binary_path = os.path.join(server_directory, 'node_modules', '.bin', BIOME_EXECUTABLE)

@classmethod
def is_allowed_to_start(
Expand Down Expand Up @@ -47,7 +49,7 @@ def _get_workspace_relative_path(cls, rome_lsp_bin: str, workspace_folders: List
@classmethod
def _get_workspace_dependency(cls, workspace_folders: List[WorkspaceFolder]) -> Optional[str]:
for folder in workspace_folders:
binary_path = os.path.join(folder.path, 'node_modules', '.bin', 'biome')
binary_path = os.path.join(folder.path, 'node_modules', '.bin', BIOME_EXECUTABLE)
if os.path.isfile(binary_path):
return binary_path
return None
Expand Down

0 comments on commit 5def955

Please sign in to comment.