reactive-vscode 0.3.1 → 0.3.3
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 +8 -8
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +382 -407
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
**Develop VSCode extension with Vue Reactivity API**
|
|
10
10
|
|
|
11
|
-
- [**Documentation**](https://kermanx.
|
|
12
|
-
- [**Why reactive-vscode**](https://kermanx.
|
|
13
|
-
- [**All Functions**](https://kermanx.
|
|
14
|
-
- [**Examples**](https://kermanx.
|
|
11
|
+
- [**Documentation**](https://kermanx.com/reactive-vscode/)
|
|
12
|
+
- [**Why reactive-vscode**](https://kermanx.com/reactive-vscode/guide/why)
|
|
13
|
+
- [**All Functions**](https://kermanx.com/reactive-vscode/functions/)
|
|
14
|
+
- [**Examples**](https://kermanx.com/reactive-vscode/examples/)
|
|
15
15
|
|
|
16
16
|
### Project Status
|
|
17
17
|
|
|
@@ -21,7 +21,7 @@ Currently, most of the VSCode APIs are covered, and this project has been used i
|
|
|
21
21
|
- [Slidev for VSCode <sub><sub></sub></sub>](https://github.com/slidevjs/slidev/tree/main/packages/vscode)
|
|
22
22
|
- [Iconify IntelliSense <sub><sub></sub></sub>](https://github.com/antfu/vscode-iconify)
|
|
23
23
|
|
|
24
|
-
The [documentation](https://kermanx.
|
|
24
|
+
The [documentation](https://kermanx.com/reactive-vscode/) is complete, and the [VueUse integration](https://kermanx.com/reactive-vscode/guide/vueuse.html) is also available.
|
|
25
25
|
|
|
26
26
|
However, the project is still in its 0.x and may have minor API changes. If you encounter any problems, please feel free to [open an issue](https://github.com/kermanx/reactive-vscode/issues/new).
|
|
27
27
|
|
|
@@ -81,7 +81,7 @@ export function activate(extensionContext: ExtensionContext) {
|
|
|
81
81
|
|
|
82
82
|
</details>
|
|
83
83
|
|
|
84
|
-
[More examples](https://kermanx.
|
|
84
|
+
[More examples](https://kermanx.com/reactive-vscode/examples/).
|
|
85
85
|
|
|
86
86
|
### License
|
|
87
87
|
|
|
@@ -91,7 +91,7 @@ Source code in [the `./packages/reactivity` directory](https://github.com/kerman
|
|
|
91
91
|
|
|
92
92
|
Source code in [the `./packages/mock` directory](https://github.com/kermanx/reactive-vscode/blob/main/packages/core/src/mock) references the implementation of [`VSCode`](https://github.com/microsoft/vscode). Licensed under a [MIT License](https://github.com/microsoft/vscode/blob/main/LICENSE.txt).
|
|
93
93
|
|
|
94
|
-
The logo <img src="https://kermanx.
|
|
94
|
+
The logo <img src="https://kermanx.com/reactive-vscode/logo.svg" width="14"> is modified from [Vue Reactivity Artworks](https://github.com/vue-reactivity/art). Licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-nc-sa/4.0/).
|
|
95
95
|
|
|
96
96
|
Part of the docs website is ported from [VueUse](https://github.com/vueuse/vueuse). Licensed under a [MIT License](https://github.com/vueuse/vueuse/blob/main/LICENSE).
|
|
97
97
|
|
|
@@ -103,7 +103,7 @@ Part of the docs website is ported from [VueUse](https://github.com/vueuse/vueus
|
|
|
103
103
|
[npm-downloads-href]: https://npmjs.com/package/reactive-vscode
|
|
104
104
|
[bundle-src]: https://img.shields.io/bundlephobia/minzip/reactive-vscode?style=flat&colorA=080f12&colorB=1fa669&label=minzip
|
|
105
105
|
[bundle-href]: https://bundlephobia.com/result?p=reactive-vscode
|
|
106
|
-
[license-src]: https://img.shields.io/github/license/
|
|
106
|
+
[license-src]: https://img.shields.io/github/license/kermanx/reactive-vscode.svg?style=flat&colorA=080f12&colorB=1fa669
|
|
107
107
|
[license-href]: https://github.com/kermanx/reactive-vscode/blob/main/LICENSE
|
|
108
108
|
[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
|
|
109
109
|
[jsdocs-href]: https://www.jsdocs.io/package/reactive-vscode
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@reactive-vscode/reactivity"),s=require("vscode");function L(e){return n.getCurrentScope()?(n.onScopeDispose(e),!0):!1}function E(e,t){const o=new Map;return(...a)=>{const i=t(...a);let c=o.get(i);return c?c.refCount++:(c={data:e(...a),refCount:1},o.set(i,c)),L(()=>{--c.refCount===0&&o.delete(i)}),c.data}}function g(e){let t=!1,o;return()=>(t||(o=n.effectScope(!0).run(e),t=!0),o)}const k=[];function G(e){k.push(e)}const C=n.shallowRef(null),T=n.effectScope();function J(e){return{activate:t=>(C.value=t,T.run(()=>(y.map(o=>o(t)),e(t)))),deactivate:()=>{k.map(t=>t()),T.stop()}}}const y=[];function O(e){C.value?e(C.value):y.push(e)}function M(e,t,o){const a=!e,i=s.workspace.getConfiguration(a?void 0:e,o);function c(r,f){const l=n.shallowRef(f),w=n.computed({get:()=>l.value,set:v=>{l.value=v,i.update(r,v)}});return w.update=async(v,h,m)=>{await i.update(r,v,h,m),w.value=v},w.set=v=>{l.value=v},w}const u=Object.fromEntries(Object.keys(t).map(r=>[r,c(r,i.get(r))]));return O(()=>{d(s.workspace.onDidChangeConfiguration(a?r=>{const f=s.workspace.getConfiguration();for(const l in t)r.affectsConfiguration(l)&&u[l].set(f.get(l))}:r=>{if(!r.affectsConfiguration(e))return;const f=s.workspace.getConfiguration(e);for(const l in t)r.affectsConfiguration(`${e}.${l}`)&&u[l].set(f.get(l))}))}),u}function X(e,t,o){const a=M(e,t,o),i={},c=n.shallowReactive({$update(u,r,f,l){return a[u].update(r,f,l)},$set(u,r){return a[u].set(r)}});for(const u in t){const r=u.split(".");let f="",l=i,w=c;for(const h of r.slice(0,-1)){f=f?`${f}.${h}`:h;const m=l=l[h]||(l[h]={});if(w[h])w=w[h];else{const W=n.shallowReactive({});Object.defineProperty(w,h,{enumerable:!0,get(){return W},set(Y){function F(S,x,V){if(S)for(const D in S)F(S[D],x?`${x}.${D}`:D,V==null?void 0:V[D]);else a[x].value=V}F(m,f,Y)}}),w=W}}const v=r[r.length-1];l[v]=null,Object.defineProperty(w,v,{enumerable:!0,get(){return a[u].value},set(h){a[u].value=h}})}return c}function Z(e,t){const o=n.shallowRef(null),a=[],i=c=>(...u)=>o.value?o.value[c](...u):(a.push([c,u]),null);return O(()=>{o.value=K(e,t);for(const[c,u]of a)o.value[c](...u)}),{logger:o,outputChannel:n.computed(()=>{var c;return(c=o.value)==null?void 0:c.outputChannel}),info:i("info"),warn:i("warn"),error:i("error"),append:i("append"),appendLine:i("appendLine"),replace:i("replace"),clear:i("clear"),show:i("show"),hide:i("hide")}}function _(e,...t){return s.commands.executeCommand(e,...t)}function ee(e,t=!1){const o=C.value;if(!o&&!t)throw new Error("Cannot get absolute path because the extension is not activated yet");return o==null?void 0:o.asAbsolutePath(e)}function te(e,t=!1){return n.computed(()=>ee(n.toValue(e),t))}function d(e){return(n.getCurrentScope()??T).cleanups.push(e.dispose.bind(e)),e}const N=g(()=>{const e=n.shallowRef(s.window.activeColorTheme);return d(s.window.onDidChangeActiveColorTheme(t=>{e.value=t})),e}),ne=g(()=>{const e=n.shallowRef(s.debug.activeDebugSession);return d(s.debug.onDidChangeActiveDebugSession(t=>{e.value=t})),n.computed(()=>e.value)}),$=g(()=>{const e=n.shallowRef(s.window.activeTextEditor);return d(s.window.onDidChangeActiveTextEditor(t=>{e.value=t})),e});function j(e){var o;const t=n.shallowRef((o=n.toValue(e))==null?void 0:o.getText());return n.watchEffect(()=>{var a;t.value=(a=n.toValue(e))==null?void 0:a.getText()}),d(s.workspace.onDidChangeTextDocument(a=>{a.document===n.toValue(e)&&(t.value=a.document.getText())})),t}function H(e,t,o,a={}){const{updateOn:i=["effect","documentChanged"]}=a;let c;const u=n.computed(()=>{c==null||c.dispose(),c=void 0;const l=n.toValue(t);if("key"in l)return l;const w=s.window.createTextEditorDecorationType(l);return c=d(w),w}),r=async()=>{const l=n.toValue(e);l&&l.setDecorations(u.value,typeof o=="function"?await o(l):n.toValue(o))},f=i.includes("documentChanged")?j(()=>{var l;return(l=n.toValue(e))==null?void 0:l.document}):null;return i.includes("effect")?n.watchEffect(async()=>{f==null||f.value,await r()}):f&&n.watch(f,r),{update:r}}function oe(e,t,o={}){const a=$();return H(a,e,t,o)}const ae=g(()=>{const e=n.shallowRef(s.window.activeNotebookEditor);return d(s.window.onDidChangeActiveNotebookEditor(t=>{e.value=t})),e}),ie=g(()=>{const e=n.shallowRef(s.window.activeTerminal);return d(s.window.onDidChangeActiveTerminal(t=>{e.value=t})),e}),se=g(()=>{const e=n.shallowRef(s.extensions.all);return d(s.extensions.onDidChange(()=>{e.value=s.extensions.all})),n.computed(()=>e.value)});function b(e,t){const o=(a,i,c)=>{d(e(a,i,c))};return t==null||t.forEach(a=>o(a)),o}function P(e,t,o){for(const a of o){const i=t[a];i!==void 0&&n.watchEffect(()=>{e[a]=n.toValue(i)})}}const ue=E((e,t,o={})=>{const a=d(s.chat.createChatParticipant(e,n.unref(t)));return P(a,o,["iconPath"]),o.followupProvider!==void 0&&n.watchEffect(()=>{a.followupProvider=n.unref(o.followupProvider)}),n.watchEffect(()=>{a.requestHandler=n.unref(t)}),{onDidReceiveFeedback:b(a.onDidReceiveFeedback)}},e=>e);function B(e,t){d(s.commands.registerCommand(e,t))}function ce(e){for(const[t,o]of Object.entries(e))o&&B(t,o)}function re(e,t){return d(s.comments.createCommentController(e,t))}function A(e){var o;const t=n.shallowRef((o=n.toValue(e))==null?void 0:o.state);return n.watch(e,()=>{var a;t.value=(a=n.toValue(e))==null?void 0:a.state}),d(s.window.onDidChangeTerminalState(a=>{a===n.toValue(e)&&(t.value=a.state)})),n.computed(()=>t.value)}function le(...e){const t=n.ref(null);function o(){return!!t.value&&t.value.exitStatus==null}function a(){return o()?t.value:t.value=s.window.createTerminal(...e)}function i(r){a().sendText(r)}function c(){a().show()}function u(){o()&&(t.value.sendText(""),t.value.dispose(),t.value=null)}return n.onScopeDispose(u),{terminal:t,getIsActive:o,show:c,sendText:i,close:u,state:A(t)}}const de=g(()=>{const e=n.shallowRef(s.env.shell);return d(s.env.onDidChangeShell(t=>{e.value=t})),n.computed(()=>e.value)});function p(e,t=[]){const o=Array.isArray(e)?e:t??[],a=d(Array.isArray(e)||e==null?new s.EventEmitter:e),i=b(a.event,o);for(const c of o)i(c);return{event:a.event,fire:a.fire.bind(a),addListener:i}}async function fe(e){const t=C.value.secrets,o=n.ref(await t.get(e));return o.set=async a=>{o.value=a,await t.store(e,a)},o.remove=async()=>{o.value=void 0,await t.delete(e)},d(t.onDidChange(async a=>{a.key===e&&(o.value=await t.get(e))})),n.watch(o,a=>{a===void 0?t.delete(e):t.store(e,a)}),o}function ve(e){return n.computed(()=>s.tasks.fetchTasks(n.toValue(e)))}function we(e){return n.computed(()=>s.Uri.file(n.toValue(e)))}function he(e,t){const o=new s.EventEmitter,a=n.shallowRef();n.watchEffect(()=>{a.value&&o.fire(),a.value=n.toValue(t)}),d(s.languages.registerFoldingRangeProvider(e,{onDidChangeFoldingRanges:o.event,provideFoldingRanges(i,c,u){var r;return(r=a.value)==null?void 0:r.call(a,i,c,u)}}))}function ge(e,t,o,a){const i=n.shallowReactive(new Map),c=p(),u=p(),r=p(),f=n.computed(()=>{const v=n.toValue(e);return Array.isArray(v)?v:v instanceof Set?Array.from(v):[v]});function l(){const v=f.value;for(const[h,m]of i)v.includes(h)||(m.dispose(),i.delete(h));for(const h of v)if(!i.has(h)){const m=s.workspace.createFileSystemWatcher(h,n.toValue(t)||!1,n.toValue(o)||!1,n.toValue(a)||!1);m.onDidCreate(c.fire),m.onDidChange(u.fire),m.onDidDelete(r.fire),i.set(h,m)}}function w(){for(const v of i.values())v.dispose();i.clear()}return l(),n.watch(f,l),n.watch(()=>[n.toValue(t),n.toValue(o),n.toValue(a)],()=>{w(),l()}),n.onScopeDispose(w),{watchers:i,onDidCreate:c.event,onDidChange:u.event,onDidDelete:r.event}}const me=g(()=>{const e=N();return n.computed(()=>e.value.kind===s.ColorThemeKind.Dark||e.value.kind===s.ColorThemeKind.HighContrast)}),be=g(()=>{const e=n.shallowRef(s.env.isTelemetryEnabled);return d(s.env.onDidChangeTelemetryEnabled(t=>{e.value=t})),n.computed(()=>e.value)});function Ce(e,...t){return n.computed(()=>typeof t[0]=="object"?s.l10n.t(n.toValue(e),n.toRaw(t[0])):s.l10n.t(n.toValue(e),...t.map(n.toValue)))}const pe=g(()=>{const e=n.shallowRef(s.lm.tools);return d(s.lm.onDidChangeChatModels(()=>{e.value=s.lm.tools})),n.computed(()=>e.value)});function q(e,t){return d(s.window.createOutputChannel(e,t))}function Ve(e){const t=new Date,o=String(t.getFullYear()).padStart(4,"0"),a=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),c=String(t.getHours()).padStart(2,"0"),u=String(t.getMinutes()).padStart(2,"0"),r=String(t.getSeconds()).padStart(2,"0"),f=String(t.getMilliseconds()).padStart(3,"0");return`${o}-${a}-${i} ${c}:${u}:${r}.${f} [${e}] `}function K(e,t={}){const o=t.outputChannel??q(e,{log:!0}),a=i=>(...c)=>{var u;o.appendLine((((u=t.getPrefix)==null?void 0:u.call(t,i))??"")+c.join(" "))};return{outputChannel:o,createLoggerFunc:a,info:a("INFO"),warn:a("WARN"),error:a("ERROR"),append:o.append.bind(o),appendLine:o.appendLine.bind(o),replace:o.replace.bind(o),clear:o.clear.bind(o),show:o.show.bind(o),hide:o.hide.bind(o)}}const De=g(()=>{const e=n.shallowRef(s.env.logLevel);return d(s.env.onDidChangeLogLevel(t=>{e.value=t})),n.computed(()=>e.value)});function Q(e){var o;const t=n.shallowRef(((o=n.toValue(e))==null?void 0:o.selections)??[]);return n.watch(e,()=>{var a;t.value=((a=n.toValue(e))==null?void 0:a.selections)??[]}),d(s.window.onDidChangeNotebookEditorSelection(a=>{a.notebookEditor===n.toValue(e)&&(t.value=a.selections)})),n.computed({get(){return t.value},set(a){t.value=a;const i=n.toValue(e);i&&(i.selections=a)}})}function Te(e){const t=Q(e);return n.computed({get(){return t.value[0]},set(o){t.value=t.value.toSpliced(0,1,o)}})}function Ee(e){var o;const t=n.shallowRef(((o=n.toValue(e))==null?void 0:o.visibleRanges)??[]);return n.watch(e,()=>{var a;t.value=((a=n.toValue(e))==null?void 0:a.visibleRanges)??[]}),d(s.window.onDidChangeNotebookEditorVisibleRanges(a=>{a.notebookEditor===n.toValue(e)&&(t.value=a.visibleRanges)})),n.computed(()=>t.value)}const Re=g(()=>{const e=n.shallowRef(s.window.terminals);function t(){e.value=s.window.terminals}return d(s.window.onDidOpenTerminal(t)),d(s.window.onDidCloseTerminal(t)),e});function Se(e={}){const t=d(s.window.createQuickPick()),o=b(t.onDidChangeActive),a=b(t.onDidChangeSelection),i=b(t.onDidAccept),c=b(t.onDidHide),u=b(t.onDidTriggerButton),r=b(t.onDidChangeValue);["items","buttons","title","step","totalSteps","enabled","busy","ignoreFocusOut","placeholder","canSelectMany","matchOnDescription","matchOnDetail","keepScrollPosition"].forEach(v=>{e[v]&&n.watchEffect(()=>t[v]=n.toValue(e[v]))}),e.value&&(t.value=e.value);const f=n.shallowRef(t.value);r(v=>f.value=v),e.activeItems&&(t.activeItems=e.activeItems);const l=n.shallowRef(t.activeItems);o(v=>l.value=v),e.selectedItems&&(t.selectedItems=e.selectedItems);const w=n.shallowRef(t.selectedItems);return a(v=>w.value=v),{...t,onDidChangeActive:o,onDidChangeSelection:a,onDidAccept:i,onDidHide:c,onDidTriggerButton:u,onDidChangeValue:r,value:f,activeItems:l,selectedItems:w}}function xe(e){const t=d(e.id?s.window.createStatusBarItem(e.id,e.alignment,e.priority):s.window.createStatusBarItem(e.alignment,e.priority));return P(t,e,["name","text","tooltip","color","backgroundColor","command","accessibilityInformation"]),e.visible!=null?n.watchEffect(()=>{n.toValue(e.visible)?t.show():t.hide()}):t.show(),t}const ke=g(()=>{const e=n.shallowRef(s.tasks.taskExecutions);function t(){e.value=s.tasks.taskExecutions}return d(s.tasks.onDidStartTask(t)),d(s.tasks.onDidEndTask(t)),n.computed(()=>e.value)});function ye(...e){const t=d(s.window.createTerminal(...e));return{terminal:t,get name(){return t.name},get processId(){return t.processId},get creationOptions(){return t.creationOptions},get exitStatus(){return t.exitStatus},get shellIntegration(){return t.shellIntegration},sendText:t.sendText.bind(t),show:t.show.bind(t),hide:t.hide.bind(t),state:A(t)}}function U(e,t){d(s.commands.registerTextEditorCommand(e,t))}function Oe(e){for(const[t,o]of Object.entries(e))U(t,o)}function z(e,t){var a;const o=n.shallowRef(((a=n.toValue(e))==null?void 0:a.selections)??[]);return n.watch(e,()=>{var i;o.value=((i=n.toValue(e))==null?void 0:i.selections)??[]}),d(s.window.onDidChangeTextEditorSelection(i=>{const c=n.toValue(e),u=n.toValue(t);i.textEditor===c&&(!u||u.includes(i.kind))&&(o.value=i.selections)})),n.computed({get(){return o.value},set(i){o.value=i;const c=n.toValue(e);c&&(c.selections=i)}})}function Pe(e,t){const o=z(e,t);return n.computed({get(){return o.value[0]},set(a){o.value=o.value.toSpliced(0,1,a)}})}function Ae(e){var o;const t=n.shallowRef((o=n.toValue(e))==null?void 0:o.viewColumn);return n.watch(e,()=>{var a;t.value=(a=n.toValue(e))==null?void 0:a.viewColumn}),d(s.window.onDidChangeTextEditorViewColumn(a=>{a.textEditor===n.toValue(e)&&(t.value=a.viewColumn)})),n.computed(()=>t.value)}function Ie(e){var o;const t=n.shallowRef(((o=n.toValue(e))==null?void 0:o.visibleRanges)??[]);return n.watch(e,()=>{var a;t.value=((a=n.toValue(e))==null?void 0:a.visibleRanges)??[]}),d(s.window.onDidChangeTextEditorVisibleRanges(a=>{a.textEditor===n.toValue(e)&&(t.value=a.visibleRanges)})),n.computed(()=>t.value)}function I(e,t){n.watchEffect(()=>{const o=n.toValue(e);o&&(o.badge=n.toValue(t))})}function R(e,t){n.watchEffect(()=>{const o=n.toValue(e);o&&(o.title=n.toValue(t))})}const We=E((e,t,o)=>{const a=p();n.watch(t,()=>a.fire()),o!=null&&o.watchSource&&n.watch(o.watchSource,()=>a.fire());const i=new WeakMap,c=d(s.window.createTreeView(e,{...o,treeDataProvider:{...o,onDidChangeTreeData:a.event,getTreeItem(u){return u.treeItem},async getChildren(u){if(u){const r=await u.children;return r==null||r.forEach(f=>i.set(f,u)),r}return n.toValue(t)},getParent(u){return i.get(u)}}}));return o!=null&&o.title&&R(c,o.title),o!=null&&o.badge&&I(c,o.badge),c},e=>e);function Fe(e){var a;const t=n.ref((a=n.toValue(e))==null?void 0:a.visible);function o(){var i;t.value=(i=n.toValue(e))==null?void 0:i.visible}return n.watchEffect(i=>{const c=n.toValue(e);if(c){const u=c.onDidChangeVisibility(o);i(()=>u.dispose())}}),n.watchEffect(o),n.computed(()=>!!t.value)}const Le=g(()=>{const e=n.shallowRef(s.window.visibleNotebookEditors);return d(s.window.onDidChangeVisibleNotebookEditors(t=>{e.value=t})),e}),Me=g(()=>{const e=n.shallowRef(s.window.visibleTextEditors);return d(s.window.onDidChangeVisibleTextEditors(t=>{e.value=t})),e});function Ne(e,t,o=!0){const a=n.isRef(t)?t:typeof t=="function"?n.computed(t):n.ref(t);return n.watchEffect(()=>{n.toValue(o)&&s.commands.executeCommand("setContext",e,a.value)}),a}function $e(e,t,o,a,i){const c=n.shallowRef(),u=d(s.window.createWebviewPanel(e,n.toValue(t),a,{enableFindWidget:i==null?void 0:i.enableFindWidget,retainContextWhenHidden:i==null?void 0:i.retainContextWhenHidden,...n.toValue(i==null?void 0:i.webviewOptions)}));i!=null&&i.onDidReceiveMessage&&u.webview.onDidReceiveMessage(i.onDidReceiveMessage);const r=n.ref(0);function f(){r.value++}if(n.watchEffect(()=>{u.webview.html=`${n.toValue(o)}<!--${r.value}-->`}),i!=null&&i.webviewOptions){const h=i.webviewOptions;n.watchEffect(()=>{u.webview.options=n.toValue(h)})}R(u,t);function l(h){return u.webview.postMessage(h)}const w=n.ref(u.active),v=n.ref(u.visible);return d(u.onDidChangeViewState(()=>{w.value=u.active,v.value=u.visible})),{panel:u,context:c,active:w,visible:v,postMessage:l,forceRefresh:f}}const je=E((e,t,o)=>{const a=n.shallowRef(),i=n.shallowRef();d(s.window.registerWebviewViewProvider(e,{resolveWebviewView(f,l){a.value=f,i.value=l,o!=null&&o.onDidReceiveMessage&&f.webview.onDidReceiveMessage(o.onDidReceiveMessage)}},{webviewOptions:{retainContextWhenHidden:o==null?void 0:o.retainContextWhenHidden}}));const c=n.ref(0);function u(){c.value++}if(n.watchEffect(()=>{a.value&&(a.value.webview.html=`${n.toValue(t)}<!--${c.value}-->`)}),o!=null&&o.webviewOptions){const f=o.webviewOptions;n.watchEffect(()=>{a.value&&(a.value.webview.options=n.toValue(f))})}o!=null&&o.title&&R(a,o.title),o!=null&&o.badge&&I(a,o.badge);function r(f){var l;return(l=a.value)==null?void 0:l.webview.postMessage(f)}return{view:a,context:i,postMessage:r,forceRefresh:u}},e=>e),He=g(()=>{const e=n.shallowRef(s.window.state);return d(s.window.onDidChangeWindowState(t=>{e.value=t})),{focused:n.computed(()=>e.value.focused),active:n.computed(()=>e.value.active)}}),Be=g(()=>{const e=n.shallowRef(s.workspace.workspaceFolders);return d(s.workspace.onDidChangeWorkspaceFolders(()=>{e.value=s.workspace.workspaceFolders})),n.computed(()=>e.value)});exports.activateCbs=y;exports.createKeyedComposable=E;exports.createSingletonComposable=g;exports.deactivateCbs=k;exports.defineConfigObject=X;exports.defineConfigs=M;exports.defineExtension=J;exports.defineLogger=Z;exports.executeCommand=_;exports.extensionContext=C;exports.extensionScope=T;exports.getDefaultLoggerPrefix=Ve;exports.onActivate=O;exports.onDeactivate=G;exports.tryOnScopeDispose=L;exports.useAbsolutePath=te;exports.useActiveColorTheme=N;exports.useActiveDebugSession=ne;exports.useActiveEditorDecorations=oe;exports.useActiveNotebookEditor=ae;exports.useActiveTerminal=ie;exports.useActiveTextEditor=$;exports.useAllExtensions=se;exports.useChatParticipant=ue;exports.useCommand=B;exports.useCommands=ce;exports.useCommentController=re;exports.useControlledTerminal=le;exports.useDefaultShell=de;exports.useDisposable=d;exports.useDocumentText=j;exports.useEditorDecorations=H;exports.useEvent=b;exports.useEventEmitter=p;exports.useExtensionSecret=fe;exports.useFetchTasks=ve;exports.useFileUri=we;exports.useFoldingRangeProvider=he;exports.useFsWatcher=ge;exports.useIsDarkTheme=me;exports.useIsTelemetryEnabled=be;exports.useL10nText=Ce;exports.useLmTools=pe;exports.useLogLevel=De;exports.useLogger=K;exports.useNotebookEditorSelection=Te;exports.useNotebookEditorSelections=Q;exports.useNotebookEditorVisibleRanges=Ee;exports.useOpenedTerminals=Re;exports.useOutputChannel=q;exports.useQuickPick=Se;exports.useReactiveOptions=P;exports.useStatusBarItem=xe;exports.useTaskExecutions=ke;exports.useTerminal=ye;exports.useTerminalState=A;exports.useTextEditorCommand=U;exports.useTextEditorCommands=Oe;exports.useTextEditorSelection=Pe;exports.useTextEditorSelections=z;exports.useTextEditorViewColumn=Ae;exports.useTextEditorVisibleRanges=Ie;exports.useTreeView=We;exports.useViewBadge=I;exports.useViewTitle=R;exports.useViewVisibility=Fe;exports.useVisibleNotebookEditors=Le;exports.useVisibleTextEditors=Me;exports.useVscodeContext=Ne;exports.useWebviewPanel=$e;exports.useWebviewView=je;exports.useWindowState=He;exports.useWorkspaceFolders=Be;Object.keys(n).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>n[e]})});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@reactive-vscode/reactivity"),i=require("vscode");function L(e){return n.getCurrentScope()?(n.onScopeDispose(e),!0):!1}function D(e,t){const o=new Map;return(...a)=>{const s=t(...a);let c=o.get(s);return c?c.refCount++:(c={data:e(...a),refCount:1},o.set(s,c)),L(()=>{--c.refCount===0&&o.delete(s)}),c.data}}function g(e){let t=!1,o;return()=>(t||(o=n.effectScope(!0).run(e),t=!0),o)}const S=[];function G(e){S.push(e)}const b=n.shallowRef(null),T=n.effectScope();function J(e){return{activate:t=>(b.value=t,T.run(()=>(k.map(o=>o(t)),e(t)))),deactivate:()=>{S.map(t=>t()),T.stop()}}}const k=[];function y(e){b.value?e(b.value):k.push(e)}function M(e,t,o){const a=!e,s=i.workspace.getConfiguration(a?void 0:e,o);function c(l,f){const d=n.shallowRef(f),w=n.computed({get:()=>d.value,set:v=>{d.value=v,s.update(l,v)}});return w.update=async(v,h,m)=>{await s.update(l,v,h,m),d.value=v},w.set=v=>{d.value=v},w}const u=Object.fromEntries(Object.keys(t).map(l=>[l,c(l,s.get(l))]));return y(()=>{r(i.workspace.onDidChangeConfiguration(a?l=>{const f=i.workspace.getConfiguration();for(const d in t)l.affectsConfiguration(d)&&u[d].set(f.get(d))}:l=>{if(!l.affectsConfiguration(e))return;const f=i.workspace.getConfiguration(e);for(const d in t)l.affectsConfiguration(`${e}.${d}`)&&u[d].set(f.get(d))}))}),u}function X(e,t,o){const a=M(e,t,o),s={},c=n.shallowReactive({$update(u,l,f,d){return a[u].update(l,f,d)},$set(u,l){return a[u].set(l)}});for(const u in t){const l=u.split(".");let f="",d=s,w=c;for(const h of l.slice(0,-1)){f=f?`${f}.${h}`:h;const m=d=d[h]||={};if(w[h])w=w[h];else{const I=n.shallowReactive({});Object.defineProperty(w,h,{enumerable:!0,get(){return I},set(Y){function W(x,R,F){if(x)for(const V in x)W(x[V],R?`${R}.${V}`:V,F?.[V]);else a[R].value=F}W(m,f,Y)}}),w=I}}const v=l[l.length-1];d[v]=null,Object.defineProperty(w,v,{enumerable:!0,get(){return a[u].value},set(h){a[u].value=h}})}return c}function Z(e,t){const o=n.shallowRef(null),a=[],s=c=>(...u)=>o.value?o.value[c](...u):(a.push([c,u]),null);return y(()=>{o.value=q(e,t);for(const[c,u]of a)o.value[c](...u)}),{logger:o,outputChannel:n.computed(()=>o.value?.outputChannel),info:s("info"),warn:s("warn"),error:s("error"),append:s("append"),appendLine:s("appendLine"),replace:s("replace"),clear:s("clear"),show:s("show"),hide:s("hide")}}function _(e,...t){return i.commands.executeCommand(e,...t)}function ee(e,t=!1){const o=b.value;if(!o&&!t)throw new Error("Cannot get absolute path because the extension is not activated yet");return o?.asAbsolutePath(e)}function te(e,t=!1){return n.computed(()=>ee(n.toValue(e),t))}function r(e){return(n.getCurrentScope()??T).cleanups.push(e.dispose.bind(e)),e}const N=g(()=>{const e=n.shallowRef(i.window.activeColorTheme);return r(i.window.onDidChangeActiveColorTheme(t=>{e.value=t})),e}),ne=g(()=>{const e=n.shallowRef(i.debug.activeDebugSession);return r(i.debug.onDidChangeActiveDebugSession(t=>{e.value=t})),n.computed(()=>e.value)}),$=g(()=>{const e=n.shallowRef(i.window.activeTextEditor);return r(i.window.onDidChangeActiveTextEditor(t=>{e.value=t})),e});function j(e){const t=n.shallowRef(n.toValue(e)?.getText());return n.watchEffect(()=>{t.value=n.toValue(e)?.getText()}),r(i.workspace.onDidChangeTextDocument(o=>{o.document===n.toValue(e)&&(t.value=o.document.getText())})),t}function H(e,t,o,a={}){const{updateOn:s=["effect","documentChanged"]}=a;let c;const u=n.computed(()=>{c?.dispose(),c=void 0;const d=n.toValue(t);if("key"in d)return d;const w=i.window.createTextEditorDecorationType(d);return c=r(w),w}),l=async()=>{const d=n.toValue(e);d&&d.setDecorations(u.value,typeof o=="function"?await o(d):n.toValue(o))},f=s.includes("documentChanged")?j(()=>n.toValue(e)?.document):null;return s.includes("effect")?n.watchEffect(async()=>{f?.value,await l()}):f&&n.watch(f,l),{update:l}}function oe(e,t,o={}){const a=$();return H(a,e,t,o)}const ae=g(()=>{const e=n.shallowRef(i.window.activeNotebookEditor);return r(i.window.onDidChangeActiveNotebookEditor(t=>{e.value=t})),e}),ie=g(()=>{const e=n.shallowRef(i.window.activeTerminal);return r(i.window.onDidChangeActiveTerminal(t=>{e.value=t})),e}),se=g(()=>{const e=n.shallowRef(i.extensions.all);return r(i.extensions.onDidChange(()=>{e.value=i.extensions.all})),n.computed(()=>e.value)});function p(e,t){const o=(a,s,c)=>{r(e(a,s,c))};return t?.forEach(a=>o(a)),o}function O(e,t,o){for(const a of o){const s=t[a];s!==void 0&&n.watchEffect(()=>{e[a]=n.toValue(s)})}}const ue=D((e,t,o={})=>{const a=r(i.chat.createChatParticipant(e,n.unref(t)));return O(a,o,["iconPath"]),o.followupProvider!==void 0&&n.watchEffect(()=>{a.followupProvider=n.unref(o.followupProvider)}),n.watchEffect(()=>{a.requestHandler=n.unref(t)}),{onDidReceiveFeedback:p(a.onDidReceiveFeedback)}},e=>e);function B(e,t){r(i.commands.registerCommand(e,t))}function ce(e){for(const[t,o]of Object.entries(e))o&&B(t,o)}function re(e,t){return r(i.comments.createCommentController(e,t))}function P(e){const t=n.shallowRef(n.toValue(e)?.state);return n.watch(e,()=>{t.value=n.toValue(e)?.state}),r(i.window.onDidChangeTerminalState(o=>{o===n.toValue(e)&&(t.value=o.state)})),n.computed(()=>t.value)}function le(...e){const t=n.ref(null);function o(){return!!t.value&&t.value.exitStatus==null}function a(){return o()?t.value:t.value=i.window.createTerminal(...e)}function s(l){a().sendText(l)}function c(){a().show()}function u(){o()&&(t.value.sendText(""),t.value.dispose(),t.value=null)}return n.onScopeDispose(u),{terminal:t,getIsActive:o,show:c,sendText:s,close:u,state:P(t)}}const de=g(()=>{const e=n.shallowRef(i.env.shell);return r(i.env.onDidChangeShell(t=>{e.value=t})),n.computed(()=>e.value)});function C(e,t=[]){const o=Array.isArray(e)?e:t??[],a=r(Array.isArray(e)||e==null?new i.EventEmitter:e),s=p(a.event,o);for(const c of o)s(c);return{event:a.event,fire:a.fire.bind(a),addListener:s}}async function fe(e){const t=b.value.secrets,o=n.ref(await t.get(e));return o.set=async a=>{o.value=a,await t.store(e,a)},o.remove=async()=>{o.value=void 0,await t.delete(e)},r(t.onDidChange(async a=>{a.key===e&&(o.value=await t.get(e))})),n.watch(o,a=>{a===void 0?t.delete(e):t.store(e,a)}),o}function ve(e){return n.computed(()=>i.tasks.fetchTasks(n.toValue(e)))}function we(e){return n.computed(()=>i.Uri.file(n.toValue(e)))}function he(e,t){const o=new i.EventEmitter,a=n.shallowRef();n.watchEffect(()=>{a.value&&o.fire(),a.value=n.toValue(t)}),r(i.languages.registerFoldingRangeProvider(e,{onDidChangeFoldingRanges:o.event,provideFoldingRanges(s,c,u){return a.value?.(s,c,u)}}))}function ge(e,t,o,a){const s=n.shallowReactive(new Map),c=C(),u=C(),l=C(),f=n.computed(()=>{const v=n.toValue(e);return Array.isArray(v)?v:v instanceof Set?Array.from(v):[v]});function d(){const v=f.value;for(const[h,m]of s)v.includes(h)||(m.dispose(),s.delete(h));for(const h of v)if(!s.has(h)){const m=i.workspace.createFileSystemWatcher(h,n.toValue(t)||!1,n.toValue(o)||!1,n.toValue(a)||!1);m.onDidCreate(c.fire),m.onDidChange(u.fire),m.onDidDelete(l.fire),s.set(h,m)}}function w(){for(const v of s.values())v.dispose();s.clear()}return d(),n.watch(f,d),n.watch(()=>[n.toValue(t),n.toValue(o),n.toValue(a)],()=>{w(),d()}),n.onScopeDispose(w),{watchers:s,onDidCreate:c.event,onDidChange:u.event,onDidDelete:l.event}}const me=g(()=>{const e=N();return n.computed(()=>e.value.kind===i.ColorThemeKind.Dark||e.value.kind===i.ColorThemeKind.HighContrast)}),pe=g(()=>{const e=n.shallowRef(i.env.isTelemetryEnabled);return r(i.env.onDidChangeTelemetryEnabled(t=>{e.value=t})),n.computed(()=>e.value)});function be(e,...t){return n.computed(()=>typeof t[0]=="object"?i.l10n.t(n.toValue(e),n.toRaw(t[0])):i.l10n.t(n.toValue(e),...t.map(n.toValue)))}const Ce=g(()=>{const e=n.shallowRef(i.lm.tools);return r(i.lm.onDidChangeChatModels(()=>{e.value=i.lm.tools})),n.computed(()=>e.value)});function K(e,t){return r(i.window.createOutputChannel(e,t))}function Ve(e){const t=new Date,o=String(t.getFullYear()).padStart(4,"0"),a=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0"),c=String(t.getHours()).padStart(2,"0"),u=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0"),f=String(t.getMilliseconds()).padStart(3,"0");return`${o}-${a}-${s} ${c}:${u}:${l}.${f} [${e}] `}function q(e,t={}){const o=t.outputChannel??K(e,{log:!0}),a=s=>(...c)=>{o.appendLine((t.getPrefix?.(s)??"")+c.join(" "))};return{outputChannel:o,createLoggerFunc:a,info:a("INFO"),warn:a("WARN"),error:a("ERROR"),append:o.append.bind(o),appendLine:o.appendLine.bind(o),replace:o.replace.bind(o),clear:o.clear.bind(o),show:o.show.bind(o),hide:o.hide.bind(o)}}const Te=g(()=>{const e=n.shallowRef(i.env.logLevel);return r(i.env.onDidChangeLogLevel(t=>{e.value=t})),n.computed(()=>e.value)});function Q(e){const t=n.shallowRef(n.toValue(e)?.selections??[]);return n.watch(e,()=>{t.value=n.toValue(e)?.selections??[]}),r(i.window.onDidChangeNotebookEditorSelection(o=>{o.notebookEditor===n.toValue(e)&&(t.value=o.selections)})),n.computed({get(){return t.value},set(o){t.value=o;const a=n.toValue(e);a&&(a.selections=o)}})}function De(e){const t=Q(e);return n.computed({get(){return t.value[0]},set(o){t.value=t.value.toSpliced(0,1,o)}})}function Ee(e){const t=n.shallowRef(n.toValue(e)?.visibleRanges??[]);return n.watch(e,()=>{t.value=n.toValue(e)?.visibleRanges??[]}),r(i.window.onDidChangeNotebookEditorVisibleRanges(o=>{o.notebookEditor===n.toValue(e)&&(t.value=o.visibleRanges)})),n.computed(()=>t.value)}const xe=g(()=>{const e=n.shallowRef(i.window.terminals);function t(){e.value=i.window.terminals}return r(i.window.onDidOpenTerminal(t)),r(i.window.onDidCloseTerminal(t)),e});function Re(e={}){const t=r(i.window.createQuickPick()),o=p(t.onDidChangeActive),a=p(t.onDidChangeSelection),s=p(t.onDidAccept),c=p(t.onDidHide),u=p(t.onDidTriggerButton),l=p(t.onDidChangeValue);["items","buttons","title","step","totalSteps","enabled","busy","ignoreFocusOut","placeholder","canSelectMany","matchOnDescription","matchOnDetail","keepScrollPosition"].forEach(v=>{e[v]&&n.watchEffect(()=>t[v]=n.toValue(e[v]))}),e.value&&(t.value=e.value);const f=n.shallowRef(t.value);l(v=>f.value=v),e.activeItems&&(t.activeItems=e.activeItems);const d=n.shallowRef(t.activeItems);o(v=>d.value=v),e.selectedItems&&(t.selectedItems=e.selectedItems);const w=n.shallowRef(t.selectedItems);return a(v=>w.value=v),{...t,onDidChangeActive:o,onDidChangeSelection:a,onDidAccept:s,onDidHide:c,onDidTriggerButton:u,onDidChangeValue:l,value:f,activeItems:d,selectedItems:w}}function Se(e){const t=r(e.id?i.window.createStatusBarItem(e.id,e.alignment,e.priority):i.window.createStatusBarItem(e.alignment,e.priority));return O(t,e,["name","text","tooltip","color","backgroundColor","command","accessibilityInformation"]),e.visible!=null?n.watchEffect(()=>{n.toValue(e.visible)?t.show():t.hide()}):t.show(),t}const ke=g(()=>{const e=n.shallowRef(i.tasks.taskExecutions);function t(){e.value=i.tasks.taskExecutions}return r(i.tasks.onDidStartTask(t)),r(i.tasks.onDidEndTask(t)),n.computed(()=>e.value)});function ye(...e){const t=r(i.window.createTerminal(...e));return{terminal:t,get name(){return t.name},get processId(){return t.processId},get creationOptions(){return t.creationOptions},get exitStatus(){return t.exitStatus},get shellIntegration(){return t.shellIntegration},sendText:t.sendText.bind(t),show:t.show.bind(t),hide:t.hide.bind(t),state:P(t)}}function U(e,t){r(i.commands.registerTextEditorCommand(e,t))}function Oe(e){for(const[t,o]of Object.entries(e))U(t,o)}function z(e,t){const o=n.shallowRef(n.toValue(e)?.selections??[]);return n.watch(e,()=>{o.value=n.toValue(e)?.selections??[]}),r(i.window.onDidChangeTextEditorSelection(a=>{const s=n.toValue(e),c=n.toValue(t);a.textEditor===s&&(!c||c.includes(a.kind))&&(o.value=a.selections)})),n.computed({get(){return o.value},set(a){o.value=a;const s=n.toValue(e);s&&(s.selections=a)}})}function Pe(e,t){const o=z(e,t);return n.computed({get(){return o.value[0]},set(a){o.value=o.value.toSpliced(0,1,a)}})}function Ae(e){const t=n.shallowRef(n.toValue(e)?.viewColumn);return n.watch(e,()=>{t.value=n.toValue(e)?.viewColumn}),r(i.window.onDidChangeTextEditorViewColumn(o=>{o.textEditor===n.toValue(e)&&(t.value=o.viewColumn)})),n.computed(()=>t.value)}function Ie(e){const t=n.shallowRef(n.toValue(e)?.visibleRanges??[]);return n.watch(e,()=>{t.value=n.toValue(e)?.visibleRanges??[]}),r(i.window.onDidChangeTextEditorVisibleRanges(o=>{o.textEditor===n.toValue(e)&&(t.value=o.visibleRanges)})),n.computed(()=>t.value)}function A(e,t){n.watchEffect(()=>{const o=n.toValue(e);o&&(o.badge=n.toValue(t))})}function E(e,t){n.watchEffect(()=>{const o=n.toValue(e);o&&(o.title=n.toValue(t))})}const We=D((e,t,o)=>{const a=C();n.watch(t,()=>a.fire()),o?.watchSource&&n.watch(o.watchSource,()=>a.fire());const s=new WeakMap,c=r(i.window.createTreeView(e,{...o,treeDataProvider:{...o,onDidChangeTreeData:a.event,getTreeItem(u){return u.treeItem},async getChildren(u){if(u){const l=await u.children;return l?.forEach(f=>s.set(f,u)),l}return n.toValue(t)},getParent(u){return s.get(u)}}}));return o?.title&&E(c,o.title),o?.badge&&A(c,o.badge),c},e=>e);function Fe(e){const t=n.ref(n.toValue(e)?.visible);function o(){t.value=n.toValue(e)?.visible}return n.watchEffect(a=>{const s=n.toValue(e);if(s){const c=s.onDidChangeVisibility(o);a(()=>c.dispose())}}),n.watchEffect(o),n.computed(()=>!!t.value)}const Le=g(()=>{const e=n.shallowRef(i.window.visibleNotebookEditors);return r(i.window.onDidChangeVisibleNotebookEditors(t=>{e.value=t})),e}),Me=g(()=>{const e=n.shallowRef(i.window.visibleTextEditors);return r(i.window.onDidChangeVisibleTextEditors(t=>{e.value=t})),e});function Ne(e,t,o=!0){const a=n.isRef(t)?t:typeof t=="function"?n.computed(t):n.ref(t);return n.watchEffect(()=>{n.toValue(o)&&i.commands.executeCommand("setContext",e,a.value)}),a}function $e(e,t,o,a,s){const c=n.shallowRef(),u=r(i.window.createWebviewPanel(e,n.toValue(t),a,{enableFindWidget:s?.enableFindWidget,retainContextWhenHidden:s?.retainContextWhenHidden,...n.toValue(s?.webviewOptions)}));s?.onDidReceiveMessage&&u.webview.onDidReceiveMessage(s.onDidReceiveMessage);const l=n.ref(0);function f(){l.value++}if(n.watchEffect(()=>{u.webview.html=`${n.toValue(o)}<!--${l.value}-->`}),s?.webviewOptions){const h=s.webviewOptions;n.watchEffect(()=>{u.webview.options=n.toValue(h)})}E(u,t);function d(h){return u.webview.postMessage(h)}const w=n.ref(u.active),v=n.ref(u.visible);return r(u.onDidChangeViewState(()=>{w.value=u.active,v.value=u.visible})),{panel:u,context:c,active:w,visible:v,postMessage:d,forceRefresh:f}}const je=D((e,t,o)=>{const a=n.shallowRef(),s=n.shallowRef();r(i.window.registerWebviewViewProvider(e,{resolveWebviewView(f,d){a.value=f,s.value=d,o?.onDidReceiveMessage&&f.webview.onDidReceiveMessage(o.onDidReceiveMessage)}},{webviewOptions:{retainContextWhenHidden:o?.retainContextWhenHidden}}));const c=n.ref(0);function u(){c.value++}if(n.watchEffect(()=>{a.value&&(a.value.webview.html=`${n.toValue(t)}<!--${c.value}-->`)}),o?.webviewOptions){const f=o.webviewOptions;n.watchEffect(()=>{a.value&&(a.value.webview.options=n.toValue(f))})}o?.title&&E(a,o.title),o?.badge&&A(a,o.badge);function l(f){return a.value?.webview.postMessage(f)}return{view:a,context:s,postMessage:l,forceRefresh:u}},e=>e),He=g(()=>{const e=n.shallowRef(i.window.state);return r(i.window.onDidChangeWindowState(t=>{e.value=t})),{focused:n.computed(()=>e.value.focused),active:n.computed(()=>e.value.active)}}),Be=g(()=>{const e=n.shallowRef(i.workspace.workspaceFolders);return r(i.workspace.onDidChangeWorkspaceFolders(()=>{e.value=i.workspace.workspaceFolders})),n.computed(()=>e.value)});exports.activateCbs=k;exports.createKeyedComposable=D;exports.createSingletonComposable=g;exports.deactivateCbs=S;exports.defineConfigObject=X;exports.defineConfigs=M;exports.defineExtension=J;exports.defineLogger=Z;exports.executeCommand=_;exports.extensionContext=b;exports.extensionScope=T;exports.getDefaultLoggerPrefix=Ve;exports.onActivate=y;exports.onDeactivate=G;exports.tryOnScopeDispose=L;exports.useAbsolutePath=te;exports.useActiveColorTheme=N;exports.useActiveDebugSession=ne;exports.useActiveEditorDecorations=oe;exports.useActiveNotebookEditor=ae;exports.useActiveTerminal=ie;exports.useActiveTextEditor=$;exports.useAllExtensions=se;exports.useChatParticipant=ue;exports.useCommand=B;exports.useCommands=ce;exports.useCommentController=re;exports.useControlledTerminal=le;exports.useDefaultShell=de;exports.useDisposable=r;exports.useDocumentText=j;exports.useEditorDecorations=H;exports.useEvent=p;exports.useEventEmitter=C;exports.useExtensionSecret=fe;exports.useFetchTasks=ve;exports.useFileUri=we;exports.useFoldingRangeProvider=he;exports.useFsWatcher=ge;exports.useIsDarkTheme=me;exports.useIsTelemetryEnabled=pe;exports.useL10nText=be;exports.useLmTools=Ce;exports.useLogLevel=Te;exports.useLogger=q;exports.useNotebookEditorSelection=De;exports.useNotebookEditorSelections=Q;exports.useNotebookEditorVisibleRanges=Ee;exports.useOpenedTerminals=xe;exports.useOutputChannel=K;exports.useQuickPick=Re;exports.useReactiveOptions=O;exports.useStatusBarItem=Se;exports.useTaskExecutions=ke;exports.useTerminal=ye;exports.useTerminalState=P;exports.useTextEditorCommand=U;exports.useTextEditorCommands=Oe;exports.useTextEditorSelection=Pe;exports.useTextEditorSelections=z;exports.useTextEditorViewColumn=Ae;exports.useTextEditorVisibleRanges=Ie;exports.useTreeView=We;exports.useViewBadge=A;exports.useViewTitle=E;exports.useViewVisibility=Fe;exports.useVisibleNotebookEditors=Le;exports.useVisibleTextEditors=Me;exports.useVscodeContext=Ne;exports.useWebviewPanel=$e;exports.useWebviewView=je;exports.useWindowState=He;exports.useWorkspaceFolders=Be;Object.keys(n).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>n[e]})});
|
package/dist/index.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ export declare type ConfigObject<C extends object> = UnwrapNestedRefs<C> & {
|
|
|
87
87
|
*
|
|
88
88
|
* @see https://code.visualstudio.com/api/references/vscode-api#WorkspaceConfiguration.update
|
|
89
89
|
*/
|
|
90
|
-
$update: (key: keyof C, value: C[keyof C], configurationTarget?:
|
|
90
|
+
$update: (key: keyof C, value: C[keyof C], configurationTarget?: ConfigurationTarget | boolean | null, overrideInLanguage?: boolean) => Promise<void>;
|
|
91
91
|
/**
|
|
92
92
|
* Set the value without updating the workspace.
|
|
93
93
|
*/
|
|
@@ -672,6 +672,10 @@ export declare function useQuickPick<T extends QuickPickItem>(options?: QuickPic
|
|
|
672
672
|
dispose(): void;
|
|
673
673
|
};
|
|
674
674
|
|
|
675
|
+
/**
|
|
676
|
+
* Set multiple reactive options on a target object.
|
|
677
|
+
* @category utilities
|
|
678
|
+
*/
|
|
675
679
|
export declare function useReactiveOptions<T extends object>(target: T, options: {
|
|
676
680
|
[K in keyof T]?: MaybeRefOrGetter<T[K]>;
|
|
677
681
|
}, keys: (keyof T)[]): void;
|