fix: use textEdit for completion items insertion #411
Annotations
10 errors
Run tests:
packages/language-services/src/features/__tests__/do-complete-embedded.test.ts#L121
AssertionError: expected { Object (commitCharacters, documentation, ...) } to deeply equal { Object (commitCharacters, documentation, ...) }
- Expected
+ Received
Object {
"commitCharacters": Array [
";",
",",
],
"documentation": "limegreen
____
Variable declared in one.scss",
"filterText": "ns.$primary",
- "insertText": "$primary",
"kind": 16,
"label": "$primary",
"sortText": undefined,
"tags": Array [],
+ "textEdit": Object {
+ "newText": "ns.$primary",
+ "range": Object {
+ "end": Object {
+ "character": 19,
+ "line": 9,
+ },
+ "start": Object {
+ "character": 8,
+ "line": 9,
+ },
+ },
+ },
}
❯ src/features/__tests__/do-complete-embedded.test.ts:121:9
|
Run tests:
packages/language-services/src/features/__tests__/do-complete-modules.test.ts#L35
AssertionError: expected { documentation: { …(2) }, …(6) } to deeply equal { documentation: { …(2) }, …(6) }
- Expected
+ Received
Object {
"documentation": Object {
"kind": "markdown",
"value": "The value of the mathematical constant **π**.
[Sass documentation](https://sass-lang.com/documentation/modules/math#$pi)",
},
"filterText": "math.$pi",
- "insertText": ".$pi",
"insertTextFormat": 1,
"kind": 6,
"label": "$pi",
"labelDetails": Object {
"detail": undefined,
+ },
+ "textEdit": Object {
+ "newText": "math.$pi",
+ "range": Object {
+ "end": Object {
+ "character": 14,
+ "line": 1,
+ },
+ "start": Object {
+ "character": 6,
+ "line": 1,
+ },
+ },
},
}
❯ src/features/__tests__/do-complete-modules.test.ts:35:9
|
Run tests:
packages/language-services/src/features/__tests__/do-complete-modules.test.ts#L76
AssertionError: expected { documentation: { …(2) }, …(6) } to deeply equal { documentation: { …(2) }, …(6) }
- Expected
+ Received
Object {
"documentation": Object {
"kind": "markdown",
"value": "The value of the mathematical constant **π**.
[Sass documentation](https://sass-lang.com/documentation/modules/math#$pi)",
},
"filterText": "test.$pi",
- "insertText": ".$pi",
"insertTextFormat": 1,
"kind": 6,
"label": "$pi",
"labelDetails": Object {
"detail": undefined,
+ },
+ "textEdit": Object {
+ "newText": "test.$pi",
+ "range": Object {
+ "end": Object {
+ "character": 14,
+ "line": 1,
+ },
+ "start": Object {
+ "character": 6,
+ "line": 1,
+ },
+ },
},
}
❯ src/features/__tests__/do-complete-modules.test.ts:76:9
|
Run tests:
packages/language-services/src/features/__tests__/do-complete-modules.test.ts#L120
AssertionError: expected { documentation: { …(2) }, …(6) } to deeply equal { documentation: { …(2) }, …(6) }
- Expected
+ Received
Object {
"documentation": Object {
"kind": "markdown",
"value": "The value of the mathematical constant **π**.
[Sass documentation](https://sass-lang.com/documentation/modules/math#$pi)",
},
"filterText": "test.$math-pi",
- "insertText": ".$math-pi",
"insertTextFormat": 1,
"kind": 6,
"label": "$math-pi",
"labelDetails": Object {
"detail": undefined,
+ },
+ "textEdit": Object {
+ "newText": "test.$math-pi",
+ "range": Object {
+ "end": Object {
+ "character": 19,
+ "line": 1,
+ },
+ "start": Object {
+ "character": 6,
+ "line": 1,
+ },
+ },
},
}
❯ src/features/__tests__/do-complete-modules.test.ts:120:9
|
Run tests:
packages/language-services/src/features/__tests__/do-complete-modules.test.ts#L162
AssertionError: expected { Object (commitCharacters, documentation, ...) } to deeply equal { Object (commitCharacters, documentation, ...) }
- Expected
+ Received
Object {
"commitCharacters": Array [
";",
",",
],
"documentation": "limegreen
____
Variable declared in one.scss",
"filterText": "one.$primary",
- "insertText": ".$primary",
"kind": 16,
"label": "$primary",
"sortText": undefined,
"tags": Array [],
+ "textEdit": Object {
+ "newText": "one.$primary",
+ "range": Object {
+ "end": Object {
+ "character": 24,
+ "line": 1,
+ },
+ "start": Object {
+ "character": 12,
+ "line": 1,
+ },
+ },
+ },
}
❯ src/features/__tests__/do-complete-modules.test.ts:162:9
|
Run tests:
packages/language-services/src/features/__tests__/do-complete-modules.test.ts#L205
AssertionError: expected { Object (commitCharacters, documentation, ...) } to deeply equal { Object (commitCharacters, documentation, ...) }
- Expected
+ Received
Object {
"commitCharacters": Array [
";",
",",
],
"documentation": "red
____
Variable declared in two.scss",
"filterText": "two.$secondary",
- "insertText": ".$secondary",
"kind": 16,
"label": "$secondary",
"sortText": undefined,
"tags": Array [],
+ "textEdit": Object {
+ "newText": "two.$secondary",
+ "range": Object {
+ "end": Object {
+ "character": 26,
+ "line": 1,
+ },
+ "start": Object {
+ "character": 12,
+ "line": 1,
+ },
+ },
+ },
}
❯ src/features/__tests__/do-complete-modules.test.ts:205:9
|
Run tests:
packages/language-services/src/features/__tests__/do-complete-modules.test.ts#L479
AssertionError: expected { Object (commitCharacters, documentation, ...) } to deeply equal { Object (commitCharacters, documentation, ...) }
- Expected
+ Received
Object {
"commitCharacters": Array [
";",
",",
],
"documentation": "limegreen
____
Variable declared in one.scss",
"filterText": "two.$foo-primary",
- "insertText": ".$foo-primary",
"kind": 16,
"label": "$foo-primary",
"sortText": undefined,
"tags": Array [],
+ "textEdit": Object {
+ "newText": "two.$foo-primary",
+ "range": Object {
+ "end": Object {
+ "character": 28,
+ "line": 1,
+ },
+ "start": Object {
+ "character": 12,
+ "line": 1,
+ },
+ },
+ },
}
❯ src/features/__tests__/do-complete-modules.test.ts:479:9
|
Run tests:
packages/language-services/src/features/__tests__/do-complete-modules.test.ts#L628
AssertionError: expected { label: 'primary', …(8) } to deeply equal { documentation: { …(2) }, …(8) }
- Expected
+ Received
Object {
"documentation": Object {
"kind": "markdown",
"value": "```scss
@mixin primary()
```
____
Mixin declared in one.scss",
},
"filterText": "one.primary",
- "insertText": ".primary",
"insertTextFormat": 2,
"kind": 2,
"label": "primary",
"labelDetails": undefined,
"sortText": undefined,
"tags": Array [],
+ "textEdit": Object {
+ "newText": "one.primary",
+ "range": Object {
+ "end": Object {
+ "character": 25,
+ "line": 1,
+ },
+ "start": Object {
+ "character": 14,
+ "line": 1,
+ },
+ },
+ },
}
❯ src/features/__tests__/do-complete-modules.test.ts:628:9
|
Run tests:
packages/language-services/src/features/__tests__/do-complete-modules.test.ts#L669
AssertionError: expected [ { label: 'primary', …(8) }, …(1) ] to deeply equal [ …(2) ]
- Expected
+ Received
Array [
Object {
"documentation": Object {
"kind": "markdown",
"value": "```scss
@mixin primary($color: red)
```
____
Mixin declared in one.scss",
},
"filterText": "one.primary",
- "insertText": ".primary(${1:color})",
"insertTextFormat": 2,
"kind": 2,
"label": "primary",
"labelDetails": Object {
"detail": "($color: red)",
},
"sortText": undefined,
"tags": Array [],
+ "textEdit": Object {
+ "newText": "primary(${1:color})",
+ "range": Object {
+ "end": Object {
+ "character": 33,
+ "line": 1,
+ },
+ "start": Object {
+ "character": 14,
+ "line": 1,
+ },
},
+ },
+ },
Object {
"documentation": Object {
"kind": "markdown",
"value": "```scss
@mixin primary($color: red)
```
____
Mixin declared in one.scss",
},
"filterText": "one.primary",
- "insertText": ".primary(${1:color}) {
- $0
- }",
"insertTextFormat": 2,
"kind": 2,
"label": "primary",
"labelDetails": Object {
"detail": "($color: red) { }",
},
"sortText": undefined,
"tags": Array [],
+ "textEdit": Object {
+ "newText": "primary(${1:color}) {
+ $0
+ }",
+ "range": Object {
+ "end": Object {
+ "character": 41,
+ "line": 1,
+ },
+ "start": Object {
+ "character": 14,
+ "line": 1,
+ },
+ },
+ },
},
]
❯ src/features/__tests__/do-complete-modules.test.ts:669:9
|
Run tests:
packages/language-services/src/features/__tests__/do-complete-modules.test.ts#L727
AssertionError: expected [] to deeply equal [ …(2) ]
- Expected
+ Received
- Array [
- Object {
- "documentation": Object {
- "kind": "markdown",
- "value": "```scss
- @mixin primary($color)
- ```
- ____
- Mixin declared in one.scss",
- },
- "filterText": "one.primary",
- "insertText": ".primary(${1:color})",
- "insertTextFormat": 2,
- "kind": 2,
- "label": "primary",
- "labelDetails": Object {
- "detail": "($color)",
- },
- "sortText": undefined,
- "tags": Array [],
- },
- Object {
- "documentation": Object {
- "kind": "markdown",
- "value": "```scss
- @mixin primary($color)
- ```
- ____
- Mixin declared in one.scss",
- },
- "filterText": "one.primary",
- "insertText": ".primary(${1:color}) {
- $0
- }",
- "insertTextFormat": 2,
- "kind": 2,
- "label": "primary",
- "labelDetails": Object {
- "detail": "($color) { }",
- },
- "sortText": undefined,
- "tags": Array [],
- },
- ]
+ Array []
❯ src/features/__tests__/do-complete-modules.test.ts:727:9
|
Loading