Skip to content

Commit

Permalink
Merge pull request #5 from zeplin/update-method-indentation
Browse files Browse the repository at this point in the history
Update method indentation for multiple lines
  • Loading branch information
yigitcanyurtsever authored Feb 20, 2020
2 parents 38f18c8 + fcca7d8 commit 2a396fb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
11 changes: 4 additions & 7 deletions src/template/snippet.pug
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
each component, compIndex in components
| #{component.componentName}(
if component.props
if component.props.length > 1
|
|
each prop, propIndex in component.props
if component.props.length > 1
| #{" ".repeat(4)}
if component.props.length > 1 && propIndex !== 0
| #{" ".repeat(component.componentName.length + 1)}
| #{prop.name}: #{prop.type}
if propIndex !== (component.props.length -1)
if propIndex !== (component.props.length - 1)
| ,
|
| )
if compIndex !== (components.length -1)
if compIndex !== (components.length - 1)
|
|
|
22 changes: 10 additions & 12 deletions test/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ You can apply *italic*, **bold**, or \`code\` inline styles.
3. Arabic numerals
4. are the only kind supported.",
"lang": "swift",
"snippet": "Button(
title: String,
kind: Kind,
icon: UIImage?)
"snippet": "Button(title: String,
kind: Kind,
icon: UIImage?)
Button()
Expand All @@ -36,13 +35,12 @@ exports[`Connected Components - Swift Plugin Card.swift snippet creation 1`] = `
Object {
"description": "💳 This is not a gambling card! This is a cool, useful tech card!",
"lang": "swift",
"snippet": "Card(
title: String,
details: String,
imageHeader: String?,
imageSubHeader: String?,
image: UIImage?,
imagePosition: ImagePosition,
size: Size)",
"snippet": "Card(title: String,
details: String,
imageHeader: String?,
imageSubHeader: String?,
image: UIImage?,
imagePosition: ImagePosition,
size: Size)",
}
`;

0 comments on commit 2a396fb

Please sign in to comment.