Skip to content

Commit

Permalink
Merge pull request #192 from jpsim/jp-xcode-7.3
Browse files Browse the repository at this point in the history
update for Xcode 7.3
  • Loading branch information
jpsim committed Mar 30, 2016
2 parents 53904a4 + 3c31959 commit 7412d87
Show file tree
Hide file tree
Showing 15 changed files with 434 additions and 370 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode7.2
osx_image: xcode7.3
git:
submodules: false
branches:
Expand Down
2 changes: 1 addition & 1 deletion Source/SourceKittenFramework/SourceLocation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public struct SourceLocation {

extension SourceLocation {
init(clangLocation: CXSourceLocation) {
var cxfile = CXFile()
var cxfile = CXFile.alloc(1)
var line: UInt32 = 0
var column: UInt32 = 0
var offset: UInt32 = 0
Expand Down
10 changes: 8 additions & 2 deletions Source/SourceKittenFramework/SwiftDeclarationKind.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/// Swift declaration kinds.
/// Found in `strings SourceKitService | grep source.lang.swift.decl.`.
public enum SwiftDeclarationKind: String {
/// `associatedtype`.
case Associatedtype = "source.lang.swift.decl.associatedtype"
/// `class`.
case Class = "source.lang.swift.decl.class"
/// `enum`.
Expand Down Expand Up @@ -51,8 +53,12 @@ public enum SwiftDeclarationKind: String {
case FunctionMethodInstance = "source.lang.swift.decl.function.method.instance"
/// `function.method.static`.
case FunctionMethodStatic = "source.lang.swift.decl.function.method.static"
/// `function.operator`.
case FunctionOperator = "source.lang.swift.decl.function.operator"
/// `function.operator.infix`.
case FunctionOperatorInfix = "source.lang.swift.decl.function.operator.infix"
/// `function.operator.postfix`.
case FunctionOperatorPostfix = "source.lang.swift.decl.function.operator.postfix"
/// `function.operator.prefix`.
case FunctionOperatorPrefix = "source.lang.swift.decl.function.operator.prefix"
/// `function.subscript`.
case FunctionSubscript = "source.lang.swift.decl.function.subscript"
/// `generic_type_param`.
Expand Down
2 changes: 1 addition & 1 deletion Source/SourceKittenFramework/SyntaxMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public struct SyntaxMap {

return commentTokensImmediatelyPrecedingOffset.first.flatMap { firstToken in
return commentTokensImmediatelyPrecedingOffset.last.map { lastToken in
return Range(start: firstToken.offset, end: lastToken.offset + lastToken.length)
return firstToken.offset...lastToken.offset + lastToken.length
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
import SourceKittenFramework
import XCTest

let fixturesDirectory = (__FILE__ as NSString).stringByDeletingLastPathComponent + "/Fixtures/"
let fixturesDirectory = (#file as NSString).stringByDeletingLastPathComponent + "/Fixtures/"

class ClangTranslationUnitTests: XCTestCase {

Expand Down
10 changes: 5 additions & 5 deletions Tests/SourceKittenFramework/Fixtures/Bicycle.json
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@
],
"key.doc.column" : 5,
"key.parsed_scope.end" : 76,
"key.usr" : "s:FC7Bicycle7BicyclecFMS0_FT5styleOS0_5Style7gearingOS0_7Gearing9handlebarOS0_9Handlebar9frameSizeSi_S0_",
"key.usr" : "s:FC7Bicycle7BicyclecFT5styleOS0_5Style7gearingOS0_7Gearing9handlebarOS0_9Handlebar9frameSizeSi_S0_",
"key.doc.file" : "Bicycle.swift",
"key.nameoffset" : 1754,
"key.annotated_decl" : "<Declaration>init(style: <Type usr=\"s:OC7Bicycle7Bicycle5Style\">Style<\/Type>, gearing: <Type usr=\"s:OC7Bicycle7Bicycle7Gearing\">Gearing<\/Type>, handlebar: <Type usr=\"s:OC7Bicycle7Bicycle9Handlebar\">Handlebar<\/Type>, frameSize centimeters: <Type usr=\"s:Si\">Int<\/Type>)<\/Declaration>",
Expand All @@ -586,7 +586,7 @@
"key.attribute" : "source.decl.attribute.__raw_doc_comment"
}
],
"key.doc.full_as_xml" : "<Function file=\"Bicycle.swift\" line=\"68\" column=\"5\"><Name>init(style:gearing:handlebar:frameSize:)<\/Name><USR>s:FC7Bicycle7BicyclecFMS0_FT5styleOS0_5Style7gearingOS0_7Gearing9handlebarOS0_9Handlebar9frameSizeSi_S0_<\/USR><Declaration>init(style: Style, gearing: Gearing, handlebar: Handlebar, frameSize centimeters: Int)<\/Declaration><Abstract><Para>Initializes a new bicycle with the provided parts and specifications.<\/Para><\/Abstract><Parameters><Parameter><Name>style<\/Name><Direction isExplicit=\"0\">in<\/Direction><Discussion><Para>The style of the bicycle<\/Para><\/Discussion><\/Parameter><Parameter><Name>gearing<\/Name><Direction isExplicit=\"0\">in<\/Direction><Discussion><Para>The gearing of the bicycle<\/Para><\/Discussion><\/Parameter><Parameter><Name>handlebar<\/Name><Direction isExplicit=\"0\">in<\/Direction><Discussion><Para>The handlebar of the bicycle<\/Para><\/Discussion><\/Parameter><Parameter><Name>centimeters<\/Name><Direction isExplicit=\"0\">in<\/Direction><Discussion><Para>The frame size of the bicycle, in centimeters<\/Para><\/Discussion><\/Parameter><\/Parameters><ResultDiscussion><Para>A beautiful, brand-new, custom built just for you.<\/Para><\/ResultDiscussion><\/Function>",
"key.doc.full_as_xml" : "<Function file=\"Bicycle.swift\" line=\"68\" column=\"5\"><Name>init(style:gearing:handlebar:frameSize:)<\/Name><USR>s:FC7Bicycle7BicyclecFT5styleOS0_5Style7gearingOS0_7Gearing9handlebarOS0_9Handlebar9frameSizeSi_S0_<\/USR><Declaration>init(style: Style, gearing: Gearing, handlebar: Handlebar, frameSize centimeters: Int)<\/Declaration><Abstract><Para>Initializes a new bicycle with the provided parts and specifications.<\/Para><\/Abstract><Parameters><Parameter><Name>style<\/Name><Direction isExplicit=\"0\">in<\/Direction><Discussion><Para>The style of the bicycle<\/Para><\/Discussion><\/Parameter><Parameter><Name>gearing<\/Name><Direction isExplicit=\"0\">in<\/Direction><Discussion><Para>The gearing of the bicycle<\/Para><\/Discussion><\/Parameter><Parameter><Name>handlebar<\/Name><Direction isExplicit=\"0\">in<\/Direction><Discussion><Para>The handlebar of the bicycle<\/Para><\/Discussion><\/Parameter><Parameter><Name>centimeters<\/Name><Direction isExplicit=\"0\">in<\/Direction><Discussion><Para>The frame size of the bicycle, in centimeters<\/Para><\/Discussion><\/Parameter><\/Parameters><ResultDiscussion><Para>A beautiful, brand-new, custom built just for you.<\/Para><\/ResultDiscussion><\/Function>",
"key.doc.name" : "init(style:gearing:handlebar:frameSize:)",
"key.substructure" : [

Expand All @@ -613,7 +613,7 @@
],
"key.doc.column" : 10,
"key.parsed_scope.end" : 88,
"key.usr" : "s:FC7Bicycle7Bicycle6travelFS0_FT8distanceSd_T_",
"key.usr" : "s:FC7Bicycle7Bicycle6travelFT8distanceSd_T_",
"key.doc.file" : "Bicycle.swift",
"key.nameoffset" : 2152,
"key.annotated_decl" : "<Declaration>func travel(distance meters: <Type usr=\"s:Sd\">Double<\/Type>)<\/Declaration>",
Expand All @@ -623,14 +623,14 @@
"key.bodyoffset" : 2185,
"key.doc.declaration" : "func travel(distance meters: Double)",
"key.name" : "travel(distance:)",
"key.typename" : "Bicycle -> (distance: Double) -> ()",
"key.typename" : "(Bicycle) -> (distance: Double) -> ()",
"key.doc.type" : "Function",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.__raw_doc_comment"
}
],
"key.doc.full_as_xml" : "<Function file=\"Bicycle.swift\" line=\"83\" column=\"10\"><Name>travel(distance:)<\/Name><USR>s:FC7Bicycle7Bicycle6travelFS0_FT8distanceSd_T_<\/USR><Declaration>func travel(distance meters: Double)<\/Declaration><Abstract><Para>Take a bike out for a spin.<\/Para><\/Abstract><Parameters><Parameter><Name>meters<\/Name><Direction isExplicit=\"0\">in<\/Direction><Discussion><Para>The distance to travel in meters.<\/Para><\/Discussion><\/Parameter><\/Parameters><\/Function>",
"key.doc.full_as_xml" : "<Function file=\"Bicycle.swift\" line=\"83\" column=\"10\"><Name>travel(distance:)<\/Name><USR>s:FC7Bicycle7Bicycle6travelFT8distanceSd_T_<\/USR><Declaration>func travel(distance meters: Double)<\/Declaration><Abstract><Para>Take a bike out for a spin.<\/Para><\/Abstract><Parameters><Parameter><Name>meters<\/Name><Direction isExplicit=\"0\">in<\/Direction><Discussion><Para>The distance to travel in meters.<\/Para><\/Discussion><\/Parameter><\/Parameters><\/Function>",
"key.doc.name" : "travel(distance:)",
"key.substructure" : [

Expand Down
Loading

0 comments on commit 7412d87

Please sign in to comment.