mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
Merge branch 'master' into html-script-hinting
This commit is contained in:
commit
c162a75dc8
34 files changed
+740
-142
No files matched your search
@@ -72,7 +72,7 @@ define(function (require, exports, module) {
|
||||
* @return {boolean} - could the token be hintable?
|
||||
*/
|
||||
function hintable(token) {
|
||||
switch (token.className) {
|
||||
switch (token.type) {
|
||||
case "comment":
|
||||
case "number":
|
||||
case "regexp":
|
||||
|
||||
@@ -331,7 +331,7 @@ define(function (require, exports, module) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (token.className === "property") {
|
||||
if (token.type === "property") {
|
||||
propertyLookup = true;
|
||||
}
|
||||
if (this.findPreviousDot()) {
|
||||
@@ -471,7 +471,12 @@ define(function (require, exports, module) {
|
||||
cursor = sessionType.functionCallPos,
|
||||
token = cursor ? this.getToken(cursor) : undefined,
|
||||
varName;
|
||||
if (token) {
|
||||
if (token &&
|
||||
// only change the 'fn' when the token looks like a function
|
||||
// name, and isn't some other kind of expression
|
||||
(token.type === "variable" ||
|
||||
token.type === "variable-2" ||
|
||||
token.type === "property")) {
|
||||
varName = token.string;
|
||||
if (varName) {
|
||||
fnHint = varName + fnHint.substr(2);
|
||||
|
||||
@@ -211,18 +211,18 @@ define(function (require, exports, module) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (token.className === null) {
|
||||
if (token.type === null) {
|
||||
token = session.getNextTokenOnLine(cursor);
|
||||
}
|
||||
|
||||
if (lastToken && lastToken.className === null) {
|
||||
if (lastToken && lastToken.type === null) {
|
||||
lastToken = session.getNextTokenOnLine(cachedCursor);
|
||||
}
|
||||
|
||||
// Both of the tokens should never be null (happens when token is off
|
||||
// the end of the line), so one is null then close the hints.
|
||||
if (!lastToken || !token ||
|
||||
token.className !== lastToken.className) {
|
||||
token.type !== lastToken.type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user