mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-01 11:53:52 +08:00
feat(codexlens): add staged settings for advanced configuration and update related components
- Added new staged settings in config.py for coarse_k, lsp_depth, stage2_mode, and clustering strategy. - Updated config-handlers.ts to handle new staged settings and map environment variables. - Enhanced codexlens.json localization files for English and Chinese to include new staged settings. - Modified astgrep_js_ts_processor.py to improve import handling for named imports. - Updated JavaScript and TypeScript patterns to support new import formats. - Added tests for staged settings loading and performance benchmarks for stage-2 expansion.
This commit is contained in:
@@ -104,8 +104,52 @@ class TestConfigCascadeDefaults:
|
||||
config = Config(data_dir=temp_config_dir)
|
||||
assert config.staged_coarse_k == 200
|
||||
assert config.staged_lsp_depth == 2
|
||||
assert config.staged_stage2_mode == "precomputed"
|
||||
assert config.staged_clustering_strategy == "auto"
|
||||
assert config.staged_clustering_min_size == 3
|
||||
assert config.enable_staged_rerank is True
|
||||
assert config.cascade_coarse_k == 100
|
||||
assert config.cascade_fine_k == 10
|
||||
|
||||
def test_staged_settings_load_from_settings_json(self, temp_config_dir):
|
||||
"""load_settings should load staged.* settings when present."""
|
||||
config = Config(data_dir=temp_config_dir)
|
||||
settings = {
|
||||
"staged": {
|
||||
"coarse_k": 250,
|
||||
"lsp_depth": 3,
|
||||
"stage2_mode": "static_global_graph",
|
||||
"realtime_lsp_timeout_s": 11.0,
|
||||
"realtime_lsp_depth": 2,
|
||||
"realtime_lsp_max_nodes": 42,
|
||||
"realtime_lsp_max_seeds": 2,
|
||||
"realtime_lsp_max_concurrent": 4,
|
||||
"realtime_lsp_warmup_s": 0.5,
|
||||
"realtime_lsp_resolve_symbols": True,
|
||||
"clustering_strategy": "path",
|
||||
"clustering_min_size": 7,
|
||||
"enable_rerank": False,
|
||||
}
|
||||
}
|
||||
|
||||
settings_path = config.settings_path
|
||||
settings_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
with open(settings_path, "w", encoding="utf-8") as f:
|
||||
json.dump(settings, f)
|
||||
|
||||
with patch.object(config, "_apply_env_overrides"):
|
||||
config.load_settings()
|
||||
|
||||
assert config.staged_coarse_k == 250
|
||||
assert config.staged_lsp_depth == 3
|
||||
assert config.staged_stage2_mode == "static_global_graph"
|
||||
assert config.staged_realtime_lsp_timeout_s == 11.0
|
||||
assert config.staged_realtime_lsp_depth == 2
|
||||
assert config.staged_realtime_lsp_max_nodes == 42
|
||||
assert config.staged_realtime_lsp_max_seeds == 2
|
||||
assert config.staged_realtime_lsp_max_concurrent == 4
|
||||
assert config.staged_realtime_lsp_warmup_s == 0.5
|
||||
assert config.staged_realtime_lsp_resolve_symbols is True
|
||||
assert config.staged_clustering_strategy == "path"
|
||||
assert config.staged_clustering_min_size == 7
|
||||
assert config.enable_staged_rerank is False
|
||||
|
||||
Reference in New Issue
Block a user