from robocorp_ls_core.config import Config

OPTION_ROBOT_PYTHON_EXECUTABLE = "robot.python.executable"

OPTION_ROBOT_PYTHON_ENV = "robot.python.env"

OPTION_ROBOT_LANGUAGE_SERVER_TCP_PORT = "robot.language-server.tcp-port"

OPTION_ROBOT_LANGUAGE_SERVER_ARGS = "robot.language-server.args"

OPTION_ROBOT_VARIABLES = "robot.variables"

OPTION_ROBOT_LINT_ROBOCOP_ENABLED = "robot.lint.robocop.enabled"

OPTION_ROBOT_COMPLETION_KEYWORDS_FORMAT = "robot.completions.keywords.format"
OPTION_ROBOT_COMPLETION_KEYWORDS_FORMAT_FIRST_UPPER = "First upper"
OPTION_ROBOT_COMPLETION_KEYWORDS_FORMAT_TITLE = "Title Case"
OPTION_ROBOT_COMPLETION_KEYWORDS_FORMAT_ALL_LOWER = "all lower"
OPTION_ROBOT_COMPLETION_KEYWORDS_FORMAT_ALL_UPPER = "ALL UPPER"


OPTION_ROBOT_PYTHONPATH = "robot.pythonpath"

OPTION_ROBOT_WORKSPACE_SYMBOLS_ONLY_FOR_OPEN_DOCS = (
    "robot.workspaceSymbolsOnlyForOpenDocs"
)

OPTION_ROBOT_COMPLETION_SECTION_HEADERS_FORM = "robot.completions.section_headers.form"
OPTION_ROBOT_COMPLETION_SECTION_HEADERS_FORM_PLURAL = "plural"
OPTION_ROBOT_COMPLETION_SECTION_HEADERS_FORM_SINGULAR = "singular"
OPTION_ROBOT_COMPLETION_SECTION_HEADERS_FORM_BOTH = "both"

# Options which must be set as environment variables.
ENV_OPTION_ROBOT_DAP_TIMEOUT = "ROBOT_DAP_TIMEOUT"


ALL_ROBOT_OPTIONS = frozenset(
    (
        OPTION_ROBOT_PYTHON_EXECUTABLE,
        OPTION_ROBOT_PYTHON_ENV,
        OPTION_ROBOT_LANGUAGE_SERVER_TCP_PORT,
        OPTION_ROBOT_LANGUAGE_SERVER_ARGS,
        OPTION_ROBOT_VARIABLES,
        OPTION_ROBOT_LINT_ROBOCOP_ENABLED,
        OPTION_ROBOT_PYTHONPATH,
        OPTION_ROBOT_COMPLETION_SECTION_HEADERS_FORM,
        OPTION_ROBOT_WORKSPACE_SYMBOLS_ONLY_FOR_OPEN_DOCS,
        OPTION_ROBOT_COMPLETION_KEYWORDS_FORMAT,
    )
)

# NOTE: This is a copy of the settings from the language server so that we don't
# have a cyclic dependency.


class RfInterpreterRobotConfig(Config):
    ALL_OPTIONS = ALL_ROBOT_OPTIONS
