Skip to content

Commit a3fb310

Browse files
NSHkrNSHkr
authored andcommitted
refactor pattern matcher
1 parent 0567c49 commit a3fb310

18 files changed

Lines changed: 1439 additions & 833 deletions

File tree

config/config.exs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,30 @@ config :elixir_scope,
112112
]
113113
]
114114

115+
116+
config :elixir_scope, :pattern_matcher,
117+
# Performance settings
118+
pattern_match_timeout: 500,
119+
function_analysis_timeout: 10,
120+
max_memory_usage_mb: 100,
121+
122+
# Default confidence thresholds
123+
default_confidence_threshold: 0.7,
124+
high_confidence_threshold: 0.9,
125+
126+
# Cache settings
127+
enable_pattern_cache: true,
128+
cache_ttl_minutes: 30,
129+
130+
# Pattern library settings
131+
load_default_patterns: true,
132+
custom_pattern_paths: [],
133+
134+
# Analysis settings
135+
enable_ast_analysis: true,
136+
enable_behavioral_analysis: true,
137+
enable_anti_pattern_analysis: true,
138+
context_sensitive_matching: false
139+
115140
# Environment-specific configuration
116-
import_config "#{config_env()}.exs"
141+
import_config "#{config_env()}.exs"

config/dev.exs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,13 @@ config :elixir_scope,
4343
enable: false, # Keep disabled for now
4444
port: 4001 # Different port to avoid conflicts
4545
]
46-
]
46+
]
47+
48+
config :elixir_scope, :pattern_matcher,
49+
# More verbose logging in development
50+
log_level: :debug,
51+
enable_performance_metrics: true,
52+
53+
# Relaxed timeouts for development
54+
pattern_match_timeout: 1000,
55+
function_analysis_timeout: 50

config/test.exs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ config :elixir_scope,
4848
query_timeout: 1000 # Quick timeout for tests
4949
]
5050

51+
config :elixir_scope, :pattern_matcher,
52+
# Faster execution for tests
53+
pattern_match_timeout: 100,
54+
function_analysis_timeout: 5,
55+
56+
# Disable caching for predictable tests
57+
enable_pattern_cache: false,
58+
59+
# Test-specific settings
60+
log_level: :warning
61+
5162
# Exclude live API tests by default
5263
# To run live tests: mix test --only live_api
5364
# To include all tests: mix test --include live_api
@@ -68,4 +79,4 @@ ExUnit.configure(
6879
max_cases: 1, # Force trace mode (shows individual tests)
6980
timeout: 60_000,
7081
max_failures: :infinity
71-
)
82+
)

0 commit comments

Comments
 (0)