Conversation
- Remove return type from TelescopePicker:new() in meta/types.lua - Add return self to picker implementations (telescope, vim_ui_select, snacks) - Fix LSP warnings while maintaining runtime compatibility - Classic.lua's super.new() pattern doesn't require explicit returns but LSP expects consistency Co-Authored-By: Claude <noreply@anthropic.com>
- Detector 클래스를 middleclass 기반으로 변경
- new_dependency_detector 제거
- dependency 검사 기능을 Detector 클래스 자체에 통합
- 모든 Manager 클래스를 middleclass로 변환
- CacheManager: setmetatable → class('CacheManager')
- EventManager: setmetatable → class('EventManager')
- PickerManager: setmetatable → class('PickerManager')
- EndpointManager: setmetatable → class('EndpointManager')
- telescope.lua의 pcall 타입 에러 수정
- 함수 래핑으로 타입 안전성 확보
- Highlighter 타입 어노테이션 정리
- 중복 제거, meta/types.lua로 통합
- meta/types.lua 업데이트
- Detector 타입 정의 수정 (initialize 메서드 반영)
- endpoint.entry에 end_column 필드 추가
…istry 제안 3 (최소 변경): - EventBus 싱글톤 구현 (lua/endpoint/core/EventBus.lua) - EventManager를 전역에서 접근 가능한 싱글톤으로 변경 - EndpointManager의 event_manager 인스턴스 제거 - EndpointManager 메서드 분해 - find() 메서드를 더 작고 명확한 단위로 분리 - _resolve_endpoints(): 캐시/스캔 로직 분리 - _should_use_cache(): 캐시 사용 여부 판단 - _update_cache_if_enabled(): 캐시 업데이트 로직 제안 2 (Facade + 독립 모듈): - FrameworkRegistry 분리 (lua/endpoint/core/FrameworkRegistry.lua) - Framework 등록/관리 로직을 독립 클래스로 분리 - 단일 책임 원칙 준수 - 명확한 API: register, unregister, get_all, detect_all 등 - Dependency Injection 추가 - EndpointManager:initialize(dependencies) 패턴 도입 - 테스트 시 Mock 객체 주입 가능 - framework_registry, cache_manager, picker_manager 주입 가능 개선 효과: - 테스트 용이성 향상 (DI 패턴) - 코드 가독성 개선 (메서드 분해) - 관심사 분리 (FrameworkRegistry) - EventManager의 독립성 확보 (싱글톤)
- Rename and move manager classes to improve organization - EndpointManager: manager/ -> root level - CacheManager -> Cache: manager/ -> core/ - EventManager -> Events: manager/ -> core/ (with static singleton pattern) - PickerManager -> PickerRegistry: manager/ -> core/ - Remove EventBus in favor of direct Events singleton usage - Fix type annotation issues - Add endpoint.Events.static class definition with [any] any for extensibility - Fix Cache._get_project_hash() gsub return value handling - Update Events to use static methods (get_instance, reset_instance, EVENT_TYPES) - Update FrameworkRegistry and PickerRegistry type definitions - Improve overall type safety and LSP support
- Update require path: endpoint.manager.EndpointManager → endpoint.EndpointManager - Update cache reference: cache_manager → cache - Remove redundant comments for cleaner test code
- Fix mock function pattern to avoid redeclaration warnings - Remove unused content variable in spring_spec.lua - Remove redundant assertion messages for cleaner code - Improve code formatting for better readability
- Fix EOF newlines in multiple files - Change plugin guard from numeric to boolean - Improve code formatting for better consistency
- Move lua/endpoint/EndpointManager.lua -> lua/endpoint/core/Endpoint.lua - Rename class from EndpointManager to Endpoint - Update init.lua to use endpoint.core.Endpoint - Update all type definitions in meta/types.lua - Update integration tests to use new naming - Remove "Manager" suffix for cleaner naming
- Update docstrings to use "endpoint" instead of "endpoint manager" - Rename event_manager variable to events for consistency - Update dotnet.lua comment to reference FrameworkRegistry
- Update EndpointManager references to Endpoint - Add FrameworkRegistry to architecture description - Fix outdated API usage examples - Update troubleshooting debug commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete architectural refactor converting the entire codebase to middleclass-based OOP structure with improved organization, cleaner naming conventions, and
better separation of concerns.
🎯 Main Goals
🏗️ Architecture Changes
File Reorganization
Before After
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
manager/EndpointManager.lua → core/Endpoint.lua
manager/CacheManager.lua → core/Cache.lua
manager/EventManager.lua → core/Events.lua (singleton)
manager/PickerManager.lua → core/PickerRegistry.lua
(new) → core/FrameworkRegistry.lua
New Directory Structure
📝 Detailed Changes
1. Middleclass OOP Conversion
Before (setmetatable pattern):
API:
Test Quality
📚 Documentation Updates
Updated doc/endpoint.txt
Before:
Check framework detection:
lua print(vim.inspect(require("endpoint.manager.EndpointManager"):new():get_detected_frameworks()))
After:
Check framework detection:
lua print(vim.inspect(require("endpoint").detect_frameworks()))
📊 Statistics
45 files changed
2,259 insertions(+)
1,335 deletions(-)
Key Files Changed
🔄 Migration Guide
For Plugin Users
No changes required! The public API remains the same:
For Plugin Developers
Import path changes:
Event access:
✨ Benefits
🎯 Commit History
952a3ba refactor: remove return type annotations from new() methods
45a7872 refactor: convert Detector and Manager classes to middleclass OOP
9f2a67e refactor: improve Manager architecture with EventBus and FrameworkRegistry
4dc0137 fix: remove duplicated get_event_manager method
dfbb601 refactor: restructure manager classes and fix type annotations
40d6a7e fix: update integration test to match refactored architecture
0b346fc refactor: improve test code quality and remove linter warnings
5e7b912 style: apply linter formatting and minor code improvements
4f2a786 refactor: rename EndpointManager to Endpoint and move to core/
5046dc4 refactor: remove remaining "manager" references from comments
cec9b97 docs: update documentation to reflect new architecture
✅ Checklist
🚀 Future Work
This refactor sets the foundation for:
📎 Related
This is a major architectural improvement with no breaking changes for end users. All existing configurations and commands work as before.