diff --git a/.serena/project.yml b/.serena/project.yml index 62e6c5c8..004546bd 100644 --- a/.serena/project.yml +++ b/.serena/project.yml @@ -146,3 +146,7 @@ language_backend: # list of regex patterns which, when matched, mark a memory entry as read‑only. # Extends the list from the global configuration, merging the two lists. read_only_memory_patterns: [] + +# line ending convention for file writes: unset (use global setting, "lf", "crlf", or "native" (platform default) +# If not undefined, overrides the global setting in serena_config.yml +line_ending: diff --git a/src/serena/config/serena_config.py b/src/serena/config/serena_config.py index 7daf3922..d8e10a65 100644 --- a/src/serena/config/serena_config.py +++ b/src/serena/config/serena_config.py @@ -591,11 +591,6 @@ class SerenaConfig(SharedConfig): jetbrains_plugin_server_address: str = "127.0.0.1" tool_timeout: float = DEFAULT_TOOL_TIMEOUT - language_backend: LanguageBackend = LanguageBackend.LSP - """ - the language backend to use for code understanding features - """ - token_count_estimator: str = RegisteredTokenCountEstimator.CHAR_COUNT.name """Only relevant if `record_tool_usage` is True; the name of the token count estimator to use for tool usage statistics. See the `RegisteredTokenCountEstimator` enum for available options. @@ -628,9 +623,13 @@ class SerenaConfig(SharedConfig): """ # settings with overridden defaults + language_backend: LanguageBackend = LanguageBackend.LSP + """ + the language backend to use for code understanding features + """ default_modes: Sequence[str] | None = ("interactive", "editing") - symbol_info_budget: float = 10.0 line_ending: LineEnding = LineEnding.NATIVE + symbol_info_budget: float = 10.0 """ Time budget (seconds) for requests when tools request include_info (currently only supported for LSP-based tools). @@ -783,11 +782,12 @@ class SerenaConfig(SharedConfig): instance.language_backend = language_backend # determine line ending - line_ending = get_dataclass_default(SerenaConfig, "line_ending") line_ending_value = loaded_commented_yaml.get("line_ending") if line_ending_value: - line_ending = LineEnding.from_str(line_ending_value) - instance.line_ending = line_ending + instance.line_ending = LineEnding.from_str(line_ending_value) + else: + num_migrations += 1 + instance.line_ending = get_dataclass_default(SerenaConfig, "line_ending") # migrate deprecated "gui_log_level" field if necessary if "gui_log_level" in loaded_commented_yaml: diff --git a/src/serena/resources/project.template.yml b/src/serena/resources/project.template.yml index 5273b5b6..b5b55d86 100644 --- a/src/serena/resources/project.template.yml +++ b/src/serena/resources/project.template.yml @@ -31,8 +31,10 @@ languages: ["python"] # For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings encoding: "utf-8" -# line ending convention for file writes: "lf", "crlf", or "native" (platform default) -line_ending: "native" +# line ending convention to use when writing source files. +# Possible values: unset (use global setting), "lf", "crlf", or "native" (platform default) +# This does not affect Serena's own files (e.g. memories and configuration files), which always use native line endings. +line_ending: # The language backend to use for this project. # If not set, the global setting from serena_config.yml is used. diff --git a/src/serena/resources/serena_config.template.yml b/src/serena/resources/serena_config.template.yml index cc3f3ffd..0c4a6d38 100644 --- a/src/serena/resources/serena_config.template.yml +++ b/src/serena/resources/serena_config.template.yml @@ -7,9 +7,10 @@ # in your IDE). language_backend: LSP -# line ending convention for file writes across all projects. +# line ending convention to use when writing source files. # Possible values: "lf" (Unix), "crlf" (Windows), "native" (platform default). -# Can be overridden per project in project.yml. +# Note that Serena's own files (e.g. memories and configuration files) always use native line endings. +# This setting can be overridden on a per-project basis in project.yml files. line_ending: native # whether to open a graphical window with Serena's logs.