Skip to content

Commit

Permalink
Merge branch 'main' into ep/pin-to-upstream-tree-sitter-revision
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbs authored Nov 28, 2023
2 parents 48964ad + a9e6942 commit b10dc3f
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 31 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Build and Test
on:
workflow_dispatch: {}
pull_request:
branches: [ main ]
branches:
- main
paths:
- '.github/workflows/build_and_test.yml'
- 'Sources/**'
Expand All @@ -12,10 +13,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer
jobs:
build:
name: Build and test on iPhone 14
name: Build and test
runs-on: macos-13
steps:
- name: Checkout
Expand All @@ -27,10 +28,10 @@ jobs:
xcodebuild build-for-testing\
-scheme Runestone\
-sdk iphonesimulator\
-destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=17.0"
-destination "platform=iOS Simulator,name=iPhone 15 Pro,OS=latest"
- name: Test
run: |
xcodebuild test-without-building\
-scheme Runestone\
-sdk iphonesimulator\
-destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=17.0"
-destination "platform=iOS Simulator,name=iPhone 15 Pro,OS=latest"
9 changes: 5 additions & 4 deletions .github/workflows/build_example_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ name: Build Example Project
on:
workflow_dispatch: {}
pull_request:
branches: [ main ]
branches:
- main
paths:
- '.github/workflows/build_example_project.yml'
- 'Example/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer
jobs:
build:
name: Build example project for iPhone 14
name: Build example project
runs-on: macos-13
steps:
- name: Checkout
Expand All @@ -26,4 +27,4 @@ jobs:
-project Example/Example.xcodeproj\
-scheme Example\
-sdk iphonesimulator\
-destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=17.0"
-destination "platform=iOS Simulator,name=iPhone 15 Pro,OS=latest"
10 changes: 6 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: "CodeQL"
on:
push:
branches: [ "main" ]
branches:
- main
pull_request:
branches: [ "main" ]
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer
jobs:
analyze:
name: Analyze
Expand All @@ -33,7 +35,7 @@ jobs:
xcodebuild\
-scheme Runestone\
-sdk iphonesimulator\
-destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=17.0"
-destination "platform=iOS Simulator,name=iPhone 15 Pro,OS=latest"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:
group: "pages"
cancel-in-progress: true
env:
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer
jobs:
build:
runs-on: macos-13
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ui_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: UI Tests
on:
workflow_dispatch: {}
pull_request:
branches: [ main ]
branches:
- main
paths:
- '.github/workflows/ui_tests.yml'
- 'Sources/**'
Expand All @@ -12,7 +13,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer
jobs:
run_korean_tests:
name: Run Korean tests
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "TreeSitter",
"repositoryURL": "https://github.com/simonbs/tree-sitter",
"state": {
"branch": null,
"revision": "f88ae4ebe351d8aa99c31a17111607017d805118",
"version": "0.20.9-beta-1"
}
}
]
},
"version": 1
}
2 changes: 1 addition & 1 deletion Example/Example/Main/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import UIKit
final class MainViewController: UIViewController {
override var textInputContextIdentifier: String? {
// Returning a unique identifier makes iOS remember the user's selection of keyboard.
return "RunestoneExample.Main"
"RunestoneExample.Main"
}

private let contentView = MainView()
Expand Down
14 changes: 1 addition & 13 deletions Sources/Runestone/TextView/Core/TextInputStringTokenizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ final class TextInputStringTokenizer: UITextInputStringTokenizer {
}
}

override func isPosition(_ position: UITextPosition,
withinTextUnit granularity: UITextGranularity,
inDirection direction: UITextDirection) -> Bool {
super.isPosition(position, withinTextUnit: granularity, inDirection: direction)
}

override func position(from position: UITextPosition,
toBoundary granularity: UITextGranularity,
inDirection direction: UITextDirection) -> UITextPosition? {
Expand All @@ -47,12 +41,6 @@ final class TextInputStringTokenizer: UITextInputStringTokenizer {
return super.position(from: position, toBoundary: granularity, inDirection: direction)
}
}

override func rangeEnclosingPosition(_ position: UITextPosition,
with granularity: UITextGranularity,
inDirection direction: UITextDirection) -> UITextRange? {
super.rangeEnclosingPosition(position, with: granularity, inDirection: direction)
}
}

// MARK: - Lines
Expand Down Expand Up @@ -129,7 +117,7 @@ private extension TextInputStringTokenizer {
private func isPosition(_ position: UITextPosition, atParagraphBoundaryInDirection direction: UITextDirection) -> Bool {
// I can't seem to make Ctrl+A, Ctrl+E, Cmd+Left, and Cmd+Right work properly if this function returns anything but false.
// I've tried various ways of determining the paragraph boundary but UIKit doesn't seem to be happy with anything I come up with ultimately leading to incorrect keyboard navigation. I haven't yet found any drawbacks to returning false in all cases.
return false
false
}

private func position(from position: UITextPosition, toParagraphBoundaryInDirection direction: UITextDirection) -> UITextPosition? {
Expand Down
2 changes: 1 addition & 1 deletion Tests/RunestoneTests/TextInputStringTokenizerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ extension TextInputStringTokenizerTests {
private extension TextInputStringTokenizerTests {
private var sampleText: String {
// swiftlint:disable line_length
return """
"""
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras commodo pretium lorem et scelerisque. Sed urna massa, eleifend vel suscipit et, finibus ut nisi. Praesent ullamcorper justo ut lectus faucibus venenatis. Suspendisse lobortis libero sed odio iaculis, quis blandit ante accumsan.
Quisque sed hendrerit diam. Quisque ut enim ligula.
Expand Down

0 comments on commit b10dc3f

Please sign in to comment.