-
Notifications
You must be signed in to change notification settings - Fork 22
barebones LSP Server implementation #309
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
Conversation
020b000 to
3c8d0e5
Compare
…extension`) Here's an optimized version of your program. Main changes. - Replace slices and length-based for-loops with more direct, idiomatic Python control flow (they did nothing). - Combine checks for better early returns. - Reduce unnecessary list accesses. - Process decorator list without unnecessary nesting. - No changes to function signatures or output. All your in-code comments are preserved (there were none). **Key improvements:** - Direct mapping of `parents[0].type`; no useless range-loop. - Early exit for empty `parents`. - Avoid redundant list traversal. - Set literal for type checking. This function has the same return signature and logic, but runs faster and is easier to reason about.
⚡️ Codeflash found optimizations for this PR📄 39% (0.39x) speedup for
|
f2f394d to
cef8503
Compare
PR Reviewer Guide 🔍(Review updated until commit 89ceca8)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 89ceca8
Previous suggestionsSuggestions up to commit 3006d62
|
|
Persistent review updated to latest commit 89ceca8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Type
Enhancement
Description
Integrate LSP server for function optimization
Define LSP methods for optimization workflow
Modularize & refactor FunctionOptimizer methods
Introduce benchmark and test discovery utilities
Changes walkthrough 📝
beta.py
Implement LSP optimization endpointscodeflash/lsp/beta.py
server.py
Add custom LSP server protocol and initializationcodeflash/lsp/server.py
pyproject.tomlfor optimizerfunction_optimizer.py
Modularize FunctionOptimizer methodscodeflash/optimization/function_optimizer.py
can_be_optimizedhelper methodoptimize_functionto use new stepsoptimizer.py
Enhance Optimizer with LSP integrationcodeflash/optimization/optimizer.py
run_benchmarksanddiscover_testsprepare_module_for_optimizationhelpercreate_function_optimizersignaturepyproject.toml
Update dependencies and lint ignorepyproject.toml
pygls