Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

WIP: needs commit splitting #2419

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open

Conversation

prertik
Copy link
Member

@prertik prertik commented Mar 14, 2019

This is in nascent condition and will be susceptible to a lot of changes.

This PR can even be pointless.

from: CodeMirror.Pos(cur.line, token.start),
to: CodeMirror.Pos(cur.line, token.end)
};
if (found.length) return {list: found, from: from, to: to};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'from' used out of scope.

var found = [];
for (var i = 0; i < options.words.length; i++) {
var word = options.words[i];
if (word.slice(0, token.string.length) == token.string)
if (word.slice(0, term.length) == term)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'term' used out of scope.

if (token.string && /\w/.test(token.string[token.string.length - 1])) {
var term = token.string, from = CodeMirror.Pos(cur.line, token.start);
} else {
var term = "", from = to;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'from' is already defined.
'term' is already defined.

return CodeMirror.hint.anyword(cm, options);
return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }
} else {
return function() {}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

} else if (CodeMirror.hint.anyword) {
return CodeMirror.hint.anyword(cm, options);
return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

resolved.async = true
} else {
resolved = function(cm, options) {
var app = applicableHelpers(cm, helpers)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

}
run(0)
}
resolved.async = true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

}
}
run(0)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

else run(i + 1)
}
}
run(0)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

} else {
var result = helper(cm, options)
if (result) callback(result)
else run(i + 1)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@prertik
Copy link
Member Author

prertik commented Mar 14, 2019

Hound's review should be ignored here as the CM addons are pulled from upstream v5.11.0

@prertik
Copy link
Member Author

prertik commented Mar 14, 2019

This pull request introduces 2 alerts when merging 88a7445 into 6a4f68b - view on LGTM.com

new alerts:

  • 1 for Unmatchable caret in regular expression
  • 1 for Superfluous trailing arguments

Comment posted by LGTM.com

Signed-off-by: Pratik Karki <predatoramigo@gmail.com>
}, options)
} else {
var result = helper(cm, options)
if (result) callback(result)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

else run(i + 1)
}, options)
} else {
var result = helper(cm, options)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'result' is already defined.
Missing semicolon.

helper(cm, function(result) {
if (result) callback(result)
else run(i + 1)
}, options)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

if (helper.async) {
helper(cm, function(result) {
if (result) callback(result)
else run(i + 1)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var helper = app[i]
if (helper.async) {
helper(cm, function(result) {
if (result) callback(result)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var result = []
for (var i = 0; i < helpers.length; i++)
if (helpers[i].supportsSelection) result.push(helpers[i])
return result
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

if (!cm.somethingSelected()) return helpers
var result = []
for (var i = 0; i < helpers.length; i++)
if (helpers[i].supportsSelection) result.push(helpers[i])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var helpers = cm.getHelpers(cm.getCursor(), "hint"), words;
function applicableHelpers(cm, helpers) {
if (!cm.somethingSelected()) return helpers
var result = []
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

CodeMirror.registerHelper("hint", "auto", function(cm, options) {
var helpers = cm.getHelpers(cm.getCursor(), "hint"), words;
function applicableHelpers(cm, helpers) {
if (!cm.somethingSelected()) return helpers
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

if (editor[prop] !== undefined) out[prop] = editor[prop];
if (options) for (var prop in options)
if (options[prop] !== undefined) out[prop] = options[prop];
if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@prertik
Copy link
Member Author

prertik commented Mar 22, 2019

This pull request introduces 2 alerts when merging 231602d into 6a4f68b - view on LGTM.com

new alerts:

  • 1 for Unmatchable caret in regular expression
  • 1 for Superfluous trailing arguments

Comment posted by LGTM.com

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants