From b59846411d4325b807ab10940e8bc82d4a64a655 Mon Sep 17 00:00:00 2001 From: Yigitcan Yurtsever Date: Tue, 18 Feb 2020 19:32:15 -0800 Subject: [PATCH 1/2] Update method indentation for multiple lines --- src/template/snippet.pug | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/template/snippet.pug b/src/template/snippet.pug index 0ab216a..870d559 100644 --- a/src/template/snippet.pug +++ b/src/template/snippet.pug @@ -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) | | | \ No newline at end of file From fcca7d87389ae53a6705e476f024618478625bea Mon Sep 17 00:00:00 2001 From: Yigitcan Yurtsever Date: Tue, 18 Feb 2020 20:02:16 -0800 Subject: [PATCH 2/2] Update snapshots --- test/__snapshots__/index.test.ts.snap | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/test/__snapshots__/index.test.ts.snap b/test/__snapshots__/index.test.ts.snap index 29dbe91..c32c028 100644 --- a/test/__snapshots__/index.test.ts.snap +++ b/test/__snapshots__/index.test.ts.snap @@ -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() @@ -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)", } `;