Skip to content

Conversation

@sund4nce
Copy link

Migrated to Swift 4 for a new project.
Thought it might be useful some others as well.

Thanks a lot for you contributions & fixes @alehed!

@sund4nce sund4nce changed the title SyntaxKit - Swift 4 fixes Swift 4 version Aug 20, 2017
@alehed
Copy link
Owner

alehed commented Aug 21, 2017

Thanks a lot @Mort3m !

This will be merged as soon as the GM Seed comes out. For the meantime you can fix the remaining issues with indentation. As stated in the .editorconfig this project uses four spaces for indentation.

Copy link
Owner

@alehed alehed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't see if the whitespace diff is from using tabs instead of spaces or just indenting with one space less than usual.


open func attributedString(for string: String, base: Attributes? = nil) -> NSAttributedString {
let output = NSMutableAttributedString(string: string, attributes: base)
let output = NSMutableAttributedString(string: string, attributes: base)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 8 spaces instead of seven.

continue
}
let range = result.rangeAt(Int(index))
let range = result.range(at: Int(index))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here (missing space).


if let value = setting.removeValue(forKey: "foreground") as? String {
setting[NSForegroundColorAttributeName] = Color(hex: value)
if let value = setting.removeValue(forKey: NSAttributedStringKey(rawValue: "foreground")) as? String {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a missing space


public var backgroundColor: Color {
return attributes[Language.globalScope]?[NSBackgroundColorAttributeName] as? Color ?? Color.white
return attributes[Language.globalScope]?[NSAttributedStringKey.backgroundColor] as? Color ?? Color.white
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another missing space


public var foregroundColor: Color {
return attributes[Language.globalScope]?[NSForegroundColorAttributeName] as? Color ?? Color.black
return attributes[Language.globalScope]?[NSAttributedStringKey.foregroundColor] as? Color ?? Color.black
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too.


if let value = setting.removeValue(forKey: "background") as? String {
setting[NSBackgroundColorAttributeName] = Color(hex: value)
if let value = setting.removeValue(forKey: NSAttributedStringKey(rawValue: "background")) as? String {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last one

@sund4nce
Copy link
Author

Alright @alehed, I will take care of it!

Copy link
Owner

@alehed alehed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two more lines still contain tabs (53 and 57).

@alehed
Copy link
Owner

alehed commented Aug 21, 2017

Great, thanks! As mentioned, this will be merged as soon as the GM Seed is released by Apple, which is probably going to happen sometime in September.

Unfortunately, there is currently no editor-config plugin that works in Xcode…

@alehed alehed merged commit 802de65 into alehed:master Sep 13, 2017
@alehed
Copy link
Owner

alehed commented Sep 13, 2017

@Mort3m Thanks a lot for the contribution! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants