-
-
Notifications
You must be signed in to change notification settings - Fork 162
Reduce use of ComplexType.parse() to preserve rooted? information #870
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
* 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.
Looks great, thanks! Interesting side note: based on some rough benchmarks of the spec suite, this branch seems to generate |
apiology
added a commit
to apiology/solargraph
that referenced
this pull request
Apr 28, 2025
…stwide#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]>
castwide
added a commit
that referenced
this pull request
Jun 24, 2025
* 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]>
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.