Fix project CLI language server aliases

This commit is contained in:
Tyce Herrman authored and Dr. Dominik Jain committed 2026-07-23 01:35:39 +02:00
1 parent 5e745aabf5
commit ac256f3630
2 files changed
+13 -2

No files matched your search

+4 -2
View File
@@ -733,9 +733,10 @@ class ProjectCommands(AutoRegisteringGroup):
@click.option(
"--ls",
"--language",
"language",
type=str,
multiple=True,
help="Programming language(s); inferred if not specified. Can be passed multiple times.",
help="Language server(s); inferred if not specified. Can be passed multiple times.",
)
@click.option("--index", is_flag=True, help="Index the project after creation.")
@click.option(
@@ -767,9 +768,10 @@ class ProjectCommands(AutoRegisteringGroup):
@click.option(
"--ls",
"--language",
"language",
type=str,
multiple=True,
help="Programming language(s) (only used if auto-creating project.yml). Inferred if not specified.",
help="Language server(s) (only used if auto-creating project.yml). Inferred if not specified.",
)
@click.option(
"--log-level",
+9
View File
@@ -7,6 +7,7 @@ import time
from pathlib import Path
import pytest
from click import Command, Option
from click.testing import CliRunner
from serena.cli import ProjectCommands, TopLevelCommands, find_project_root
@@ -51,6 +52,14 @@ def cli_runner():
return CliRunner()
@pytest.mark.parametrize("command", [ProjectCommands.create, ProjectCommands.index])
def test_language_server_aliases_bind_to_language_parameter(command: Command) -> None:
language_option = next(option for option in command.params if isinstance(option, Option) and "--ls" in option.opts)
assert language_option.name == "language"
assert language_option.opts == ["--ls", "--language"]
class TestProjectCreate:
"""Tests for 'project create' command."""