Files
code_tool_fly/VSCode-win32-x64-1.74.0/resources/app/extensions/references-view/dist/extension.js
T

2 lines
26 KiB
JavaScript
Raw Normal View History

2025-05-09 16:55:09 +08:00
(()=>{"use strict";var e={515:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.register=void 0;const s=i(549),n=i(682),r=i(901);function o(e){e instanceof r.CallItem&&e.remove()}t.register=function(e,t){const i=new a(t.workspaceState,0);function n(t,n){let o;i.value=t;const a=e.getInput();n instanceof r.CallItem?o=new r.CallsTreeInput(new s.Location(n.item.uri,n.item.selectionRange.start),i.value):a instanceof r.CallsTreeInput&&(o=new r.CallsTreeInput(a.location,i.value)),o&&e.setInput(o)}t.subscriptions.push(s.commands.registerCommand("references-view.showCallHierarchy",(function(){if(s.window.activeTextEditor){const t=new r.CallsTreeInput(new s.Location(s.window.activeTextEditor.document.uri,s.window.activeTextEditor.selection.active),i.value);e.setInput(t)}})),s.commands.registerCommand("references-view.showOutgoingCalls",(e=>n(1,e))),s.commands.registerCommand("references-view.showIncomingCalls",(e=>n(0,e))),s.commands.registerCommand("references-view.removeCallItem",o))};class a{constructor(e,t=1){this.c=e,this.d=t,this.b=new n.ContextKey("references-view.callHierarchyMode");const i=e.get(a.a);this.value="number"==typeof i&&i>=0&&i<=1?i:t}get value(){return this.d}set value(e){this.d=e,this.b.set(0===this.d?"showIncoming":"showOutgoing"),this.c.update(a.a,e)}}a.a="references-view.callHierarchyMode"},901:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CallItem=t.CallsTreeInput=void 0;const s=i(549),n=i(682);class r{constructor(e,t){this.location=e,this.direction=t,this.contextValue="callHierarchy",this.title=0===t?s.l10n.t("Callers Of"):s.l10n.t("Calls From")}async resolve(){const e=await Promise.resolve(s.commands.executeCommand("vscode.prepareCallHierarchy",this.location.uri,this.location.range.start)),t=new a(this.direction,e??[]),i=new c(t);if(0!==t.roots.length)return{provider:i,get message(){return 0===t.roots.length?s.l10n.t("No results."):void 0},navigation:t,highlights:t,dnd:t,dispose(){i.dispose()}}}with(e){return new r(e,this.direction)}}t.CallsTreeInput=r;class o{constructor(e,t,i,s){this.model=e,this.item=t,this.parent=i,this.locations=s}remove(){this.model.remove(this)}}t.CallItem=o;class a{constructor(e,t){this.direction=e,this.roots=[],this.a=new s.EventEmitter,this.onDidChange=this.a.event,this.roots=t.map((e=>new o(this,e,void 0,void 0)))}async b(e){if(0===this.direction){const t=await s.commands.executeCommand("vscode.provideIncomingCalls",e.item);return t?t.map((t=>new o(this,t.from,e,t.fromRanges.map((e=>new s.Location(t.from.uri,e)))))):[]}{const t=await s.commands.executeCommand("vscode.provideOutgoingCalls",e.item);return t?t.map((t=>new o(this,t.to,e,t.fromRanges.map((t=>new s.Location(e.item.uri,t)))))):[]}}async getCallChildren(e){return e.children||(e.children=await this.b(e)),e.children}location(e){return new s.Location(e.item.uri,e.item.range)}nearest(e,t){return this.roots.find((t=>t.item.uri.toString()===e.toString()))??this.roots[0]}next(e){return this.c(e,!0)??e}previous(e){return this.c(e,!1)??e}c(e,t){if(e.children?.length)return t?e.children[0]:(0,n.tail)(e.children);const i=this.roots.includes(e)?this.roots:e.parent?.children;if(i?.length){const s=i.indexOf(e);return i[s+(t?1:-1)+i.length%i.length]}}getDragUri(e){return(0,n.asResourceUrl)(e.item.uri,e.item.range)}getEditorHighlights(e,t){return e.locations?e.locations.filter((e=>e.uri.toString()===t.toString())).map((e=>e.range)):e.item.uri.toString()===t.toString()?[e.item.selectionRange]:void 0}remove(e){const t=this.roots.includes(e)?this.roots:e.parent?.children;t&&((0,n.del)(t,e),this.a.fire(this))}}class c{constructor(e){this.c=e,this.a=new s.EventEmitter,this.onDidChangeTreeData=this.a.event,this.b=e.onDidChange((e=>this.a.fire(e instanceof o?e:void 0)))}dispose(){this.a.dispose(),this.b.dispose()}getTreeItem(e){const t=new s.TreeItem(e.item.name);return t.description=e.item.detail,t.tooltip=t.label?`${t.label} - ${e.item.detail}`:e.item.detail,t.contextValue="call-item",t.iconPath=(0,n.getThemeIcon)(e.item.kind),t.command={command:"vscode.open",title:s.l10n.t("Open Call"),arguments:[e.item.uri,{s
//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/5235c6bb189b60b01b1f49062f4ffa42384f8c91/extensions/references-view/dist/extension.js.map