diff --git a/src/extensions/default/CSSCodeHints/main.js b/src/extensions/default/CSSCodeHints/main.js index fc1ef833178..5f1b07fff00 100644 --- a/src/extensions/default/CSSCodeHints/main.js +++ b/src/extensions/default/CSSCodeHints/main.js @@ -373,7 +373,7 @@ define(function (require, exports, module) { AppInit.appReady(function () { var cssPropHints = new CssPropHints(); - CodeHintManager.registerHintProvider(cssPropHints, ["css"], 0); + CodeHintManager.registerHintProvider(cssPropHints, ["css", "scss"], 0); // For unit testing exports.cssPropHintProvider = cssPropHints; diff --git a/src/language/CSSUtils.js b/src/language/CSSUtils.js index 59a3309cf88..e7d09d0ef18 100644 --- a/src/language/CSSUtils.js +++ b/src/language/CSSUtils.js @@ -73,7 +73,7 @@ define(function (require, exports, module) { } lastToken = state.stack[state.stack.length - 1]; - return (lastToken === "{" || lastToken === "rule"); + return (lastToken === "{" || lastToken === "rule" || lastToken === "block"); } /** @@ -94,7 +94,9 @@ define(function (require, exports, module) { if (!state.stack || state.stack.length < 2) { return false; } - return (state.stack[state.stack.length - 1] === "propertyValue" && state.stack[state.stack.length - 2] === "rule"); + return ((state.stack[state.stack.length - 1] === "propertyValue" && + (state.stack[state.stack.length - 2] === "rule" || state.stack[state.stack.length - 2] === "block")) || + (state.stack[state.stack.length - 1] === "(" && (state.stack[state.stack.length - 2] === "propertyValue"))); } /** @@ -450,7 +452,7 @@ define(function (require, exports, module) { mode = editor.getModeForSelection(); // Check if this is inside a style block or in a css/less document. - if (mode !== "css" && mode !== "less") { + if (mode !== "css" && mode !== "text/x-scss" && mode !== "less") { return createInfo(); }