profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/jakepetroules/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Jake Petroules jakepetroules @Apple San Francisco Bay Area http://www.jakepetroules.com/ Software Engineer at Apple, working on Xcode and build systems.

bdkjones/CodeKit2 101

CodeKit 2 Beta

jakepetroules/littlebirdy 45

PDF password removal utility

jakepetroules/wherefrom 29

Displays the URL a file was downloaded from by reading OS X extended file attributes.

jakepetroules/Filesystem 9

Simple app for iOS, macOS, tvOS, and watchOS that detects whether the filesystem is APFS or HFS

lunarcloud/qt-enhanced-project-template 3

Qt project template wizard for starting new projects that are deployable and cross-platform. A great way to jumpstart a project.

jakepetroules/Amalgamate 2

C library and GUI application for creating and editing Apple .DS_Store files (work in progress)

jakepetroules/owlmail 2

This is an application for Keene State College (www.keene.edu) students to receive near real-time alerts when they receive emails. As KSC uses the CampusCruiser system, it is not possible to use regular email clients such as Microsoft Outlook and Mozilla Thunderbird, so this provides a solution. KSC Email Tracker allows the user to enter his or her MyKSC username and password in the options dialog. The program will use the credentials to automatically log the user in to the MyKSC email system. Every 60 seconds, the program will check the user’s inbox, and will pop up a small dialog in the lower right hand corner of the screen to notify the user that an email message has arrived. The program can also be set not to display alerts for certain individual messages. This can be useful if a user wants to leave messages in the unread state but not be continually alerted about them. Additionally, the Windows version of the application allows users to set the program to start up with their computer so that it is always on.

jakepetroules/usbcreator 2

Bootable USB creation tool for macOS

msorvig/qt-osx-testbench 2

Testing embedding of raster, OpenGL and Qt Quick windows

jakepetroules/jakes-3d-mmo 1

Foundations of a toy 3D MMORPG that I wrote around 2007 or 2008

Pull request review commentapple/swift-evolution

Fix typos in SE-0309

 func test(_ collection: RandomAccessCollection) { ``` ___ -This way, a protocol or protocol extension member (method/property/subscript/initializer) may be used on an existential value iff the following criteria hold:+This way, a protocol or protocol extension member (method/property/subscript/initializer) may be used on an existential value if and only if the following criteria hold: * The type of the invoked member (accessor — for storage declarations), as viewed in context of the *base type*, must **not** contain references to `Self` or `Self`-rooted associated types in [non-covariant](https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)) position.

While examining this section, I found the sentence structure here a bit hard to parse. I suggest we reverse the wording for easier understanding, which then also mirrors the outlined limitations above

This way, a protocol or protocol extension member (method/property/subscript/initializer) may be used on an existential value *unless*:
* The type of the invoked member (accessor — for storage declarations), as viewed in context of the *base type*, contains references to `Self` or `Self`-rooted associated types in [non-covariant](https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)) position.

Feel free to discard this suggestion if you think it's not necessary.

hybridcattt

comment created time in an hour

PR opened apple/swift-syntax

Make tokens public

Waiting for #268 to be merged

+127 -127

0 comment

2 changed files

pr created time in 2 hours

Pull request review commentapple/swift-evolution

Fix typos in SE-0309

 func test(_ collection: RandomAccessCollection) { ``` ___ -This way, a protocol or protocol extension member (method/property/subscript/initializer) may be used on an existential value iff the following criteria hold:+This way, a protocol or protocol extension member (method/property/subscript/initializer) may be used on an existential value if the following criteria hold:

Updated to use the spelled out version. From the context it seems intentional and not a typo.

hybridcattt

comment created time in 2 hours

Pull request review commentapple/swift-syntax

Add Buildable gyb

+%{+  from gyb_syntax_support import *+  from gyb_syntax_support.kinds import lowercase_first_word+  from gyb_syntax_support.kinds import SYNTAX_BASE_KINDS+  # -*- mode: Swift -*-+  # Ignore the following admonition it applies to the resulting .swift file only++  def syntax_buildable_child_type(syntax_kind, is_token=False, is_optional=False):+    if syntax_kind in SYNTAX_BASE_KINDS:+      buildable_type = syntax_kind + 'Buildable'+    elif not is_token:+      buildable_type = syntax_kind+    elif 'List' in syntax_kind:+      buildable_type = syntax_kind + 'Syntax'+    else:+      buildable_type = 'TokenSyntax'++    if is_optional:+      buildable_type += '?'++    return buildable_type+}%+//// Automatically Generated From DeclBuildables.swift.gyb.+//===----------------------------------------------------------------------===//+//+// This source file is part of the Swift.org open source project+//+// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors+// Licensed under Apache License v2.0 with Runtime Library Exception+//+// See https://swift.org/LICENSE.txt for license information+// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors+//+//===----------------------------------------------------------------------===//++import SwiftSyntax++// MARK: Protocols++% for kind in SYNTAX_BASE_KINDS:+%   if kind != 'SyntaxCollection':+%     build_kind = 'Syntax' if kind == 'Syntax' else kind + 'Syntax'+%     if kind == 'Syntax':+public protocol ${kind}ListBuildable {+%     else:+public protocol ${kind}ListBuildable: SyntaxListBuildable {+%     end+  func build${kind}List(format: Format, leadingTrivia: Trivia?) -> [${build_kind}]

Would some documentation like this help?

  /// Builds list of `${kind}`s
  /// - Parameter format: The `Format` to use.
  /// - Parameter leadingTrivia: Replaces the the last leading trivia if not nil.
kimdv

comment created time in 2 hours

pull request commentapple/swift

[cmake] [unittests] include googletest headers to Xcode project header search paths

Hum, interesting ... this could potentially fix the problem people were having https://forums.swift.org/t/gtest-gtest-h-not-found-in-typeref-cpp-while-compiling-the-compiler/44399 ?

rollmind

comment created time in 2 hours

push eventapple/swift

Luciano Almeida

commit sha ddeb1929c47b4ac5f88473ce36471941ffbbb4b2

[DiagnosticQol][SR-14505] Use DeclDescriptive kind in missing return data flow diagnostics (#36952) * [Diagnostics] Use DeclDescriptiveKind on data flow diagnostics to improve diagnostic message * [tests] Add regression tests to SILOptimizer/return.swift * [tests] Adapt other tests to changes of SR-14505 * [Diagnostics] Adapt message for missing return diagnostics, remove article * [Diagnostics] Adapt message for missing return diagnostics to have a note with fix * [tests] Adjust tests in validation suit

view details

swift_jenkins

commit sha 752948a9fe6b291aa86f2e9010c14997a7c6ed9d

Merge remote-tracking branch 'origin/main' into next

view details

push time in 2 hours

push eventapple/swift-syntax

Kim de Vos

commit sha 87b17c3512b18dcbed6a49749dec669aebf22ebd

Fix typo

view details

Alex Hoppen

commit sha 2ce4a331f948aaff6febdc9c9f0a082b85dbebb8

Merge pull request #275 from kimdv/kimdv/fix-typo Fix typo

view details

push time in 2 hours

PR merged apple/swift-syntax

Fix typo

Fixes a small typo

+192 -192

2 comments

2 changed files

kimdv

pr closed time in 2 hours

push eventapple/swift

Luciano Almeida

commit sha ddeb1929c47b4ac5f88473ce36471941ffbbb4b2

[DiagnosticQol][SR-14505] Use DeclDescriptive kind in missing return data flow diagnostics (#36952) * [Diagnostics] Use DeclDescriptiveKind on data flow diagnostics to improve diagnostic message * [tests] Add regression tests to SILOptimizer/return.swift * [tests] Adapt other tests to changes of SR-14505 * [Diagnostics] Adapt message for missing return diagnostics, remove article * [Diagnostics] Adapt message for missing return diagnostics to have a note with fix * [tests] Adjust tests in validation suit

view details

push time in 2 hours

PR merged apple/swift

[DiagnosticQol][SR-14505] Use DeclDescriptive kind in missing return data flow diagnostics

<!-- What's in this pull request? --> Separate closure and declaration on diagnoseMissingReturn data flow diagnostics and use better descriptive naming.

<!-- If this pull request resolves any bugs in the Swift bug tracker, provide a link: --> Resolves SR-14505.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+124 -58

11 comments

9 changed files

LucianoPAlmeida

pr closed time in 2 hours

push eventqt/qtmqtt

Qt Submodule Update Bot

commit sha ae984e093e57f2d157a46634117ca86f6885e281

Update dependencies on '6.1' in qt/qtmqtt Change-Id: Ide7cb0a72f00b101ea5a10165e1a1bcf65b2d047 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>

view details

push time in 2 hours

pull request commentapple/swift

[cmake] [unittests] include googletest headers to Xcode project header search paths

@varungandhi-apple check please, and thank you.

rollmind

comment created time in 2 hours

PR opened apple/swift

[cmake] [unittests] include googletest headers to Xcode project header search paths

add target include directories on AddSwiftUnittests.cmake module. currently generated Xcode project doesn't include googletest headers after https://reviews.llvm.org/D86616

+3 -0

0 comment

1 changed file

pr created time in 2 hours

push eventqt/qtcoap

Qt Submodule Update Bot

commit sha 2450389daeccb2b03bde4df7f972c7699f6b6cee

Update dependencies on '6.1' in qt/qtcoap Change-Id: Ida500da639c07351b48f6b817a9ea2b8feffe65c Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>

view details

push time in 2 hours

Pull request review commentapple/swift

[DNM] Lift the 'Self or associated type' restriction

 bool ASTContext::isASCIIString(StringRef s) const {   }   return true; }++/// Classify usages of Self in the given type.+///+/// \param position The position we are currently at, in terms of variance.+static SelfReferenceInfo+findExistentialSelfReferences(GenericSignature existentialSig, Type type,+                              SelfReferencePosition position) {+  // If there are no type parameters, we're done.+  if (!type->hasTypeParameter())+    return SelfReferenceInfo();++  // Tuples preserve variance.+  if (auto tuple = type->getAs<TupleType>()) {+    auto info = SelfReferenceInfo();+    for (auto &elt : tuple->getElements()) {+      info |= findExistentialSelfReferences(existentialSig, elt.getType(),+                                            position);+    }++    // A covariant Self result inside a tuple will not be bona fide.+    info.hasCovariantSelfResult = false;++    return info;+  }++  // Function preserve variance in the result type, and flip variance in+  // the parameter type.+  if (auto funcTy = type->getAs<AnyFunctionType>()) {+    auto inputInfo = SelfReferenceInfo();+    for (auto param : funcTy->getParams()) {+      // inout parameters are invariant.+      if (param.isInOut()) {+        inputInfo |=+            findExistentialSelfReferences(existentialSig, param.getPlainType(),+                                          SelfReferencePosition::Invariant);+        continue;+      }+      inputInfo |= findExistentialSelfReferences(+          existentialSig, param.getParameterType(), position.flipped());+    }++    // A covariant Self result inside a parameter will not be bona fide.+    inputInfo.hasCovariantSelfResult = false;++    auto resultInfo = findExistentialSelfReferences(+        existentialSig, funcTy->getResult(), position);+    if (resultInfo.selfRef == SelfReferencePosition::Covariant) {+      resultInfo.hasCovariantSelfResult = true;+    }+    return inputInfo |= resultInfo;+  }++  // Metatypes preserve variance.+  if (auto metaTy = type->getAs<MetatypeType>()) {+    return findExistentialSelfReferences(existentialSig,+                                         metaTy->getInstanceType(), position);+  }++  // Optionals preserve variance.+  if (auto optType = type->getOptionalObjectType()) {+    return findExistentialSelfReferences(existentialSig, optType, position);+  }++  // DynamicSelfType preserves variance.+  // FIXME: This shouldn't ever appear in protocol requirement+  // signatures.+  if (auto selfType = type->getAs<DynamicSelfType>()) {+    return findExistentialSelfReferences(existentialSig,+                                         selfType->getSelfType(), position);+  }++  // Bound generic types are invariant.+  if (auto boundGenericType = type->getAs<BoundGenericType>()) {

Special-case covariance is already implemented on the main branch. This branch needs a rebase.

theblixguy

comment created time in 2 hours

pull request commentapple/swift

[SourceKit] Add locations for symbols in external modules

Artem ended up making it compile-able in older compilers, so should hopefully work this time 🤞

@swift-ci please build toolchain macOS platform

bnbarham

comment created time in 3 hours

Pull request review commentapple/swift-evolution

Fix typos in SE-0309

 func test(_ collection: RandomAccessCollection) { ``` ___ -This way, a protocol or protocol extension member (method/property/subscript/initializer) may be used on an existential value iff the following criteria hold:+This way, a protocol or protocol extension member (method/property/subscript/initializer) may be used on an existential value if the following criteria hold:

"iff" was removed from public API documentation: apple/swift#27115

hybridcattt

comment created time in 3 hours

Pull request review commentapple/swift-evolution

Fix typos in SE-0309

 func test(_ collection: RandomAccessCollection) { ``` ___ -This way, a protocol or protocol extension member (method/property/subscript/initializer) may be used on an existential value iff the following criteria hold:+This way, a protocol or protocol extension member (method/property/subscript/initializer) may be used on an existential value if the following criteria hold:

TIL - I've never seen it shortened like that before (having studied math in another language). Would you agree that it'd be clearer, if it's spelled out fully?

hybridcattt

comment created time in 3 hours

Pull request review commentapple/swift-syntax

Add Buildable gyb

+%{+  from gyb_syntax_support import *+  from gyb_syntax_support.kinds import lowercase_first_word+  from gyb_syntax_support.kinds import SYNTAX_BASE_KINDS+  # -*- mode: Swift -*-+  # Ignore the following admonition it applies to the resulting .swift file only++  def syntax_buildable_child_type(type_name, syntax_kind, is_token, is_optional=False):+    if syntax_kind in SYNTAX_BASE_KINDS:+      buildable_type = syntax_kind + 'Buildable'+    elif not is_token:+      buildable_type = syntax_kind+    else:+      buildable_type = type_name++    if is_optional:+      buildable_type += '?'++    return buildable_type+}%+//// Automatically Generated From DeclBuildables.swift.gyb.+//===----------------------------------------------------------------------===//+//+// This source file is part of the Swift.org open source project+//+// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors+// Licensed under Apache License v2.0 with Runtime Library Exception+//+// See https://swift.org/LICENSE.txt for license information+// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors+//+//===----------------------------------------------------------------------===//++import SwiftSyntax++// MARK: Protocols++% for kind in SYNTAX_BASE_KINDS:+%   if kind != 'SyntaxCollection':+%     build_kind = 'Syntax' if kind == 'Syntax' else kind + 'Syntax'+%     if kind == 'Syntax':+public protocol ${kind}ListBuildable {+%     else:+public protocol ${kind}ListBuildable: SyntaxListBuildable {+%     end+  func build${kind}List(format: Format, leadingTrivia: Trivia?) -> [${build_kind}]+}++%     if kind == 'Syntax':+public protocol ${kind}Buildable: ${kind}ListBuildable {+%     else:+public protocol ${kind}Buildable: SyntaxBuildable, ${kind}ListBuildable {+%     end+  func build${kind}(format: Format, leadingTrivia: Trivia?) -> ${build_kind}+}++extension ${kind}Buildable {+%     if kind != 'Syntax':+  func build${kind}(format: Format) -> ${build_kind} {+    build${kind}(format: format, leadingTrivia: nil)+  }+%     end+  public func buildSyntax(format: Format) -> Syntax {+    buildSyntax(format: format, leadingTrivia: nil)+  }++  public func buildSyntax(format: Format, leadingTrivia: Trivia?) -> Syntax {+    Syntax(build${kind}(format: format, leadingTrivia: leadingTrivia))+  }++  public func build${kind}List(format: Format) -> [${build_kind}] {+    build${kind}List(format: format, leadingTrivia: nil)+  }++  public func build${kind}List(format: Format, leadingTrivia: Trivia?) -> [${build_kind}] {+    [build${kind}(format: format, leadingTrivia: leadingTrivia)]+  }+}++%   end+% end++// MARK: - Buildables++% for node in SYNTAX_NODES:+%   if node.is_buildable():+public struct ${node.syntax_kind}: ${node.base_kind}Buildable {

Will do it another.

kimdv

comment created time in 3 hours

pull request commentapple/swift-syntax

Add Buildable gyb

Let’s see what CI has to say about this.

https://github.com/apple/swift/pull/36726

@swift-ci Please test

kimdv

comment created time in 3 hours

Pull request review commentapple/swift-syntax

Add Buildable gyb

+import XCTest+import SwiftSyntax+import SwiftSyntaxBuilder++final class EnumCaseElementTests: XCTestCase {+  func test_enumCaseElementInit() {+    let leadingTrivia = Trivia.garbageText("␣")+    let string = SyntaxFactory.makeStringSegment("Hello World")+    let segment = StringSegment(content: string)+    let segments = StringLiteralSegments([segment])++    let stringLiteralExpr: ExprBuildable = StringLiteralExpr(openDelimiter: nil,+                                                             openQuote: SyntaxFactory.makeStringQuoteToken(),

Let’s put it in a follow-up PR before any more discussions about it come up, complicating this PR even further.

kimdv

comment created time in 3 hours

Pull request review commentapple/swift-syntax

Add Buildable gyb

+import XCTest+import SwiftSyntax+import SwiftSyntaxBuilder++final class EnumCaseElementTests: XCTestCase {+  func test_enumCaseElementInit() {+    let leadingTrivia = Trivia.garbageText("␣")+    let string = SyntaxFactory.makeStringSegment("Hello World")+    let segment = StringSegment(content: string)+    let segments = StringLiteralSegments([segment])++    let stringLiteralExpr: ExprBuildable = StringLiteralExpr(openDelimiter: nil,+                                                             openQuote: SyntaxFactory.makeStringQuoteToken(),

Should it be in this PR or another? What do you prefer?

kimdv

comment created time in 3 hours

Pull request review commentapple/swift-syntax

Add Buildable gyb

+%{+  from gyb_syntax_support import *+  from gyb_syntax_support.kinds import lowercase_first_word+  from gyb_syntax_support.kinds import SYNTAX_BASE_KINDS+  # -*- mode: Swift -*-+  # Ignore the following admonition it applies to the resulting .swift file only++  def syntax_buildable_child_type(type_name, syntax_kind, is_token, is_optional=False):+    if syntax_kind in SYNTAX_BASE_KINDS:+      buildable_type = syntax_kind + 'Buildable'+    elif not is_token:+      buildable_type = syntax_kind+    else:+      buildable_type = type_name++    if is_optional:+      buildable_type += '?'++    return buildable_type+}%+//// Automatically Generated From DeclBuildables.swift.gyb.+//===----------------------------------------------------------------------===//+//+// This source file is part of the Swift.org open source project+//+// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors+// Licensed under Apache License v2.0 with Runtime Library Exception+//+// See https://swift.org/LICENSE.txt for license information+// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors+//+//===----------------------------------------------------------------------===//++import SwiftSyntax++// MARK: Protocols++% for kind in SYNTAX_BASE_KINDS:+%   if kind != 'SyntaxCollection':+%     build_kind = 'Syntax' if kind == 'Syntax' else kind + 'Syntax'+%     if kind == 'Syntax':+public protocol ${kind}ListBuildable {+%     else:+public protocol ${kind}ListBuildable: SyntaxListBuildable {+%     end+  func build${kind}List(format: Format, leadingTrivia: Trivia?) -> [${build_kind}]+}++%     if kind == 'Syntax':+public protocol ${kind}Buildable: ${kind}ListBuildable {+%     else:+public protocol ${kind}Buildable: SyntaxBuildable, ${kind}ListBuildable {+%     end+  func build${kind}(format: Format, leadingTrivia: Trivia?) -> ${build_kind}+}++extension ${kind}Buildable {+%     if kind != 'Syntax':+  func build${kind}(format: Format) -> ${build_kind} {+    build${kind}(format: format, leadingTrivia: nil)+  }+%     end+  public func buildSyntax(format: Format) -> Syntax {+    buildSyntax(format: format, leadingTrivia: nil)+  }++  public func buildSyntax(format: Format, leadingTrivia: Trivia?) -> Syntax {+    Syntax(build${kind}(format: format, leadingTrivia: leadingTrivia))+  }++  public func build${kind}List(format: Format) -> [${build_kind}] {+    build${kind}List(format: format, leadingTrivia: nil)+  }++  public func build${kind}List(format: Format, leadingTrivia: Trivia?) -> [${build_kind}] {+    [build${kind}(format: format, leadingTrivia: leadingTrivia)]+  }+}++%   end+% end++// MARK: - Buildables++% for node in SYNTAX_NODES:+%   if node.is_buildable():+public struct ${node.syntax_kind}: ${node.base_kind}Buildable {

Yeah, would be good to use the documentation we already have. It doesn’t have to be in this PR though if you’d rather want to get this merged as soon as possible and tackle it in a follow-up PR. However you like it.

kimdv

comment created time in 3 hours

Pull request review commentapple/swift-syntax

Add Buildable gyb

+import XCTest+import SwiftSyntax+import SwiftSyntaxBuilder++final class EnumCaseElementTests: XCTestCase {+  func test_enumCaseElementInit() {+    let leadingTrivia = Trivia.garbageText("␣")+    let string = SyntaxFactory.makeStringSegment("Hello World")+    let segment = StringSegment(content: string)+    let segments = StringLiteralSegments([segment])++    let stringLiteralExpr: ExprBuildable = StringLiteralExpr(openDelimiter: nil,+                                                             openQuote: SyntaxFactory.makeStringQuoteToken(),

I didn’t realize that. I think they should definitely be public, otherwise I can’t think of what they are good for.

kimdv

comment created time in 4 hours

Pull request review commentapple/swift-syntax

Add Buildable gyb

+%{+  from gyb_syntax_support import *+  from gyb_syntax_support.kinds import lowercase_first_word+  from gyb_syntax_support.kinds import SYNTAX_BASE_KINDS+  # -*- mode: Swift -*-+  # Ignore the following admonition it applies to the resulting .swift file only++  def syntax_buildable_child_type(syntax_kind, is_token=False, is_optional=False):+    if syntax_kind in SYNTAX_BASE_KINDS:+      buildable_type = syntax_kind + 'Buildable'+    elif not is_token:+      buildable_type = syntax_kind+    elif 'List' in syntax_kind:+      buildable_type = syntax_kind + 'Syntax'+    else:+      buildable_type = 'TokenSyntax'++    if is_optional:+      buildable_type += '?'++    return buildable_type+}%+//// Automatically Generated From DeclBuildables.swift.gyb.+//===----------------------------------------------------------------------===//+//+// This source file is part of the Swift.org open source project+//+// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors+// Licensed under Apache License v2.0 with Runtime Library Exception+//+// See https://swift.org/LICENSE.txt for license information+// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors+//+//===----------------------------------------------------------------------===//++import SwiftSyntax++// MARK: Protocols++% for kind in SYNTAX_BASE_KINDS:+%   if kind != 'SyntaxCollection':+%     build_kind = 'Syntax' if kind == 'Syntax' else kind + 'Syntax'+%     if kind == 'Syntax':+public protocol ${kind}ListBuildable {+%     else:+public protocol ${kind}ListBuildable: SyntaxListBuildable {+%     end+  func build${kind}List(format: Format, leadingTrivia: Trivia?) -> [${build_kind}]+}++%     if kind == 'Syntax':+public protocol ${kind}Buildable: ${kind}ListBuildable {+%     else:+public protocol ${kind}Buildable: SyntaxBuildable, ${kind}ListBuildable {+%     end+  func build${kind}(format: Format, leadingTrivia: Trivia?) -> ${build_kind}+}++extension ${kind}Buildable {+  public func buildSyntax(format: Format, leadingTrivia: Trivia?) -> Syntax {+    Syntax(build${kind}(format: format, leadingTrivia: leadingTrivia))+  }++  public func build${kind}List(format: Format, leadingTrivia: Trivia?) -> [${build_kind}] {+    [build${kind}(format: format, leadingTrivia: leadingTrivia)]+  }+}++%   end+% end++// MARK: - Buildables++% for node in SYNTAX_NODES:+%   if node.is_buildable():+%     return_type = 'Syntax'+%     if node.base_kind != 'Syntax':+%       return_type = node.base_kind + 'Syntax'+%     end+public struct ${node.syntax_kind}: ${node.base_kind}Buildable {+%     child_params = []+%     for child in node.children:+%       param_type = syntax_buildable_child_type(child.syntax_kind, child.is_token(), child.is_optional)+%       child_params.append("%s: %s" % (child.swift_name, param_type))+%     end+%     for child_param in child_params:+  let ${child_param}+%     end++  public init(+    ${',\n    '.join(child_params)}+  ) {+%     for child in node.children:+    self.${child.swift_name} = ${child.swift_name}+%     end+  }+  +  func build${node.syntax_kind}(format: Format, leadingTrivia: Trivia?) -> ${node.syntax_kind}Syntax {+%     child_params = []+%     for child in node.children:+%       param_name = child.swift_name+%       if child.is_token() and child.requires_leading_newline:+%         param_name = param_name + '.withLeadingTrivia(.newlines(1) + format._makeIndent())'+%       elif child.syntax_kind in SYNTAX_BASE_KINDS or not child.is_token():+%         if child.is_optional:+%           param_name = param_name + "?"+%         end+%         format = 'format'+%         if child.is_indented:+%           format += '._indented()'+%         end            +%         param_name = param_name + ".build" + child.syntax_kind + "(format: " + format + ", leadingTrivia: nil)"+%       end+%       child_params.append("%s: %s" % (child.swift_name, param_name))+%     end+    let ${node.swift_syntax_kind} = SyntaxFactory.make${node.syntax_kind}(+      ${',\n      '.join(child_params)}+    )+    +    if let leadingTrivia = leadingTrivia {+      return ${node.swift_syntax_kind}+        .withLeadingTrivia(leadingTrivia)+    }++    return ${node.swift_syntax_kind}+  }++  public func build${node.base_kind}(format: Format, leadingTrivia: Trivia?) -> ${return_type} {

👍

I think it’s OK. I wouldn't object to more (I think almost nobody every objects to more good comments) but there’s nothing pressing I can think of.

kimdv

comment created time in 4 hours

Pull request review commentapple/swift-syntax

Add Buildable gyb

+%{+  from gyb_syntax_support import *+  from gyb_syntax_support.kinds import lowercase_first_word+  from gyb_syntax_support.kinds import SYNTAX_BASE_KINDS+  # -*- mode: Swift -*-+  # Ignore the following admonition it applies to the resulting .swift file only++  def syntax_buildable_child_type(syntax_kind, is_token=False, is_optional=False):+    if syntax_kind in SYNTAX_BASE_KINDS:+      buildable_type = syntax_kind + 'Buildable'+    elif not is_token:+      buildable_type = syntax_kind+    elif 'List' in syntax_kind:+      buildable_type = syntax_kind + 'Syntax'+    else:+      buildable_type = 'TokenSyntax'++    if is_optional:+      buildable_type += '?'++    return buildable_type+}%+//// Automatically Generated From DeclBuildables.swift.gyb.+//===----------------------------------------------------------------------===//+//+// This source file is part of the Swift.org open source project+//+// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors+// Licensed under Apache License v2.0 with Runtime Library Exception+//+// See https://swift.org/LICENSE.txt for license information+// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors+//+//===----------------------------------------------------------------------===//++import SwiftSyntax++// MARK: Protocols++% for kind in SYNTAX_BASE_KINDS:+%   if kind != 'SyntaxCollection':+%     build_kind = 'Syntax' if kind == 'Syntax' else kind + 'Syntax'+%     if kind == 'Syntax':+public protocol ${kind}ListBuildable {+%     else:+public protocol ${kind}ListBuildable: SyntaxListBuildable {+%     end+  func build${kind}List(format: Format, leadingTrivia: Trivia?) -> [${build_kind}]+}++%     if kind == 'Syntax':+public protocol ${kind}Buildable: ${kind}ListBuildable {+%     else:+public protocol ${kind}Buildable: SyntaxBuildable, ${kind}ListBuildable {+%     end+  func build${kind}(format: Format, leadingTrivia: Trivia?) -> ${build_kind}+}++extension ${kind}Buildable {+  public func buildSyntax(format: Format, leadingTrivia: Trivia?) -> Syntax {+    Syntax(build${kind}(format: format, leadingTrivia: leadingTrivia))+  }++  public func build${kind}List(format: Format, leadingTrivia: Trivia?) -> [${build_kind}] {+    [build${kind}(format: format, leadingTrivia: leadingTrivia)]+  }+}++%   end+% end++// MARK: - Buildables++% for node in SYNTAX_NODES:+%   if node.is_buildable():+%     return_type = 'Syntax'+%     if node.base_kind != 'Syntax':+%       return_type = node.base_kind + 'Syntax'+%     end

Yeah, looks good now that the variable definition is close to its use.

kimdv

comment created time in 4 hours

Pull request review commentapple/swift-syntax

Add Buildable gyb

+%{+  from gyb_syntax_support import *+  from gyb_syntax_support.kinds import lowercase_first_word+  from gyb_syntax_support.kinds import SYNTAX_BASE_KINDS+  # -*- mode: Swift -*-+  # Ignore the following admonition it applies to the resulting .swift file only++  def syntax_buildable_child_type(syntax_kind, is_token=False, is_optional=False):+    if syntax_kind in SYNTAX_BASE_KINDS:+      buildable_type = syntax_kind + 'Buildable'+    elif not is_token:+      buildable_type = syntax_kind+    elif 'List' in syntax_kind:+      buildable_type = syntax_kind + 'Syntax'+    else:+      buildable_type = 'TokenSyntax'++    if is_optional:+      buildable_type += '?'++    return buildable_type+}%+//// Automatically Generated From DeclBuildables.swift.gyb.+//===----------------------------------------------------------------------===//+//+// This source file is part of the Swift.org open source project+//+// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors+// Licensed under Apache License v2.0 with Runtime Library Exception+//+// See https://swift.org/LICENSE.txt for license information+// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors+//+//===----------------------------------------------------------------------===//++import SwiftSyntax++// MARK: Protocols++% for kind in SYNTAX_BASE_KINDS:+%   if kind != 'SyntaxCollection':+%     build_kind = 'Syntax' if kind == 'Syntax' else kind + 'Syntax'+%     if kind == 'Syntax':+public protocol ${kind}ListBuildable {+%     else:+public protocol ${kind}ListBuildable: SyntaxListBuildable {+%     end+  func build${kind}List(format: Format, leadingTrivia: Trivia?) -> [${build_kind}]

Ah, I see. Makes total sense. Could you add a comment describing the behaviour?

kimdv

comment created time in 4 hours

push eventqt/qtcoap

Qt Submodule Update Bot

commit sha 11d09d16b5f42c383da4642805a1cc5619dd857b

Update dependencies on '6.1.0' in qt/qtcoap Change-Id: I1236c1dc16a02f1b69175361c252bb46a4503b4b Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>

view details

push time in 4 hours

pull request commentapple/swift-corelibs-foundation

[UserDefaults.swift] - Improved readability of some codes.

cc: @stephencelis @phausler

mustafagunes

comment created time in 4 hours

issue commentsparkle-project/Sparkle

Set minimum application version for update

Optionally you could consider the "skip update" simpler and just be specific to the version skipped. In other words clicking "skip this version" would just save this specific version to an array of versions to not present to the user.

That way if an available version > current version would be presented next check, as long as it hasn't been specifically skipped. The user can get the choice to not get a specified update, but won't at the same time (unknowingly) say no to other updates they may not know about. If a user has a very old version, it might result in a lot of offers to update as skipping one will then offer the previous update next check, but that's not a bad thing in my mind and they can still skip those too (or just disable automatic checks).

If the skip choices all get reset if you manually check for updates that's great news (if that's how it works now). Then at least if users check for updates they'll be able to get access to my older updates eventually.

jhogrefe

comment created time in 4 hours