Skip to content

Releases: krzysztofzablocki/Sourcery

1.4.0

14 Apr 16:46
Compare
Choose a tag to compare

Features

  • Added allImports property to Type, which returns all imports existed in all files containing this type and all its super classes/protocols.
  • Added basedTypes property to Type, which contains all Types this type inherits from or implements, including unknown (not scanned) types with extensions defined.
  • Added inference logic for basic generics from variable initialization block
  • Added newline and typed stencil tags from Sourcery Pro

Fixes

  • Fixed inferring raw value type from inherited types for enums with no cases or with associated values
  • Fixed access level of protocol members
  • Fixes parsing indirect enum cases correctly even when inline documentation is used
  • Fixes TypeName.isClosure to handle composed types correctly
  • Fixes issue where Annotations for Protocol Composition types are empty
  • Fixes sourcery:inline:auto position calculation when the file contains UTF16 characters
  • Fixes sourcery:inline:auto position calculation when the file already contains code generated by Sourcery

Internal changes

  • Removes manual parsing of TypeName, only explicit parser / configuration is now used
  • Updted SwiftLint, Quick and Nible to latest versions

1.3.4

12 Mar 11:47
Compare
Choose a tag to compare

Fixes

  • isClosure / isArray / isTuple / isDictionary should now consistently report correct values, this code broke in few cases in 1.3.2
  • Trivia (comments etc) will be ignored when parsing attribute description

1.3.3

10 Mar 14:04
Compare
Choose a tag to compare

Fixes

  • Fixes information being lost when extending unknown type more than once
  • Multiple configuration files can be now passed through command line arguments

Templates

  • AutoEquatable will use type.accessLevel for it's function, closes #675

Internal changes

  • If you are using .swifttemplate in your configuration you might notice performance degradation, this is due to new composer added in 1.3.2 that can create memory graph cycles between AST with which our current persistence doesn't deal properly, to workaround this we need to perform additional work for storing copy of parsed AST and compose it later on when running SwiftTemplates. This will be fixed in future release when AST changes are brought in, if you notice too much of a performance drop you can just switch to 1.3.1.

1.3.2

07 Mar 07:13
Compare
Choose a tag to compare

New Features

  • Configuration file now supports multiple configurations at once

Fixes

  • When resolving extensions inherit their access level for methods/subscripts/variables and sub-types fixes #910
  • When resolving Parent.ChildGenericType properly parses generic information

Internal changes

  • Faster composing phase

1.3.1

04 Mar 07:54
Compare
Choose a tag to compare

libSyntax is now bundled with library to avoid incorrect system version being used

1.3.0

03 Mar 12:02
Compare
Choose a tag to compare

Internal changes

  • Sourcery is now using SwiftSyntax not SourceKit
  • Performance is significantly improved
  • Memory usage for common case (cached) is drastically lowered

Configuration changes

  • added logAST that will cause AST warnings and errors to be logged, default false
  • added logBenchmarks that will cause benchmark informations to be logged, default false

AST Data Changes

  • initializers are now considered as static method not instance
  • typealiases and protocol compositions now provide proper accessLevel
  • if a tuple arguments are unnamed their name will be automatically set to index
  • default accessLevel when not provided in code is internal everywhere
  • Added modifiers to everything that had attributes and split them across, in sync with Swift naming
  • block annotations will be applied to associated values that are inside them
  • extensions of unknown types will not have the definition module name added in their globalName property. (You can still access it via module)
  • if you had some weird formatting around syntax declarations (newlines in-between etc) the AST data should be cleaned up rather than trying to reproduce that style
  • Imports are now proper types, with additional information
  • Protocol now has genericRequirements, it will also inherit associatedType from it's parent if it's not present
  • Single value tuples will be automatically unwrapped when parsing

Attributes

  • Attributes are now of stored in dictionary of arrays [String: [Attribute]] since you can have multiple attributes of the same name e.g. @available
  • Name when not named will be using index same as associated value do e.g. objc(name) will have 0: name as argument
  • spaces will no longer be replaced with _

Troubleshooting

  • If you want to use Sourcery as framework you'll need to use SPM integration since SwiftSyntax doesn't have Podspec
  • If you run into dylib issue it means your Xcode isn't in default location, simple symlink should work

1.2.1

16 Feb 14:30
Compare
Choose a tag to compare
update internal boilerplate code.

1.2.0

13 Feb 16:49
Compare
Choose a tag to compare

New Features

  • Self reference is resolved to correct type. Enchancement Request
  • Sourcery will now attempt to resolve local type names across modules when it can be done without ambiguity. Previously we only supported fully qualified names. Enchancement Request

1.1.1

09 Feb 15:42
Compare
Choose a tag to compare
  • Updates StencilSwiftKit to 2.8.0

1.1.0

07 Feb 18:25
Compare
Choose a tag to compare

New Features

  • PR Methods, Variables and Subscripts are now uniqued in all accessors:
    • methods and allMethods
    • variables and allVariables
    • subscripts and allSubscripts
    • New accessor is introduced that doesn't get rid of duplicates rawMethods, rawVariables, rawSubscriptss.
    • The deduping process works by priority order (highest to lowest):
      • base declaration
      • inheritance
      • protocol conformance
      • extensions