Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 3ce6ae2

Browse files
committed
Merge pull request #4931 from adobe/rlim/hints-for-scss
Show CSS code hints in SCSS mode.
2 parents d57cdc1 + 8434cc4 commit 3ce6ae2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/extensions/default/CSSCodeHints/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ define(function (require, exports, module) {
373373

374374
AppInit.appReady(function () {
375375
var cssPropHints = new CssPropHints();
376-
CodeHintManager.registerHintProvider(cssPropHints, ["css"], 0);
376+
CodeHintManager.registerHintProvider(cssPropHints, ["css", "scss"], 0);
377377

378378
// For unit testing
379379
exports.cssPropHintProvider = cssPropHints;

src/language/CSSUtils.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ define(function (require, exports, module) {
7373
}
7474

7575
lastToken = state.stack[state.stack.length - 1];
76-
return (lastToken === "{" || lastToken === "rule");
76+
return (lastToken === "{" || lastToken === "rule" || lastToken === "block");
7777
}
7878

7979
/**
@@ -94,7 +94,9 @@ define(function (require, exports, module) {
9494
if (!state.stack || state.stack.length < 2) {
9595
return false;
9696
}
97-
return (state.stack[state.stack.length - 1] === "propertyValue" && state.stack[state.stack.length - 2] === "rule");
97+
return ((state.stack[state.stack.length - 1] === "propertyValue" &&
98+
(state.stack[state.stack.length - 2] === "rule" || state.stack[state.stack.length - 2] === "block")) ||
99+
(state.stack[state.stack.length - 1] === "(" && (state.stack[state.stack.length - 2] === "propertyValue")));
98100
}
99101

100102
/**
@@ -450,7 +452,7 @@ define(function (require, exports, module) {
450452
mode = editor.getModeForSelection();
451453

452454
// Check if this is inside a style block or in a css/less document.
453-
if (mode !== "css" && mode !== "less") {
455+
if (mode !== "css" && mode !== "text/x-scss" && mode !== "less") {
454456
return createInfo();
455457
}
456458

0 commit comments

Comments
 (0)