Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions data/fixtures/scopes/scss/branch.if.iteration.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
* {
@if true { }
@else if false { }
@else { }
}
---

[Range] =
[Domain] = 1:2-3:11
>------------
1| @if true { }
2| @else if false { }
3| @else { }
-----------<
59 changes: 59 additions & 0 deletions data/fixtures/scopes/scss/branch.if.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
* {
@if true { }
@else if false { }
@else { }
}
---

[#1 Content] =
[#1 Domain] = 1:2-1:14
>------------<
1| @if true { }

[#1 Removal] = 1:3-2:8
>-----------
1| @if true { }
2| @else if false { }
--------<

[#1 Leading delimiter] = 1:0-1:2
>--<
1| @if true { }

[#1 Insertion delimiter] = "\n"


[#2 Content] =
[#2 Domain] = 2:2-2:20
>------------------<
2| @else if false { }

[#2 Removal] = 2:0-3:0
>--------------------
2| @else if false { }
3| @else { }
<

[#2 Leading delimiter] = 2:0-2:2
>--<
2| @else if false { }

[#2 Insertion delimiter] = "\n"


[#3 Content] =
[#3 Domain] = 3:2-3:11
>---------<
3| @else { }

[#3 Removal] = 3:0-4:0
>-----------
3| @else { }
4| }
<

[#3 Leading delimiter] = 3:0-3:2
>--<
3| @else { }

[#3 Insertion delimiter] = "\n"
59 changes: 42 additions & 17 deletions data/fixtures/scopes/scss/condition.if.scope
Original file line number Diff line number Diff line change
@@ -1,29 +1,54 @@
* {
@if $container-width < $base-width { }
@if true { }
@else if false { }
@else { }
}
---

[Content] = 1:6-1:36
>------------------------------<
1| @if $container-width < $base-width { }
[#1 Content] = 1:6-1:10
>----<
1| @if true { }

[Removal] = 1:6-1:37
>-------------------------------<
1| @if $container-width < $base-width { }
[#1 Removal] = 1:6-1:11
>-----<
1| @if true { }

[Leading delimiter] = 1:5-1:6
[#1 Leading delimiter] = 1:5-1:6
>-<
1| @if $container-width < $base-width { }
1| @if true { }

[Trailing delimiter] = 1:36-1:37
>-<
1| @if $container-width < $base-width { }
[#1 Trailing delimiter] = 1:10-1:11
>-<
1| @if true { }

[Domain] = 1:2-2:11
>--------------------------------------
1| @if $container-width < $base-width { }
2| @else { }
[#1 Domain] = 1:2-3:11
>------------
1| @if true { }
2| @else if false { }
3| @else { }
-----------<

[Insertion delimiter] = " "
[#1 Insertion delimiter] = " "


[#2 Content] = 2:11-2:16
>-----<
2| @else if false { }

[#2 Removal] = 2:11-2:17
>------<
2| @else if false { }

[#2 Leading delimiter] = 2:10-2:11
>-<
2| @else if false { }

[#2 Trailing delimiter] = 2:16-2:17
>-<
2| @else if false { }

[#2 Domain] = 2:2-2:20
>------------------<
2| @else if false { }

[#2 Insertion delimiter] = " "
25 changes: 14 additions & 11 deletions data/fixtures/scopes/scss/ifStatement.scope
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
* {
@if $container-width < $base-width { }
@if true { }
@else if false { }
@else { }
}
---

[Content] =
[Domain] = 1:2-2:11
>--------------------------------------
1| @if $container-width < $base-width { }
2| @else { }
[Domain] = 1:2-3:11
>------------
1| @if true { }
2| @else if false { }
3| @else { }
-----------<

[Removal] = 1:0-3:0
>----------------------------------------
1| @if $container-width < $base-width { }
2| @else { }
3| }
[Removal] = 1:0-4:0
>--------------
1| @if true { }
2| @else if false { }
3| @else { }
4| }
<

[Leading delimiter] = 1:0-1:2
>--<
1| @if $container-width < $base-width { }
1| @if true { }

[Insertion delimiter] = "\n"
37 changes: 37 additions & 0 deletions data/fixtures/scopes/scss/interior.function.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@function foo() { }
---

[#1 Content] =
[#1 Removal] = 0:17-0:18
>-<
0| @function foo() { }

[#1 Domain] = 0:0-0:19
>-------------------<
0| @function foo() { }

[#1 Insertion delimiter] = " "


[#2 Content] =
[#2 Removal] = 0:14-0:14
><
0| @function foo() { }

[#2 Domain] = 0:13-0:15
>--<
0| @function foo() { }

[#2 Insertion delimiter] = " "


[#3 Content] =
[#3 Removal] = 0:17-0:18
>-<
0| @function foo() { }

[#3 Domain] = 0:16-0:19
>---<
0| @function foo() { }

[#3 Insertion delimiter] = " "
133 changes: 133 additions & 0 deletions data/fixtures/scopes/scss/interior.if.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
* {
@if true { }
@else if false { }
@else { }
}
---

[#1 Content] = 1:2-3:11
>------------
1| @if true { }
2| @else if false { }
3| @else { }
-----------<

[#1 Removal] = 0:3-4:0
>
0| * {
1| @if true { }
2| @else if false { }
3| @else { }
4| }
<

[#1 Domain] = 0:0-4:1
>---
0| * {
1| @if true { }
2| @else if false { }
3| @else { }
4| }
-<

[#1 Insertion delimiter] = " "


[#2 Content] = 1:2-3:11
>------------
1| @if true { }
2| @else if false { }
3| @else { }
-----------<

[#2 Removal] = 0:3-4:0
>
0| * {
1| @if true { }
2| @else if false { }
3| @else { }
4| }
<

[#2 Domain] = 0:2-4:1
>-
0| * {
1| @if true { }
2| @else if false { }
3| @else { }
4| }
-<

[#2 Insertion delimiter] = " "


[#3 Content] =
[#3 Removal] = 1:12-1:13
>-<
1| @if true { }

[#3 Domain] = 1:2-1:14
>------------<
1| @if true { }

[#3 Insertion delimiter] = " "


[#4 Content] =
[#4 Removal] = 1:12-1:13
>-<
1| @if true { }

[#4 Domain] = 1:11-1:14
>---<
1| @if true { }

[#4 Insertion delimiter] = " "


[#5 Content] =
[#5 Removal] = 2:18-2:19
>-<
2| @else if false { }

[#5 Domain] = 2:2-2:20
>------------------<
2| @else if false { }

[#5 Insertion delimiter] = " "


[#6 Content] =
[#6 Removal] = 2:18-2:19
>-<
2| @else if false { }

[#6 Domain] = 2:17-2:20
>---<
2| @else if false { }

[#6 Insertion delimiter] = " "


[#7 Content] =
[#7 Removal] = 3:9-3:10
>-<
3| @else { }

[#7 Domain] = 3:2-3:11
>---------<
3| @else { }

[#7 Insertion delimiter] = " "


[#8 Content] =
[#8 Removal] = 3:9-3:10
>-<
3| @else { }

[#8 Domain] = 3:8-3:11
>---<
3| @else { }

[#8 Insertion delimiter] = " "
18 changes: 7 additions & 11 deletions packages/common/src/scopeSupportFacets/scss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import { cssScopeSupport } from "./css";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

const { supported, unsupported } = ScopeSupportFacetLevel;
const { supported } = ScopeSupportFacetLevel;

export const scssScopeSupport: LanguageScopeSupportFacetMap = {
...cssScopeSupport,

"comment.line": supported,

"condition.if": supported,

namedFunction: supported,
"namedFunction.iteration.block": supported,
"namedFunction.iteration.document": supported,
Expand All @@ -27,15 +25,13 @@ export const scssScopeSupport: LanguageScopeSupportFacetMap = {
"value.argument.formal.iteration": supported,
"value.return": supported,

ifStatement: supported,

"textFragment.comment.line": supported,

// Unsupported

"branch.if": unsupported,
"branch.if.iteration": unsupported,
ifStatement: supported,
"branch.if": supported,
"branch.if.iteration": supported,
"condition.if": supported,

"interior.function": unsupported,
"interior.if": unsupported,
"interior.if": supported,
"interior.function": supported,
};
Loading
Loading