@tsrx/typescript-plugin 0.3.124 → 0.3.127
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/README.md +23 -73
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/language-DzmwV5Es.js +5 -0
- package/dist/language-DzmwV5Es.js.map +1 -0
- package/dist/tsc.js +1 -1
- package/dist/tsc.js.map +1 -1
- package/package.json +10 -10
- package/dist/language-D3oqLmU0.js +0 -5
- package/dist/language-D3oqLmU0.js.map +0 -1
package/README.md
CHANGED
|
@@ -3,50 +3,29 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@tsrx/typescript-plugin)
|
|
4
4
|
[](https://www.npmjs.com/package/@tsrx/typescript-plugin)
|
|
5
5
|
|
|
6
|
-
TypeScript plugin for
|
|
6
|
+
TypeScript plugin for `.tsrx` files. It selects the compiler for the active
|
|
7
|
+
project, generates TypeScript virtual code, and maps language-service results back
|
|
8
|
+
to TSRX source.
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
The
|
|
11
|
+
[TSRX Syntax for VS Code](https://marketplace.visualstudio.com/items?itemName=TSRX.tsrx-vscode-plugin)
|
|
12
|
+
already bundles this plugin through `@tsrx/language-server`; no separate VS Code
|
|
13
|
+
configuration is needed.
|
|
9
14
|
|
|
10
|
-
|
|
15
|
+
## Configuration
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
### Other Editors or Standalone Usage
|
|
16
|
-
|
|
17
|
-
For editors that don't use the Ripple language server (like WebStorm, Sublime
|
|
18
|
-
Text, or command-line `tsc`), add this plugin to your `tsconfig.json`:
|
|
19
|
-
|
|
20
|
-
```json
|
|
21
|
-
{
|
|
22
|
-
"compilerOptions": {
|
|
23
|
-
"jsx": "preserve",
|
|
24
|
-
"jsxImportSource": "ripple",
|
|
25
|
-
"plugins": [
|
|
26
|
-
{
|
|
27
|
-
"name": "@tsrx/typescript-plugin"
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Compiler selection
|
|
35
|
-
|
|
36
|
-
All TSRX targets use the `.tsrx` extension. Normally, the compiler is detected
|
|
37
|
-
automatically from the installed target packages and the nearest `package.json`.
|
|
38
|
-
To remove ambiguity when multiple target compilers are installed, or to use a
|
|
39
|
-
third-party compiler, select one explicitly with the top-level `tsrx.compiler`
|
|
40
|
-
option:
|
|
17
|
+
For a standalone tsserver integration, install this package and add it to the
|
|
18
|
+
project's `tsconfig.json`. The compiler and `jsxImportSource` should match the
|
|
19
|
+
chosen target. For example, a React project can use:
|
|
41
20
|
|
|
42
21
|
```json
|
|
43
22
|
{
|
|
44
23
|
"tsrx": {
|
|
45
|
-
"compiler": "@tsrx/
|
|
24
|
+
"compiler": "@tsrx/react"
|
|
46
25
|
},
|
|
47
26
|
"compilerOptions": {
|
|
48
27
|
"jsx": "preserve",
|
|
49
|
-
"jsxImportSource": "
|
|
28
|
+
"jsxImportSource": "react",
|
|
50
29
|
"plugins": [
|
|
51
30
|
{
|
|
52
31
|
"name": "@tsrx/typescript-plugin"
|
|
@@ -56,44 +35,15 @@ option:
|
|
|
56
35
|
}
|
|
57
36
|
```
|
|
58
37
|
|
|
59
|
-
`compiler` must be a bare
|
|
60
|
-
`@tsrx/react`, `@tsrx/
|
|
61
|
-
third-party TSRX compiler
|
|
62
|
-
absolute paths are not.
|
|
63
|
-
|
|
64
|
-
Compiler declarations follow the active TypeScript project's explicit `tsconfig`
|
|
65
|
-
inheritance graph:
|
|
66
|
-
|
|
67
|
-
- `extends` chains, arrays, JSONC files, and package-based configs are supported.
|
|
68
|
-
- Base configs are applied first. Child configs and later `extends` entries take
|
|
69
|
-
precedence.
|
|
70
|
-
- The compiler package is resolved relative to the config that supplied the
|
|
71
|
-
effective declaration.
|
|
72
|
-
- Nested projects do not inherit from unrelated ancestor configs.
|
|
73
|
-
- An invalid or unresolved effective declaration prevents automatic fallback. A
|
|
74
|
-
valid declaration in a child config still overrides a failed lower-priority
|
|
75
|
-
base.
|
|
76
|
-
|
|
77
|
-
The language server, tsserver plugin, and `tsrx-tsc` use the TypeScript project's
|
|
78
|
-
selected config. When that project context is unavailable, resolution starts at
|
|
79
|
-
the nearest `tsconfig.json`. If no `tsrx.compiler` value is declared, the plugin
|
|
80
|
-
falls back to installed target detection, using the nearest `package.json` to
|
|
81
|
-
disambiguate when multiple supported compiler packages are present.
|
|
82
|
-
|
|
83
|
-
## What it does
|
|
84
|
-
|
|
85
|
-
This plugin:
|
|
86
|
-
|
|
87
|
-
- Registers `.tsrx` files as recognized TypeScript languages
|
|
88
|
-
- Transforms Ripple syntax to TypeScript for type checking
|
|
89
|
-
- Integrates with Volar for virtual code generation and source mapping
|
|
90
|
-
|
|
91
|
-
## Architecture Note
|
|
38
|
+
All targets use the `.tsrx` extension. The `tsrx.compiler` value must be a bare
|
|
39
|
+
package specifier such as `@tsrx/react`, `@tsrx/preact`, `@tsrx/solid`,
|
|
40
|
+
`@tsrx/vue`, `@tsrx/ripple`, `octane`, or a third-party TSRX compiler. Package
|
|
41
|
+
subpaths are supported; relative and absolute paths are not.
|
|
92
42
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
43
|
+
Compiler declarations follow the active TypeScript project's `extends` graph. If
|
|
44
|
+
no compiler is declared, the plugin detects installed target packages and uses the
|
|
45
|
+
nearest `package.json` to resolve ambiguity.
|
|
96
46
|
|
|
97
|
-
The
|
|
98
|
-
|
|
99
|
-
|
|
47
|
+
The language server, tsserver plugin, and `tsrx-tsc` share the same compiler
|
|
48
|
+
selection behavior. See the [TSRX documentation](https://tsrx.dev/) for target
|
|
49
|
+
setup and authoring guidance.
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`./language-D3oqLmU0.js`);var t=e.r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dedupeDocumentSpans=t;function t(e){return n(e,e=>[e.fileName,e.textSpan.start,e.textSpan.length].join(`:`))}function n(e,t){let n=new Map;for(let r of e.reverse())n.set(t(r),r);return[...n.values()]}})),n=e.r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getServiceScript=t,e.fixupImpliedNodeFormatForFile=n;function t(e,t){let n=e.scripts.get(t);if(n?.targetIds.size)for(let t of n.targetIds){let r=e.scripts.get(t);if(r?.generated){let e=r.generated.languagePlugin.typescript?.getServiceScript(r.generated.root);if(e)return[e,r,n]}}if(n?.associatedOnly)return[void 0,n,n];if(n?.generated){let e=n.generated.languagePlugin.typescript?.getServiceScript(n.generated.root);if(e)return[e,n,n]}return[void 0,void 0,void 0]}function n(e,t,n,r,i,a){if(n.impliedNodeFormat!==void 0||!t.some(e=>n.fileName.endsWith(e))||[`.d.ts`,`.ts`,`.tsx`,`.js`,`.jsx`].some(e=>n.fileName.endsWith(e)))return;let o=n.fileName+`.ts`,s=e.getImpliedNodeFormatForFileWorker?.(o,r,i,a)?.impliedNodeFormat;if(s!==void 0)return n.impliedNodeFormat=s,()=>n.impliedNodeFormat=void 0}})),r=e.r((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.transformCallHierarchyItem=s,t.transformDiagnostic=c,t.fillSourceFileText=l,t.transformFileTextChanges=u,t.transformDocumentSpan=d,t.transformSpan=f,t.transformTextChange=p,t.transformTextSpan=m,t.toSourceOffset=h,t.toSourceRanges=g,t.toSourceOffsets=_,t.toGeneratedRange=v,t.toGeneratedRanges=y,t.toGeneratedOffset=b,t.toGeneratedOffsets=x,t.getMappingOffset=S;let r=e.n(),i=n(),a=new WeakMap,o=new WeakSet;function s(e,t,n,r){let i=f(e,t.file,t.span,n,r),a=f(e,t.file,t.selectionSpan,n,r);return{...t,file:i?.fileName??t.file,span:i?.textSpan??{start:0,length:0},selectionSpan:a?.textSpan??{start:0,length:0}}}function c(e,t,n,o){if(!a.has(t)){a.set(t,void 0);let{relatedInformation:s}=t;if(s&&(t.relatedInformation=s.map(t=>c(e,t,n,o)).filter(e=>!!e)),t.file!==void 0&&t.start!==void 0&&t.length!==void 0){let[s]=(0,i.getServiceScript)(e,t.file.fileName);if(s){let[i,c]=m(void 0,e,s,{start:t.start,length:t.length},!0,e=>(0,r.shouldReportDiagnostics)(e,String(t.source),String(t.code)))??[],u=i?t.file.fileName===i?t.file:n?.getSourceFile(i):void 0;c&&u&&(o&&l(e,t.file),a.set(t,{...t,file:u,start:c.start,length:c.length}))}else a.set(t,t)}else a.set(t,t)}return a.get(t)}function l(e,t){if(o.has(t))return;o.add(t);let[n]=(0,i.getServiceScript)(e,t.fileName);if(n&&!n.preventLeadingOffset){let r=e.scripts.fromVirtualCode(n.code);t.text=r.snapshot.getText(0,r.snapshot.getLength())+t.text.substring(r.snapshot.getLength())}}function u(e,t,n,r){let a={},o=new Set;for(let s of t){let[t,c]=(0,i.getServiceScript)(e,s.fileName);if(c)s.textChanges.forEach(t=>{let{fileName:i,textSpan:o}=f(e,s.fileName,t.span,n,r)??{};i&&o&&(a[i]??(a[i]=[])).push({...t,span:o})});else{let e=a[s.fileName]??(a[s.fileName]=[]);s.textChanges.forEach(t=>{e.push(t)}),s.isNewFile&&o.add(s.fileName)}}let s=[];for(let e in a)s.push({fileName:e,isNewFile:o.has(e),textChanges:a[e]});return s}function d(e,t,n,r,i){let a=f(e,t.fileName,t.textSpan,n,r);if(!a&&i&&(a={fileName:t.fileName,textSpan:{start:0,length:0}}),!a)return;let o=f(e,t.fileName,t.contextSpan,n,r),s=f(e,t.originalFileName,t.originalTextSpan,n,r),c=f(e,t.originalFileName,t.originalContextSpan,n,r);return{...t,fileName:a.fileName,textSpan:a.textSpan,contextSpan:o?.textSpan,originalFileName:s?.fileName,originalTextSpan:s?.textSpan,originalContextSpan:c?.textSpan}}function f(e,t,n,r,a){if(!t||!n)return;let[o]=(0,i.getServiceScript)(e,t);if(o){let[t,i]=m(void 0,e,o,n,r,a)??[];if(i&&t)return{fileName:t,textSpan:i}}else return{fileName:t,textSpan:n}}function p(e,t,n,r,i,a){let[o,s]=m(e,t,n,r.span,i,a)??[];if(s&&o)return[o,{newText:r.newText,span:s}]}function m(e,t,n,r,i,a){let o=r.start,s=r.start+r.length;for(let[r,c,l]of g(e,t,n,o,s,i,a))return[r,{start:c,length:l-c}]}function h(e,t,n,r,i){for(let a of _(e,t,n,r,i))return a}function*g(e,t,n,r,i,a,o){if(e){let s=t.maps.get(n.code,e);for(let[c,l]of s.toSourceRange(r-S(t,n),i-S(t,n),a,o))yield[e.id,c,l]}else for(let[e,s]of t.maps.forEach(n.code))for(let[c,l]of s.toSourceRange(r-S(t,n),i-S(t,n),a,o))yield[e.id,c,l]}function*_(e,t,n,r,i){if(e){let a=t.maps.get(n.code,e);for(let[o,s]of a.toSourceLocation(r-S(t,n)))i(s.data)&&(yield[e.id,o])}else for(let[e,a]of t.maps.forEach(n.code))for(let[o,s]of a.toSourceLocation(r-S(t,n)))i(s.data)&&(yield[e.id,o])}function v(e,t,n,r,i,a){for(let o of y(e,t,n,r,i,a))return o}function*y(e,t,n,r,i,a){let o=e.maps.get(t.code,n);for(let[n,s]of o.toGeneratedRange(r,i,!0,a))yield[n+S(e,t),s+S(e,t)]}function b(e,t,n,r,i){for(let[a]of x(e,t,n,r,i))return a}function*x(e,t,n,r,i){let a=e.maps.get(t.code,n);for(let[n,o]of a.toGeneratedLocation(r))i(o.data)&&(yield[n+S(e,t),o])}function S(e,t){return t.preventLeadingOffset?0:e.scripts.fromVirtualCode(t.code).snapshot.getLength()}})),i=e.r((i=>{Object.defineProperty(i,`__esModule`,{value:!0}),i.createProxyLanguageService=u;let a=e.n(),o=t(),s=r(),c=n(),l=/\\/g;function u(e){let t=new Map,n;return{initialize(t){n=(n,r)=>{switch(r){case`getNavigationTree`:return d(t,n[r]);case`getOutliningSpans`:return f(t,n[r]);case`getFormattingEditsForDocument`:return p(t,n[r]);case`getFormattingEditsForRange`:return m(t,n[r]);case`getFormattingEditsAfterKeystroke`:return h(t,n[r]);case`getEditsForFileRename`:return g(t,n[r]);case`getLinkedEditingRangeAtPosition`:return _(t,n[r]);case`prepareCallHierarchy`:return v(t,n[r]);case`provideCallHierarchyIncomingCalls`:return y(t,n[r]);case`provideCallHierarchyOutgoingCalls`:return b(t,n[r]);case`organizeImports`:return x(t,n[r]);case`getQuickInfoAtPosition`:return S(t,n[r]);case`getSignatureHelpItems`:return C(t,n[r]);case`getDocumentHighlights`:return w(t,n[r]);case`getApplicableRefactors`:return T(t,n[r]);case`getEditsForRefactor`:return E(t,n[r]);case`getCombinedCodeFix`:return D(t,n[r]);case`getRenameInfo`:return O(t,n[r]);case`getCodeFixesAtPosition`:return k(t,n[r]);case`getEncodedSemanticClassifications`:return A(t,n[r]);case`getSyntacticDiagnostics`:return j(t,e,n[r]);case`getSemanticDiagnostics`:return M(t,e,n[r]);case`getSuggestionDiagnostics`:return N(t,e,n[r]);case`getDefinitionAndBoundSpan`:return P(t,n[r]);case`findReferences`:return F(t,n[r]);case`getDefinitionAtPosition`:return I(t,n[r]);case`getTypeDefinitionAtPosition`:return L(t,n[r]);case`getImplementationAtPosition`:return R(t,n[r]);case`findRenameLocations`:return z(t,n[r]);case`getReferencesAtPosition`:return B(t,n[r]);case`getCompletionsAtPosition`:return V(t,n[r]);case`getCompletionEntryDetails`:return H(t,n[r]);case`provideInlayHints`:return U(t,n[r]);case`getFileReferences`:return W(t,n[r]);case`getNavigateToItems`:return G(t,n[r])}}},proxy:new Proxy(e,{get(e,r,i){if(n){t.has(r)||t.set(r,n(e,r));let i=t.get(r);if(i)return i}return Reflect.get(e,r,i)},set(e,t,n,r){return Reflect.set(e,t,n,r)}})}}function d(e,t){return n=>{let r=n.replace(l,`/`),[i,a]=(0,c.getServiceScript)(e,r);if(i||a?.associatedOnly){let e=t(a.id);return e.childItems=void 0,e}else return t(r)}}function f(e,t){return n=>{let r=n.replace(l,`/`),[i,a]=(0,c.getServiceScript)(e,r);return i||a?.associatedOnly?[]:t(r)}}function p(e,t){return(n,r)=>{let i=n.replace(l,`/`),[o,u,d]=(0,c.getServiceScript)(e,i);return u?.associatedOnly?[]:o?e.maps.get(o.code,u).mappings.some(e=>(0,a.isFormattingEnabled)(e.data))?t(u.id,r).map(t=>(0,s.transformTextChange)(d,e,o,t,!1,a.isFormattingEnabled)?.[1]).filter(e=>!!e):[]:t(i,r)}}function m(e,t){return(n,r,i,o)=>{let u=n.replace(l,`/`),[d,f,p]=(0,c.getServiceScript)(e,u);if(f?.associatedOnly)return[];if(d){let n=(0,s.toGeneratedRange)(e,d,p,r,i,a.isFormattingEnabled);return n===void 0?[]:t(f.id,n[0],n[1],o).map(t=>(0,s.transformTextChange)(p,e,d,t,!1,a.isFormattingEnabled)?.[1]).filter(e=>!!e)}else return t(u,r,i,o)}}function h(e,t){return(n,r,i,o)=>{let u=n.replace(l,`/`),[d,f,p]=(0,c.getServiceScript)(e,u);if(f?.associatedOnly)return[];if(d){let n=(0,s.toGeneratedOffset)(e,d,p,r,a.isFormattingEnabled);return n===void 0?[]:t(f.id,n,i,o).map(t=>(0,s.transformTextChange)(p,e,d,t,!1,a.isFormattingEnabled)?.[1]).filter(e=>!!e)}else return t(u,r,i,o)}}function g(e,t){return(n,r,i,o)=>{let c=t(n,r,i,o);return(0,s.transformFileTextChanges)(e,c,!1,a.isRenameEnabled)}}function _(e,t){return(n,r)=>{let i=n.replace(l,`/`),[o,u,d]=(0,c.getServiceScript)(e,i);if(!u?.associatedOnly)if(o){let n=(0,s.toGeneratedOffset)(e,o,d,r,a.isLinkedEditingEnabled);if(n!==void 0){let r=t(u.id,n);if(r)return{ranges:r.ranges.map(t=>(0,s.transformTextSpan)(d,e,o,t,!1,a.isLinkedEditingEnabled)?.[1]).filter(e=>!!e),wordPattern:r.wordPattern}}}else return t(i,r)}}function v(e,t){return(n,r)=>{let i=n.replace(l,`/`),[o,u,d]=(0,c.getServiceScript)(e,i);if(!u?.associatedOnly)if(o){let n=(0,s.toGeneratedOffset)(e,o,d,r,a.isCallHierarchyEnabled);if(n!==void 0){let r=t(u.id,n);if(Array.isArray(r))return r.map(t=>(0,s.transformCallHierarchyItem)(e,t,!0,a.isCallHierarchyEnabled));if(r)return(0,s.transformCallHierarchyItem)(e,r,!0,a.isCallHierarchyEnabled)}}else return t(i,r)}}function y(e,t){return(n,r)=>{let i=[],o=n.replace(l,`/`),[u,d,f]=(0,c.getServiceScript)(e,o);if(d?.associatedOnly)return[];if(u){let n=(0,s.toGeneratedOffset)(e,u,f,r,a.isCallHierarchyEnabled);n!==void 0&&(i=t(d.id,n))}else i=t(o,r);return i.map(t=>({from:(0,s.transformCallHierarchyItem)(e,t.from,!0,a.isCallHierarchyEnabled),fromSpans:t.fromSpans.map(n=>(0,s.transformSpan)(e,t.from.file,n,!0,a.isCallHierarchyEnabled)?.textSpan).filter(e=>!!e)}))}}function b(e,t){return(n,r)=>{let i=[],o=n.replace(l,`/`),[u,d,f]=(0,c.getServiceScript)(e,o);if(d?.associatedOnly)return[];if(u){let n=(0,s.toGeneratedOffset)(e,u,f,r,a.isCallHierarchyEnabled);n!==void 0&&(i=t(d.id,n))}else i=t(o,r);return i.map(t=>({to:(0,s.transformCallHierarchyItem)(e,t.to,!0,a.isCallHierarchyEnabled),fromSpans:t.fromSpans.map(t=>u?(0,s.transformTextSpan)(f,e,u,t,!0,a.isCallHierarchyEnabled)?.[1]:t).filter(e=>!!e)}))}}function x(e,t){return(n,r,i)=>{let o=t(n,r,i);return(0,s.transformFileTextChanges)(e,o,!1,a.isCodeActionsEnabled)}}function S(e,t){return(n,r,...i)=>{let o=n.replace(l,`/`),[u,d,f]=(0,c.getServiceScript)(e,o);if(!d?.associatedOnly)if(u){let n=[];for(let[o]of(0,s.toGeneratedOffsets)(e,u,f,r,a.isHoverEnabled)){let r=t(d.id,o,...i);if(r){let t=(0,s.transformTextSpan)(f,e,u,r.textSpan,!0,a.isHoverEnabled)?.[1];t&&n.push({...r,textSpan:t})}}if(n.length===1)return n[0];if(n.length>=2){let e={...n[0]};e.displayParts=e.displayParts?.slice(),e.documentation=e.documentation?.slice(),e.tags=e.tags?.slice();let t=new Set([q(n[0].displayParts)]),r=new Set([q(n[0].documentation)]),i=new Set;for(let e of n[0].tags??[])i.add(e.name+`__volar__`+q(e.text));for(let a=1;a<n.length;a++){let{displayParts:o,documentation:s,tags:c}=n[a];o?.length&&!t.has(q(o))&&(t.add(q(o)),e.displayParts??=[],e.displayParts.push({...o[0],text:`
|
|
1
|
+
const e=require(`./language-DzmwV5Es.js`);var t=e.r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dedupeDocumentSpans=t;function t(e){return n(e,e=>[e.fileName,e.textSpan.start,e.textSpan.length].join(`:`))}function n(e,t){let n=new Map;for(let r of e.reverse())n.set(t(r),r);return[...n.values()]}})),n=e.r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getServiceScript=t,e.fixupImpliedNodeFormatForFile=n;function t(e,t){let n=e.scripts.get(t);if(n?.targetIds.size)for(let t of n.targetIds){let r=e.scripts.get(t);if(r?.generated){let e=r.generated.languagePlugin.typescript?.getServiceScript(r.generated.root);if(e)return[e,r,n]}}if(n?.associatedOnly)return[void 0,n,n];if(n?.generated){let e=n.generated.languagePlugin.typescript?.getServiceScript(n.generated.root);if(e)return[e,n,n]}return[void 0,void 0,void 0]}function n(e,t,n,r,i,a){if(n.impliedNodeFormat!==void 0||!t.some(e=>n.fileName.endsWith(e))||[`.d.ts`,`.ts`,`.tsx`,`.js`,`.jsx`].some(e=>n.fileName.endsWith(e)))return;let o=n.fileName+`.ts`,s=e.getImpliedNodeFormatForFileWorker?.(o,r,i,a)?.impliedNodeFormat;if(s!==void 0)return n.impliedNodeFormat=s,()=>n.impliedNodeFormat=void 0}})),r=e.r((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.transformCallHierarchyItem=s,t.transformDiagnostic=c,t.fillSourceFileText=l,t.transformFileTextChanges=u,t.transformDocumentSpan=d,t.transformSpan=f,t.transformTextChange=p,t.transformTextSpan=m,t.toSourceOffset=h,t.toSourceRanges=g,t.toSourceOffsets=_,t.toGeneratedRange=v,t.toGeneratedRanges=y,t.toGeneratedOffset=b,t.toGeneratedOffsets=x,t.getMappingOffset=S;let r=e.n(),i=n(),a=new WeakMap,o=new WeakSet;function s(e,t,n,r){let i=f(e,t.file,t.span,n,r),a=f(e,t.file,t.selectionSpan,n,r);return{...t,file:i?.fileName??t.file,span:i?.textSpan??{start:0,length:0},selectionSpan:a?.textSpan??{start:0,length:0}}}function c(e,t,n,o){if(!a.has(t)){a.set(t,void 0);let{relatedInformation:s}=t;if(s&&(t.relatedInformation=s.map(t=>c(e,t,n,o)).filter(e=>!!e)),t.file!==void 0&&t.start!==void 0&&t.length!==void 0){let[s]=(0,i.getServiceScript)(e,t.file.fileName);if(s){let[i,c]=m(void 0,e,s,{start:t.start,length:t.length},!0,e=>(0,r.shouldReportDiagnostics)(e,String(t.source),String(t.code)))??[],u=i?t.file.fileName===i?t.file:n?.getSourceFile(i):void 0;c&&u&&(o&&l(e,t.file),a.set(t,{...t,file:u,start:c.start,length:c.length}))}else a.set(t,t)}else a.set(t,t)}return a.get(t)}function l(e,t){if(o.has(t))return;o.add(t);let[n]=(0,i.getServiceScript)(e,t.fileName);if(n&&!n.preventLeadingOffset){let r=e.scripts.fromVirtualCode(n.code);t.text=r.snapshot.getText(0,r.snapshot.getLength())+t.text.substring(r.snapshot.getLength())}}function u(e,t,n,r){let a={},o=new Set;for(let s of t){let[t,c]=(0,i.getServiceScript)(e,s.fileName);if(c)s.textChanges.forEach(t=>{let{fileName:i,textSpan:o}=f(e,s.fileName,t.span,n,r)??{};i&&o&&(a[i]??(a[i]=[])).push({...t,span:o})});else{let e=a[s.fileName]??(a[s.fileName]=[]);s.textChanges.forEach(t=>{e.push(t)}),s.isNewFile&&o.add(s.fileName)}}let s=[];for(let e in a)s.push({fileName:e,isNewFile:o.has(e),textChanges:a[e]});return s}function d(e,t,n,r,i){let a=f(e,t.fileName,t.textSpan,n,r);if(!a&&i&&(a={fileName:t.fileName,textSpan:{start:0,length:0}}),!a)return;let o=f(e,t.fileName,t.contextSpan,n,r),s=f(e,t.originalFileName,t.originalTextSpan,n,r),c=f(e,t.originalFileName,t.originalContextSpan,n,r);return{...t,fileName:a.fileName,textSpan:a.textSpan,contextSpan:o?.textSpan,originalFileName:s?.fileName,originalTextSpan:s?.textSpan,originalContextSpan:c?.textSpan}}function f(e,t,n,r,a){if(!t||!n)return;let[o]=(0,i.getServiceScript)(e,t);if(o){let[t,i]=m(void 0,e,o,n,r,a)??[];if(i&&t)return{fileName:t,textSpan:i}}else return{fileName:t,textSpan:n}}function p(e,t,n,r,i,a){let[o,s]=m(e,t,n,r.span,i,a)??[];if(s&&o)return[o,{newText:r.newText,span:s}]}function m(e,t,n,r,i,a){let o=r.start,s=r.start+r.length;for(let[r,c,l]of g(e,t,n,o,s,i,a))return[r,{start:c,length:l-c}]}function h(e,t,n,r,i){for(let a of _(e,t,n,r,i))return a}function*g(e,t,n,r,i,a,o){if(e){let s=t.maps.get(n.code,e);for(let[c,l]of s.toSourceRange(r-S(t,n),i-S(t,n),a,o))yield[e.id,c,l]}else for(let[e,s]of t.maps.forEach(n.code))for(let[c,l]of s.toSourceRange(r-S(t,n),i-S(t,n),a,o))yield[e.id,c,l]}function*_(e,t,n,r,i){if(e){let a=t.maps.get(n.code,e);for(let[o,s]of a.toSourceLocation(r-S(t,n)))i(s.data)&&(yield[e.id,o])}else for(let[e,a]of t.maps.forEach(n.code))for(let[o,s]of a.toSourceLocation(r-S(t,n)))i(s.data)&&(yield[e.id,o])}function v(e,t,n,r,i,a){for(let o of y(e,t,n,r,i,a))return o}function*y(e,t,n,r,i,a){let o=e.maps.get(t.code,n);for(let[n,s]of o.toGeneratedRange(r,i,!0,a))yield[n+S(e,t),s+S(e,t)]}function b(e,t,n,r,i){for(let[a]of x(e,t,n,r,i))return a}function*x(e,t,n,r,i){let a=e.maps.get(t.code,n);for(let[n,o]of a.toGeneratedLocation(r))i(o.data)&&(yield[n+S(e,t),o])}function S(e,t){return t.preventLeadingOffset?0:e.scripts.fromVirtualCode(t.code).snapshot.getLength()}})),i=e.r((i=>{Object.defineProperty(i,`__esModule`,{value:!0}),i.createProxyLanguageService=u;let a=e.n(),o=t(),s=r(),c=n(),l=/\\/g;function u(e){let t=new Map,n;return{initialize(t){n=(n,r)=>{switch(r){case`getNavigationTree`:return d(t,n[r]);case`getOutliningSpans`:return f(t,n[r]);case`getFormattingEditsForDocument`:return p(t,n[r]);case`getFormattingEditsForRange`:return m(t,n[r]);case`getFormattingEditsAfterKeystroke`:return h(t,n[r]);case`getEditsForFileRename`:return g(t,n[r]);case`getLinkedEditingRangeAtPosition`:return _(t,n[r]);case`prepareCallHierarchy`:return v(t,n[r]);case`provideCallHierarchyIncomingCalls`:return y(t,n[r]);case`provideCallHierarchyOutgoingCalls`:return b(t,n[r]);case`organizeImports`:return x(t,n[r]);case`getQuickInfoAtPosition`:return S(t,n[r]);case`getSignatureHelpItems`:return C(t,n[r]);case`getDocumentHighlights`:return w(t,n[r]);case`getApplicableRefactors`:return T(t,n[r]);case`getEditsForRefactor`:return E(t,n[r]);case`getCombinedCodeFix`:return D(t,n[r]);case`getRenameInfo`:return O(t,n[r]);case`getCodeFixesAtPosition`:return k(t,n[r]);case`getEncodedSemanticClassifications`:return A(t,n[r]);case`getSyntacticDiagnostics`:return j(t,e,n[r]);case`getSemanticDiagnostics`:return M(t,e,n[r]);case`getSuggestionDiagnostics`:return N(t,e,n[r]);case`getDefinitionAndBoundSpan`:return P(t,n[r]);case`findReferences`:return F(t,n[r]);case`getDefinitionAtPosition`:return I(t,n[r]);case`getTypeDefinitionAtPosition`:return L(t,n[r]);case`getImplementationAtPosition`:return R(t,n[r]);case`findRenameLocations`:return z(t,n[r]);case`getReferencesAtPosition`:return B(t,n[r]);case`getCompletionsAtPosition`:return V(t,n[r]);case`getCompletionEntryDetails`:return H(t,n[r]);case`provideInlayHints`:return U(t,n[r]);case`getFileReferences`:return W(t,n[r]);case`getNavigateToItems`:return G(t,n[r])}}},proxy:new Proxy(e,{get(e,r,i){if(n){t.has(r)||t.set(r,n(e,r));let i=t.get(r);if(i)return i}return Reflect.get(e,r,i)},set(e,t,n,r){return Reflect.set(e,t,n,r)}})}}function d(e,t){return n=>{let r=n.replace(l,`/`),[i,a]=(0,c.getServiceScript)(e,r);if(i||a?.associatedOnly){let e=t(a.id);return e.childItems=void 0,e}else return t(r)}}function f(e,t){return n=>{let r=n.replace(l,`/`),[i,a]=(0,c.getServiceScript)(e,r);return i||a?.associatedOnly?[]:t(r)}}function p(e,t){return(n,r)=>{let i=n.replace(l,`/`),[o,u,d]=(0,c.getServiceScript)(e,i);return u?.associatedOnly?[]:o?e.maps.get(o.code,u).mappings.some(e=>(0,a.isFormattingEnabled)(e.data))?t(u.id,r).map(t=>(0,s.transformTextChange)(d,e,o,t,!1,a.isFormattingEnabled)?.[1]).filter(e=>!!e):[]:t(i,r)}}function m(e,t){return(n,r,i,o)=>{let u=n.replace(l,`/`),[d,f,p]=(0,c.getServiceScript)(e,u);if(f?.associatedOnly)return[];if(d){let n=(0,s.toGeneratedRange)(e,d,p,r,i,a.isFormattingEnabled);return n===void 0?[]:t(f.id,n[0],n[1],o).map(t=>(0,s.transformTextChange)(p,e,d,t,!1,a.isFormattingEnabled)?.[1]).filter(e=>!!e)}else return t(u,r,i,o)}}function h(e,t){return(n,r,i,o)=>{let u=n.replace(l,`/`),[d,f,p]=(0,c.getServiceScript)(e,u);if(f?.associatedOnly)return[];if(d){let n=(0,s.toGeneratedOffset)(e,d,p,r,a.isFormattingEnabled);return n===void 0?[]:t(f.id,n,i,o).map(t=>(0,s.transformTextChange)(p,e,d,t,!1,a.isFormattingEnabled)?.[1]).filter(e=>!!e)}else return t(u,r,i,o)}}function g(e,t){return(n,r,i,o)=>{let c=t(n,r,i,o);return(0,s.transformFileTextChanges)(e,c,!1,a.isRenameEnabled)}}function _(e,t){return(n,r)=>{let i=n.replace(l,`/`),[o,u,d]=(0,c.getServiceScript)(e,i);if(!u?.associatedOnly)if(o){let n=(0,s.toGeneratedOffset)(e,o,d,r,a.isLinkedEditingEnabled);if(n!==void 0){let r=t(u.id,n);if(r)return{ranges:r.ranges.map(t=>(0,s.transformTextSpan)(d,e,o,t,!1,a.isLinkedEditingEnabled)?.[1]).filter(e=>!!e),wordPattern:r.wordPattern}}}else return t(i,r)}}function v(e,t){return(n,r)=>{let i=n.replace(l,`/`),[o,u,d]=(0,c.getServiceScript)(e,i);if(!u?.associatedOnly)if(o){let n=(0,s.toGeneratedOffset)(e,o,d,r,a.isCallHierarchyEnabled);if(n!==void 0){let r=t(u.id,n);if(Array.isArray(r))return r.map(t=>(0,s.transformCallHierarchyItem)(e,t,!0,a.isCallHierarchyEnabled));if(r)return(0,s.transformCallHierarchyItem)(e,r,!0,a.isCallHierarchyEnabled)}}else return t(i,r)}}function y(e,t){return(n,r)=>{let i=[],o=n.replace(l,`/`),[u,d,f]=(0,c.getServiceScript)(e,o);if(d?.associatedOnly)return[];if(u){let n=(0,s.toGeneratedOffset)(e,u,f,r,a.isCallHierarchyEnabled);n!==void 0&&(i=t(d.id,n))}else i=t(o,r);return i.map(t=>({from:(0,s.transformCallHierarchyItem)(e,t.from,!0,a.isCallHierarchyEnabled),fromSpans:t.fromSpans.map(n=>(0,s.transformSpan)(e,t.from.file,n,!0,a.isCallHierarchyEnabled)?.textSpan).filter(e=>!!e)}))}}function b(e,t){return(n,r)=>{let i=[],o=n.replace(l,`/`),[u,d,f]=(0,c.getServiceScript)(e,o);if(d?.associatedOnly)return[];if(u){let n=(0,s.toGeneratedOffset)(e,u,f,r,a.isCallHierarchyEnabled);n!==void 0&&(i=t(d.id,n))}else i=t(o,r);return i.map(t=>({to:(0,s.transformCallHierarchyItem)(e,t.to,!0,a.isCallHierarchyEnabled),fromSpans:t.fromSpans.map(t=>u?(0,s.transformTextSpan)(f,e,u,t,!0,a.isCallHierarchyEnabled)?.[1]:t).filter(e=>!!e)}))}}function x(e,t){return(n,r,i)=>{let o=t(n,r,i);return(0,s.transformFileTextChanges)(e,o,!1,a.isCodeActionsEnabled)}}function S(e,t){return(n,r,...i)=>{let o=n.replace(l,`/`),[u,d,f]=(0,c.getServiceScript)(e,o);if(!d?.associatedOnly)if(u){let n=[];for(let[o]of(0,s.toGeneratedOffsets)(e,u,f,r,a.isHoverEnabled)){let r=t(d.id,o,...i);if(r){let t=(0,s.transformTextSpan)(f,e,u,r.textSpan,!0,a.isHoverEnabled)?.[1];t&&n.push({...r,textSpan:t})}}if(n.length===1)return n[0];if(n.length>=2){let e={...n[0]};e.displayParts=e.displayParts?.slice(),e.documentation=e.documentation?.slice(),e.tags=e.tags?.slice();let t=new Set([q(n[0].displayParts)]),r=new Set([q(n[0].documentation)]),i=new Set;for(let e of n[0].tags??[])i.add(e.name+`__volar__`+q(e.text));for(let a=1;a<n.length;a++){let{displayParts:o,documentation:s,tags:c}=n[a];o?.length&&!t.has(q(o))&&(t.add(q(o)),e.displayParts??=[],e.displayParts.push({...o[0],text:`
|
|
2
2
|
|
|
3
3
|
`+o[0].text}),e.displayParts.push(...o.slice(1))),s?.length&&!r.has(q(s))&&(r.add(q(s)),e.documentation??=[],e.documentation.push({...s[0],text:`
|
|
4
4
|
|