New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SourceEditorModels module #16
Conversation
minor changes
caa596f
to
d92ad9f
Compare
5a72d17
to
63a6d46
Compare
Co-authored-by: Tomás Ruiz-López <truizlop@gmail.com> Update nef-plugin/EditorError.swift result: adding discardableResult to fold
63a6d46
to
73fb91a
Compare
|
||
import Foundation | ||
|
||
enum EditorError: Int, Error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any need to make this an Int
backed enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, Xcode requires throw errors as NSError
and we need setup an error code - you can find the use in terminateError
ae88990
to
7c94905
Compare
case .exportSnippetToFile: | ||
return URLQueryItem(name: key, value: code) | ||
case .exportSnippetToClipboard: | ||
return URLQueryItem(name: key, value: code) | ||
case .markdownPage: | ||
return URLQueryItem(name: key, value: code) | ||
case .playgroundBook: | ||
return URLQueryItem(name: key, value: code) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 4 could be grouped as a single case, as you do below with preferences
and about
.
This PR extracts common
Commands
model from nef-plugin and nef, in a new module calledSourceEditorModels
- reducing the duplicity of the code.It keeps sync both modules (plugin and related app), and remove any
string
check. Also, it removes these declarations from Info.plist, making the commands typed.