-
-
Notifications
You must be signed in to change notification settings - Fork 162
Library sync and cache invalidation #903
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
17194aa
to
5341745
Compare
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.
Pull Request Overview
This PR addresses improvements to library syncing and cache invalidation by updating the way source maps are merged and refreshed, as well as refining how local pins and catalog synchronization are handled. Key changes include the removal of several tests for source map merge behavior in the specs, refactoring of the source map and library code to use a sync counter instead of thread management, and adjustments to the parsing and finalization logic in source processing.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
spec/source_map_spec.rb | Removed multiple tests for merging behavior |
spec/pin/method_spec.rb | Minor stylistic changes with adjustments in test descriptions |
spec/language_server/host/message_worker_spec.rb | Update of message double construction and synchronization |
lib/solargraph/source_map/data.rb | New data wrapper for lazy generation of pins and locals |
lib/solargraph/source_map.rb | Refactored source map initialization and merging logic |
lib/solargraph/source.rb | Revised finalization and synchronization of source parsing |
lib/solargraph/pin/method.rb | Updated merging logic in nearly? method |
lib/solargraph/library.rb | Replaced thread management with a sync counter |
lib/solargraph/language_server/host/message_worker.rb | Introduced message prioritization logic in worker class |
Comments suppressed due to low confidence (1)
spec/source_map_spec.rb:74
- Removal of several tests for merging behaviors reduces coverage on source map merging functionality; consider adding replacement tests to validate that the intended merge behavior is still correctly handled.
- it "merges comment changes" do
The three major bottlenecks in library updates are source parsing, source mapping, and api_map cataloging. The top-level approach for improving them is to apply changes at the moment they're needed instead of when they're received.
|
dec92f9
to
c950ecb
Compare
* Library sync and cache invalidation * Stop sleeping in catalog threads in mingw * JIT library sync without threads * MessageWorker prioritizes messages * Unused instance variable * JIT source parsing * Fix JIT source parsing * Avoid unnecessary parsing in library * JIT source mapping * Specs * Stale code * Library#map! finds external requires * Preserve SourceMap#try_merge! * Force catalog after caching gemspecs * Synchronize count check in Library#sync_catalog
* Infer literal types and use them for signature selection * Introduce tuple type via an RBS-based fill * Use methods from the new tuple type for Array() * Hold back on representing literal strings * Resolve merge * Update spec/source_map/clip_spec.rb * Resolve merge issues * Update test expectations * [regression] Restore 'Unresolved call' typecheck for stdlib objects (#849) The 'Unresolved call to' typecheck suppresses warnings for calls against non-RBS-origin pins. However, the labeling assigning :rbs as the source of pins from conversions.rb was recently removed as part of an unrelated cleanup. * Lazy dynamic rebinding (#851) * Lazy dynamic rebinding * Stub failing test * Move rebinding to Clip * Restore fill for Class#allocate (#848) * [regression] Ensure YardMap gems have return type for Class<T>.new (#850) * [regression] Ensure YardMap gems have return type for Class<T>.new * Handle self return-type-setting at lower level * Fix bug where signature return type was based only on annotation * Create implicit .new pins in namespace method queries (#853) * Create implicit .new pins in namespace method queries * Comment for Host#locate_pins exception * Release 0.53.3 * Use logger in Solargraph::YardMap::Mapper spec * Add support for simple block argument destructuring (#821) * Add support for simple block argument destructuring * Add spec for Array<Array(String, Integer)>#each * Internal typechecking-driven annotations and code changes (#838) * Internal typechecking-driven annotations and code changes * Add @todo for predicate method return type issue * Internal typechecking-driven annotations and code changes * Benchmark the typecheck command (#852) * Enable passing tests (#854) * Send Gem Caching Progress Notifications to LSP Clients (#855) * Send gem caching notifications * LanguageServer::Progress * DRY progress notifications * Refactor * added failing tests (#573) * [breaking] Fix more complex_type_spec.rb cases (#813) * [breaking] Fix more complex_type_spec.rb cases * Consolidate the code that generates substrings to a single place * Clean up more paths to pass through 'rooted' flag unchanged * [breaking] Drop special-case interpretation of, e.g., `Array<(String)>` as 'one element tuple' for future consistency with https://yardoc.org/types * (String) is a one element tuple in https://yardoc.org/types * <String> is an array of zero or more Strings in https://yardoc.org/types * Array<(String)> could be an Array of one-element tuples or a one element tuple. https://yardoc.org/types treats it as the former. * Array<(String), Integer> is not ambiguous if we accept (String) as a tuple type, but not currently understood by Solargraph. * Close out complex_type_spec @todos for better RBS output * Simplify qualify() with transform() * Resolve merge issue * Mass assignment support - e.g., a, b = ['1', '2'] (#843) * Memoize result of Chain#infer (#857) * Memoize result of Chain#infer * Add links to cache key * Add node.location separately to cache key https://github.com/whitequark/ast/blob/master/lib/ast/node.rb https://github.com/whitequark/parser/blob/05b88aa0468ce29dfa21e1aff2f0506b1d5d82e1/lib/parser/ast/node.rb#L17 Parser::AST adds 'location' in Parser::AST::Node to its superclass AST::Node, but doesn't overwrite the #hash and #eql? methods * Fall back to using links.map(&:word) * Implement eql? and hash for ApiMap for cache coherency * Remove @cache from ApiMap#equality_fields * Remove clip caches (#860) * Add rbs_collection to maps (#858) * Fix flaky rename specs (#869) * Ignore malformed mixins and overloads (#862) * Ignore malformed mixins * Ignore malformed overload tags * Add internal type annotations needed for strict-level typechecking (#865) * Add internal type annotations needed for strict-level typechecking * Fix annotations * Add internal type annotations needed for strict-level typechecking * Fix flaky rename specs * Move to untyped as Hash value --------- Co-authored-by: Fred Snyder <[email protected]> * Drop Parser::ParserGem::ClassMethods#returns_from_node (#866) * Refactor TypeChecker#argument_problems_for for type safety (#867) * Refactor TypeChecker#argument_problems_for for type safety This should put it in a state that it can pass type checking once we have another feature or two * Editor compatibility hack * Fix class name * Fix flaky rename specs --------- Co-authored-by: Fred Snyder <[email protected]> * Specify more type behavior for variable reassignment (#863) * One-step source synchronization (#871) * One-step source synchronization * Synchronize libraries * Fix progress notification timing (#873) * Show cache progress in shell commands (#874) * Show cache progress in shell commands * Typecheck error * Update spec/source_map/clip_spec.rb * Resolve merge issues * Update test expectations * Update test expectations * Fix merge issue * Add regression test around assignment in return position * Adjust spec expectations * Fix merge * Resolve merge issue * Reduce use of ComplexType.parse() to preserve rooted? information (#870) * [breaking] Fix more complex_type_spec.rb cases * Consolidate the code that generates substrings to a single place * Clean up more paths to pass through 'rooted' flag unchanged * [breaking] Drop special-case interpretation of, e.g., `Array<(String)>` as 'one element tuple' for future consistency with https://yardoc.org/types * (String) is a one element tuple in https://yardoc.org/types * <String> is an array of zero or more Strings in https://yardoc.org/types * Array<(String)> could be an Array of one-element tuples or a one element tuple. https://yardoc.org/types treats it as the former. * Array<(String), Integer> is not ambiguous if we accept (String) as a tuple type, but not currently understood by Solargraph. * Close out complex_type_spec @todos for better RBS output * Simplify qualify() with transform() * Reduce use of ComplexType.parse() to preserve rooted? information * Make TypeMethods#rooted? more aggressive * Fix flaky rename specs * Reduce use of ComplexType.parse() to preserve rooted? information * Reduce use of ComplexType.parse() to preserve rooted? information * Fix merge issue * Fix merge issue * Use rooted_tag, remove two more parse() calls * Preserve types in attr_accessor * Reassure TypeMethods that implementers will have all_params * Add regression test around assignment in return position * Fix merge * Separate the semantics of Type#rooted? and (new) Type#all_rooted? * Test and fix issues keeping types from RBS input rooted * Handle addiitional RBS types explicitly for type safety --------- Co-authored-by: Fred Snyder <[email protected]> * Ensure yield return types are qualified (#886) * Ensure yield return types are qualified * Add regression test around assignment in return position * Understand type of 'def foo; @foo ||= bar; end' reader methods (#888) * Improvements to #inspect output on pins and chains (#895) * Remove redundant extend in Parser (#900) * Remove redundant extend in Parser * Update lib/solargraph/parser.rb Co-authored-by: Vince Broz <[email protected]> --------- Co-authored-by: Vince Broz <[email protected]> * Block method resolution improvements (#885) * Block method resolution improvements * Add regression test around assignment in return position * Fix merge issue * Fix merge issue * Understand mass assignment into instance variables (#893) * Library sync and cache invalidation (#903) * Library sync and cache invalidation * Stop sleeping in catalog threads in mingw * JIT library sync without threads * MessageWorker prioritizes messages * Unused instance variable * JIT source parsing * Fix JIT source parsing * Avoid unnecessary parsing in library * JIT source mapping * Specs * Stale code * Library#map! finds external requires * Preserve SourceMap#try_merge! * Force catalog after caching gemspecs * Synchronize count check in Library#sync_catalog * Handle super and yield scenarios from blocks (#891) * Handle super and yield scenarios from blocks * Update spec/source_map/clip_spec.rb Co-authored-by: Fred Snyder <[email protected]> --------- Co-authored-by: Fred Snyder <[email protected]> * Allow core and stdlib documentation to be uncached (#899) * Allow core and stdlib documentation to be uncached * Fix typo * Surface variable names in documentation (#910) * Surface variable names in documentation * Documentation * Keep idle progress notifications alive (#911) * Release 0.54.1 * Release 0.54.1 patch: remove mutex from Library sync_count check * Resolve generics correctly on mixin inclusion (#898) * Resolve generics correctly on mixin inclusion * Reduce expectations pending merge of another fix * Fix merge issue * Add alias-related regression test that now passes * Method alias fixes * Ensure method aliases are processed with resolve_generics() * Avoid an extra hop in get_methods() resulting in no alias resolution * Resolve merge issue * Pick correct String#split overload (#905) * Pick correct String#split overload * Look for parameter types in superclasses too when resolving overloads * Look at all unique types on parameters when resolving overloads * Add @sg-ignore * Fix type sent into YARD method (#912) While it declares itself wanting a String, in reality the YARD method takes #to_s, so this change just squashes a typechecking warning * Early CancelRequest handling (#914) * Destructure partial yield types (#915) * Dependency versions (#916) * Release 0.54.2 * Generic superclasses and defaulted type parameters via RBS Enables scenarios using typed Array<A | B |C> methods from Array(A, B, C) * Fix qualify_superclass's treatment of namespaces vs tags * Render string literals from RBS in a useful way * Treat literal nil as NilClass for method resolution and vice versa Apply same for true/TrueClass and false/FalseClass * Fix merge issue * Fix merge issue --------- Co-authored-by: Fred Snyder <[email protected]> Co-authored-by: BonitaTerror <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.