-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Tweak Quick Edit error strings & update docs #7349
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,7 +42,7 @@ define(function (require, exports, module) { | |
| * | ||
| * @param hostEditor {!Editor} editor | ||
| * @param {!{line:Number, ch:Number}} pos | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since you are fixing comment stuff,
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, will fix |
||
| * @return {functionName: {string}, reason: {string}} | ||
| * @return {functionName: string, reason: string} | ||
| */ | ||
| function _getFunctionName(hostEditor, pos) { | ||
| var token = hostEditor._codeMirror.getTokenAt(pos, true); | ||
|
|
@@ -109,7 +109,7 @@ define(function (require, exports, module) { | |
| * @param {!string} functionName | ||
| * @return {?$.Promise} synchronously resolved with an InlineWidget, or | ||
| * {string} if js other than function is detected at pos, or | ||
| * null if we're not going to provide anything. | ||
| * null if we're not ready to provide anything. | ||
| */ | ||
| function _createInlineEditor(hostEditor, functionName) { | ||
| // Use Tern jump-to-definition helper, if it's available, to find InlineEditor target. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -180,15 +180,15 @@ define({ | |
| "FILE_FILTER_CLIPPED_SUFFIX" : "and {0} more", | ||
|
|
||
| // Quick Edit | ||
| "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND" : "No Quick Edit provider found for current cursor position", | ||
| "ERROR_CSSQUICKEDIT_CLASSNOTFOUND" : "CSS Quick Edit: place cursor in class name", | ||
| "ERROR_CSSQUICKEDIT_IDNOTFOUND" : "CSS Quick Edit: place cursor in id name", | ||
| "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR" : "CSS Quick Edit: place cursor in tag name, class name, or id name", | ||
| "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND" : "No Quick Edit available for current cursor position", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed "provider" since it's an implementation term that probably won't mean much to end users |
||
| "ERROR_CSSQUICKEDIT_CLASSNOTFOUND" : "CSS Quick Edit: incomplete class attribute", | ||
| "ERROR_CSSQUICKEDIT_IDNOTFOUND" : "CSS Quick Edit: incomplete id attribute", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at the code, these two arise when the cursor is in the attribute, but the attribute value is blank or perhaps otherwise malformed... so the original string was incorrect.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another case for the class attribute that triggers this message is: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should have a separate error for that case (though it also seems pretty unlikely to hit, since you'd have to have multiple spaces between the class names in order to hit it).
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll add a separate error case since it looks easy. I also found #7389 in the process, so I guess it's good I wound up poking at this code :-) |
||
| "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR" : "CSS Quick Edit: place cursor in tag name, class attribute, or id attribute", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed up usage of name vs. attribute There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we just shorten this to
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good, will do |
||
| "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX" : "CSS Timing Function Quick Edit: invalid syntax", | ||
| "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND" : "JS Quick Edit: place cursor in function name", | ||
|
|
||
| // Quick Docs | ||
| "ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND" : "No Quick Docs provider found for current cursor position", | ||
| "ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND" : "No Quick Docs available for current cursor position", | ||
|
|
||
| /** | ||
| * ProjectManager | ||
|
|
||
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.
I don't mind comments like this in the source but, for documentation, I don't think the API should feel like it has a pulse. Comments like "We can't determine the context" are fine in logic branches but in
JSDocit feels a little too folksy...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.
There are already well over 1000 occurrences of "we" in our code today, so I think the horse maybe has already left the barn on that one :-) And this sentence was already structured that way...
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.
Yes, that was my veiled attempt to get you to re-word since you added a second "we" to the sentence making it feel a little sarcastic and folksy but it's also somewhat ambiguous with the 2 references to "we" : "we're not even close to to a context where we could..."
Maybe "The insertion point is not close enough to a context where we could provide..." is a little less ambiguous. If you wanted to keep it folksy you could say "You're not even close enough to a context where we could..." but that might be too folksy :)
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.
@JeffryBooher Change pushed that rewords this a little bit. Lmk if you need anything more to merge.