Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

Fixed Xcode crash involving "completion-scope" #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,46 @@ $ gem install xcodesnippet

## Usage

### Example

#### Sourcefile.swift

```swift
---
title: "Hello, World!"
summary: "Prints 'Hello World'"
completion-scope: Function or Method
completion-scopes:
- CodeBlock
---

println("Hello, World!")
```

#### Terminal Command
### Completion Scopes

#### Objective-C

* `ClassImplementation`
* `CodeExpression`
* `Preprocessor`
* `ClassInterfaceVariables`
* `All`
* `TopLevel`
* `ClassInterfaceMethods`
* `CodeBlock`
* `StringOrComment`

#### Swift

* `TopLevel`
* `ClassImplementation`
* `CodeBlock`
* `All`
* `CodeExpression`
* `StringOrComment`


### Terminal Command

```
$ xcodesnippet install path/to/source.m
Expand Down
2 changes: 1 addition & 1 deletion lib/xcodesnippet/commands/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def extract_front_matter!
end
@snippet.title = front_matter["title"] || ""
@snippet.summary = front_matter["summary"] || ""
@snippet.completion_scopes = [front_matter["completion-scope"]] || front_matter["completion-scopes"] || "All"
@snippet.completion_scopes = front_matter["completion-scopes"] || 'All'
@snippet.identifier = SecureRandom.uuid().upcase
@snippet.is_user_snippet = true
@snippet.version = 0
Expand Down