Releases: krzysztofzablocki/Sourcery
Releases · krzysztofzablocki/Sourcery
1.4.0
Features
- Added
allImports
property toType
, which returns all imports existed in all files containing this type and all its super classes/protocols. - Added
basedTypes
property toType
, 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
andtyped
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
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
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 in1.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 to1.3.1
.
1.3.2
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
libSyntax is now bundled with library to avoid incorrect system version being used
1.3.0
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, defaultfalse
- added
logBenchmarks
that will cause benchmark informations to be logged, defaultfalse
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 hadattributes
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 viamodule
) - 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 inheritassociatedType
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
update internal boilerplate code.
1.2.0
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
- Updates StencilSwiftKit to 2.8.0
1.1.0
New Features
- PR Methods, Variables and Subscripts are now uniqued in all accessors:
methods
andallMethods
variables
andallVariables
subscripts
andallSubscripts
- New accessor is introduced that doesn't get rid of duplicates
rawMethods
,rawVariables
,rawSubscripts
s. - The deduping process works by priority order (highest to lowest):
- base declaration
- inheritance
- protocol conformance
- extensions