-
Notifications
You must be signed in to change notification settings - Fork 2
refactor: full code refactor and interactive venv and root directory selection #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Refactor venv manager modules to use plain tables instead of class-based inheritance. Remove the unused PythonManager base class. Update all venv manager implementations (local, poetry, pyenv) to use table-based methods and direct function calls. This simplifies the codebase and improves maintainability.
Move pyright, basedpyright, and pyrefly LSP configuration files from lsp_config to a new language_servers module. Update their update_config functions to accept python_path directly instead of virtualenv_path. Add a language_servers/init.lua to centralize LSP exports for easier management and future extensibility.
- Move logger.lua to common/logger.lua for better organization. - Refactor common/os.lua to improve Windows detection and type hints. - Refactor common/path.lua: - Add normalization support and _normalized field. - Change join to append, simplify path joining. - Improve remove_suffix logic and stat caching. - Enhance list to filter by type and return full paths. - Export Path via a callable module function.
- Move LSP integration logic to new modules: hooks.lua, lspconfig.lua, and native_lsp.lua for clearer separation of concerns. - Remove lsp_config.lua in favor of language_servers module. - Refactor setup.lua to delegate LSP setup to new modules. - Update cache, config, python, and venv modules for improved modularity, naming, and config handling. - Use common/logger.lua for logging throughout. - Add support for disabling cache and auto venv via config. - Improve environment variable handling for Darwin/Unix systems.
Introduce a modular selector system for choosing root directories and virtual environments interactively. Add support for Telescope, fzf-lua, fzf.vim, and native vim.ui as selection backends, auto-detecting the best available. Refactor add_venv and remove_venv commands to use the new selector interface for improved user experience and flexibility.
Moved all selector implementations from `selector/` to `selectors/` for better naming consistency. Updated imports and initialization logic to use the new `selectors` module. Removed the old `selector/init.lua` and added `selectors/init.lua` with a `get()` function to retrieve the available selector. This change improves code organization and clarity.
Refactored type annotations across the codebase to use plain Lua types and updated all function signatures for clarity and correctness. Removed legacy Path class and replaced with stateless functions. Ensured all config and path-related functions have accurate type declarations. This improves maintainability and type safety.
- Rename local venv manager module and references from `local` to `local_venv` for clarity and consistency. - Refactor all venv manager modules to use `M` instead of manager-specific table names. - Change root directory selection logic to pass a list of parent paths instead of a single directory, improving user experience in selectors. - Update all selectors (fzf-lua, fzf.vim, telescope, nvim.ui) to accept and display a list of paths for root directory selection. - Add utility to list parent directories up to root, home, or git repo. - Minor prompt and code style improvements for consistency.
Replaces all instances of the 'custom_os' module import and usage with 'common_os' for consistency and clarity. Updates all affected files, including commands, hooks, python, venv, and pyenv manager modules. No functional changes introduced.
Removes the --local flag from the Poetry command that retrieves the virtualenvs.path configuration. This ensures the correct global virtualenvs path is returned, improving compatibility with different Poetry setups.
- Revise README to clarify and expand the list of user commands, including new cache-related commands. - Update configuration section to reflect new options and correct parameter names (`disable_auto_venv`, `disable_cache`). - Improve formatting and descriptions for clarity. - Minor code formatting improvements for logger messages and variable alignment.
1868003 to
54b9c78
Compare
Moved the active_virtualenv function from venv.lua to venv-lsp.lua for better encapsulation and to reduce unnecessary dependencies. Updated references to use the new implementation and removed the old function from venv.lua. This change simplifies the module interface and aligns with the intended usage pattern.
Add documentation to the `active_virtualenv` function indicating that it is useful for displaying the active Python virtual environment in the statusline. This clarifies its intended usage for users integrating virtual environment information into their editor UI.
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.
No description provided.