Skip to content

Commit

Permalink
fix: crash on xcode 8. Xcode-Snippets/Objective-C#60
Browse files Browse the repository at this point in the history
  • Loading branch information
柱石 committed Nov 24, 2016
1 parent 44f1940 commit b49bc48
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/xcodesnippet/commands/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,17 @@ def extract_front_matter!
when ".mm" then "Xcode.SourceCodeLanguage.Objective-C++"
else ""
end
@snippet.title = front_matter["title"] || ""
@snippet.summary = front_matter["summary"] || ""
@snippet.completion_scopes = [front_matter["completion-scope"]] || front_matter["completion-scopes"] || "All"
@snippet.identifier = SecureRandom.uuid().upcase
@snippet.title = front_matter["title"] || @snippet.completion_prefix
@snippet.summary = front_matter["summary"] || @snippet.completion_prefix
if front_matter["completion-scope"]
@snippet.completion_scopes = [front_matter["completion-scope"]]
elsif(front_matter["completion-scopes"])
@snippet.completion_scopes = front_matter["completion-scopes"]
else
@snippet.completion_scopes = "All"
end
@snippet.identifier = @snippet.completion_prefix
@snippet.is_user_snippet = true
@snippet.version = 0
@snippet.version = 2
end
end

0 comments on commit b49bc48

Please sign in to comment.