mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 12:15:10 +00:00
Merge branch 'main' of github.com:oraios/serena
This commit is contained in:
commit
04012486ed
5 files changed
+18
-12
No files matched your search
@@ -2,6 +2,9 @@
|
||||
|
||||
Changes prior to the next official version change will appear here.
|
||||
|
||||
* Language Servers:
|
||||
* Add further file extensions considered by the language servers for Python (.pyi), JavaScript (.jsx) and TypeScript (.tsx, .jsx)
|
||||
|
||||
# 2025-04-07
|
||||
|
||||
> **Breaking Config Changes**: make sure to set `ignore_all_files_in_gitignore`, remove `ignore_dirs`
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
07ffa48166beb0c7f20ac76dbf7724d0bca4bbb4
|
||||
@@ -0,0 +1 @@
|
||||
e766d55fd568f5313fb46796b8463097bdb9a293
|
||||
@@ -41,13 +41,13 @@ class Language(str, Enum):
|
||||
def get_source_fn_matcher(self) -> FilenameMatcher:
|
||||
match self:
|
||||
case self.PYTHON:
|
||||
return FilenameMatcher("*.py")
|
||||
return FilenameMatcher("*.py", "*.pyi")
|
||||
case self.JAVA:
|
||||
return FilenameMatcher("*.java")
|
||||
case self.TYPESCRIPT:
|
||||
return FilenameMatcher("*.ts", "*.js")
|
||||
return FilenameMatcher("*.ts", "*.js", "*.jsx", "*.tsx")
|
||||
case self.JAVASCRIPT:
|
||||
return FilenameMatcher("*.js")
|
||||
return FilenameMatcher("*.js", "*.jsx")
|
||||
case self.CSHARP:
|
||||
return FilenameMatcher("*.cs")
|
||||
case self.RUST:
|
||||
|
||||
+10
-9
@@ -56,7 +56,8 @@ class ProjectConfig(ToStringMixin):
|
||||
|
||||
if "ignore_all_files_in_gitignore" not in config_dict:
|
||||
raise SerenaConfigError(
|
||||
"`ignore_all_files_in_gitignore` key not found in project configuration. Please update your `project.yml` file."
|
||||
f"`ignore_all_files_in_gitignore` key not found in configuration of project '{project_name}'. "
|
||||
"Please update your `.yml` configuration file for this project. "
|
||||
"It is recommended to set this to `True`."
|
||||
)
|
||||
self.ignore_all_files_in_gitignore = config_dict["ignore_all_files_in_gitignore"]
|
||||
@@ -64,7 +65,7 @@ class ProjectConfig(ToStringMixin):
|
||||
# Raise errors for deprecated keys
|
||||
if "ignored_dirs" in config_dict:
|
||||
raise SerenaConfigError(
|
||||
"`ignored_dirs` key is deprecated. Please use `ignored_paths` instead."
|
||||
f"Use of `ignored_dirs` key in configuration of project '{project_name}' deprecated. Please use `ignored_paths` instead. "
|
||||
"Note that you can also set `ignore_all_files_in_gitignore` to `True`, which will be enough for most cases."
|
||||
)
|
||||
|
||||
@@ -74,15 +75,15 @@ class ProjectConfig(ToStringMixin):
|
||||
try:
|
||||
with open(yml_path, encoding="utf-8") as f:
|
||||
config_dict = yaml.safe_load(f)
|
||||
if yml_path.parent.name == cls.SERENA_MANAGED_DIR:
|
||||
project_root = yml_path.parent.parent
|
||||
project_name = project_root.name
|
||||
else:
|
||||
project_root = None
|
||||
project_name = yml_path.stem
|
||||
return cls(config_dict, project_name=project_name, project_root=project_root)
|
||||
except Exception as e:
|
||||
raise ValueError(f"Error loading project configuration from {yml_path}: {e}") from e
|
||||
if yml_path.parent.name == cls.SERENA_MANAGED_DIR:
|
||||
project_root = yml_path.parent.parent
|
||||
project_name = project_root.name
|
||||
else:
|
||||
project_root = None
|
||||
project_name = yml_path.stem
|
||||
return cls(config_dict, project_name=project_name, project_root=project_root)
|
||||
|
||||
def get_serena_managed_dir(self) -> str:
|
||||
return os.path.join(self.project_root, self.SERENA_MANAGED_DIR)
|
||||
|
||||
Reference in new issue
Block a user