volar-service-typescript 0.0.37-patch.1 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/plugins/syntactic.js
CHANGED
|
@@ -16,12 +16,16 @@ function create(ts, { isFormattingEnabled = async (document, context) => {
|
|
|
16
16
|
autoFormatTriggerCharacters: [';', '}', '\n'],
|
|
17
17
|
create(context) {
|
|
18
18
|
return {
|
|
19
|
-
async provideAutoInsertionEdit(document,
|
|
19
|
+
async provideAutoInsertionEdit(document, selection, change) {
|
|
20
|
+
// selection must at end of change
|
|
21
|
+
if (document.offsetAt(selection) !== change.rangeOffset + change.text.length) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
20
24
|
if ((document.languageId === 'javascriptreact' || document.languageId === 'typescriptreact')
|
|
21
|
-
&&
|
|
25
|
+
&& change.text.endsWith('>')
|
|
22
26
|
&& await isAutoClosingTagsEnabled(document, context)) {
|
|
23
27
|
const { languageService, fileName } = getLanguageServiceByDocument(ts, document);
|
|
24
|
-
const close = languageService.getJsxClosingTagAtPosition(fileName, document.offsetAt(
|
|
28
|
+
const close = languageService.getJsxClosingTagAtPosition(fileName, document.offsetAt(selection));
|
|
25
29
|
if (close) {
|
|
26
30
|
return '$0' + close.newText;
|
|
27
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as ts from 'typescript';
|
|
2
2
|
export declare namespace SymbolKind {
|
|
3
|
-
function fromProtocolScriptElementKind(kind: ts.ScriptElementKind): 2 | 5 |
|
|
3
|
+
function fromProtocolScriptElementKind(kind: ts.ScriptElementKind): 2 | 5 | 10 | 22 | 11 | 6 | 7 | 13 | 12 | 9 | 26 | 15;
|
|
4
4
|
}
|
|
5
5
|
//# sourceMappingURL=typeConverters.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "volar-service-typescript",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"description": "Integrate TypeScript into Volar",
|
|
5
5
|
"homepage": "https://github.com/volarjs/services/tree/master/packages/typescript",
|
|
6
6
|
"bugs": "https://github.com/volarjs/services/issues",
|
|
@@ -35,11 +35,12 @@
|
|
|
35
35
|
"vscode-nls": "^5.2.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@volar/language-service": "~2.2.0-alpha.
|
|
38
|
+
"@volar/language-service": "~2.2.0-alpha.4"
|
|
39
39
|
},
|
|
40
40
|
"peerDependenciesMeta": {
|
|
41
41
|
"@volar/language-service": {
|
|
42
42
|
"optional": true
|
|
43
43
|
}
|
|
44
|
-
}
|
|
44
|
+
},
|
|
45
|
+
"gitHead": "65ba3d69ae39a3c780622c62a410ecff495e36a7"
|
|
45
46
|
}
|