c6af9e284a
Tests / catch-all (windows-latest) (push) Has been cancelled
Tests / jvm (macos-latest) (push) Has been cancelled
Tests / jvm (ubuntu-latest) (push) Has been cancelled
Tests / jvm (windows-latest) (push) Has been cancelled
Tests / native (macos-latest) (push) Has been cancelled
Tests / native (ubuntu-latest) (push) Has been cancelled
Tests / native (windows-latest) (push) Has been cancelled
Tests / niche (ubuntu-latest) (push) Has been cancelled
Tests / other-langs (macos-latest) (push) Has been cancelled
Tests / other-langs (ubuntu-latest) (push) Has been cancelled
Tests / other-langs (windows-latest) (push) Has been cancelled
Tests / catch-all (macos-latest) (push) Has been cancelled
Tests / catch-all (ubuntu-latest) (push) Has been cancelled
Docs Build / build (push) Has been cancelled
Docs Build / deploy (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Codespell / Check for spelling errors (push) Has been cancelled
Build and Push Docker Images / build-and-push (push) Has been cancelled
34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
import platform
|
|
|
|
|
|
def _test_erlang_ls_available() -> str:
|
|
"""Test if Erlang LS is available and return error reason if not."""
|
|
# Check if we're on Windows (Erlang LS doesn't support Windows)
|
|
if platform.system() == "Windows":
|
|
return "Erlang LS does not support Windows"
|
|
|
|
# Try to import and check Erlang availability
|
|
try:
|
|
from solidlsp.language_servers.erlang_language_server import ErlangLanguageServer
|
|
|
|
# Check if Erlang/OTP is installed
|
|
erlang_version = ErlangLanguageServer._get_erlang_version()
|
|
if not erlang_version:
|
|
return "Erlang/OTP is not installed or not in PATH"
|
|
|
|
# Check if rebar3 is available (commonly used build tool)
|
|
rebar3_available = ErlangLanguageServer._check_rebar3_available()
|
|
if not rebar3_available:
|
|
return "rebar3 is not installed or not in PATH (required for project compilation)"
|
|
|
|
return "" # No error, Erlang LS should be available
|
|
|
|
except ImportError as e:
|
|
return f"Failed to import ErlangLanguageServer: {e}"
|
|
except Exception as e:
|
|
return f"Error checking Erlang LS availability: {e}"
|
|
|
|
|
|
ERLANG_LS_UNAVAILABLE_REASON = _test_erlang_ls_available()
|
|
ERLANG_LS_UNAVAILABLE = bool(ERLANG_LS_UNAVAILABLE_REASON)
|