@codingame/monaco-vscode-references-view-default-extension 19.1.3 → 20.0.0
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/index.js +3 -3
- package/package.json +2 -2
- package/resources/extension.js +1 -1
- package/resources/extension.js.map +1 -1
package/index.js
CHANGED
|
@@ -4,9 +4,9 @@ var manifest = {name:"references-view",displayName:"%displayName%",description:"
|
|
|
4
4
|
|
|
5
5
|
const { registerFileUrl, whenReady } = registerExtension(manifest, undefined, {"system":true,"readmePath":"README.md"});
|
|
6
6
|
registerFileUrl('README.md', new URL('./resources/README.md', import.meta.url).toString(), {"mimeType":"text/markdown","size":1961});
|
|
7
|
-
registerFileUrl('dist/extension', new URL('./resources/extension.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":
|
|
8
|
-
registerFileUrl('dist/extension.js', new URL('./resources/extension.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":
|
|
9
|
-
registerFileUrl('dist/extension.js.map', new URL('./resources/extension.js.map', import.meta.url).toString(), {"mimeType":"application/json","size":
|
|
7
|
+
registerFileUrl('dist/extension', new URL('./resources/extension.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":37287});
|
|
8
|
+
registerFileUrl('dist/extension.js', new URL('./resources/extension.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":37287});
|
|
9
|
+
registerFileUrl('dist/extension.js.map', new URL('./resources/extension.js.map', import.meta.url).toString(), {"mimeType":"application/json","size":95096});
|
|
10
10
|
registerFileUrl('media/demo.png', new URL('./resources/demo.png', import.meta.url).toString(), {"mimeType":"image/png","size":412116});
|
|
11
11
|
registerFileUrl('media/icon.png', new URL('./resources/icon.png', import.meta.url).toString(), {"mimeType":"image/png","size":5762});
|
|
12
12
|
registerFileUrl('package.json', new URL('./resources/package.json', import.meta.url).toString(), {"mimeType":"application/json","size":8877});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-references-view-default-extension",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@codingame/monaco-vscode-api": "
|
|
21
|
+
"@codingame/monaco-vscode-api": "20.0.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/resources/extension.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var e={475:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.register=function(e,t){const i=new h(t.workspaceState,0);function n(t,n){let r;i.value=t;const o=e.getInput();n instanceof l.CallItem?r=new l.CallsTreeInput(new a.Location(n.item.uri,n.item.selectionRange.start),i.value):o instanceof l.CallsTreeInput&&(r=new l.CallsTreeInput(o.location,i.value)),r&&e.setInput(r)}t.subscriptions.push(a.commands.registerCommand("references-view.showCallHierarchy",(function(){if(a.window.activeTextEditor){const t=new l.CallsTreeInput(new a.Location(a.window.activeTextEditor.document.uri,a.window.activeTextEditor.selection.active),i.value);e.setInput(t)}})),a.commands.registerCommand("references-view.showOutgoingCalls",(e=>n(1,e))),a.commands.registerCommand("references-view.showIncomingCalls",(e=>n(0,e))),a.commands.registerCommand("references-view.removeCallItem",u))};const a=s(i(398)),c=i(376),l=i(170);function u(e){e instanceof l.CallItem&&e.remove()}class h{constructor(e,t=1){this._mem=e,this._value=t,this._ctxMode=new c.ContextKey("references-view.callHierarchyMode");const i=e.get(h._key);this.value="number"==typeof i&&i>=0&&i<=1?i:t}get value(){return this._value}set value(e){this._value=e,this._ctxMode.set(0===this._value?"showIncoming":"showOutgoing"),this._mem.update(h._key,e)}}h._key="references-view.callHierarchyMode"},170:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.CallItem=t.CallsTreeInput=void 0;const a=s(i(398)),c=i(376);class l{constructor(e,t){this.location=e,this.direction=t,this.contextValue="callHierarchy",this.title=0===t?a.l10n.t("Callers Of"):a.l10n.t("Calls From")}async resolve(){const e=await Promise.resolve(a.commands.executeCommand("vscode.prepareCallHierarchy",this.location.uri,this.location.range.start)),t=new h(this.direction,e??[]),i=new d(t);if(0!==t.roots.length)return{provider:i,get message(){return 0===t.roots.length?a.l10n.t("No results."):void 0},navigation:t,highlights:t,dnd:t,dispose(){i.dispose()}}}with(e){return new l(e,this.direction)}}t.CallsTreeInput=l;class u{constructor(e,t,i,n){this.model=e,this.item=t,this.parent=i,this.locations=n}remove(){this.model.remove(this)}}t.CallItem=u;class h{constructor(e,t){this.direction=e,this.roots=[],this._onDidChange=new a.EventEmitter,this.onDidChange=this._onDidChange.event,this.roots=t.map((e=>new u(this,e,void 0,void 0)))}async _resolveCalls(e){if(0===this.direction){const t=await a.commands.executeCommand("vscode.provideIncomingCalls",e.item);return t?t.map((t=>new u(this,t.from,e,t.fromRanges.map((e=>new a.Location(t.from.uri,e)))))):[]}{const t=await a.commands.executeCommand("vscode.provideOutgoingCalls",e.item);return t?t.map((t=>new u(this,t.to,e,t.fromRanges.map((t=>new a.Location(e.item.uri,t)))))):[]}}async getCallChildren(e){return e.children||(e.children=await this._resolveCalls(e)),e.children}location(e){return new a.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._move(e,!0)??e}previous(e){return this._move(e,!1)??e}_move(e,t){if(e.children?.length)return t?e.children[0]:(0,c.tail)(e.children);const i=this.roots.includes(e)?this.roots:e.parent?.children;if(i?.length){const n=i.indexOf(e);return i[n+(t?1:-1)+i.length%i.length]}}getDragUri(e){return(0,c.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,c.del)(t,e),this._onDidChange.fire(this))}}class d{constructor(e){this._model=e,this._emitter=new a.EventEmitter,this.onDidChangeTreeData=this._emitter.event,this._modelListener=e.onDidChange((e=>this._emitter.fire(e instanceof u?e:void 0)))}dispose(){this._emitter.dispose(),this._modelListener.dispose()}getTreeItem(e){const t=new a.TreeItem(e.item.name);let i;if(t.description=e.item.detail,t.tooltip=t.label&&e.item.detail?`${t.label} - ${e.item.detail}`:t.label?`${t.label}`:e.item.detail,t.contextValue="call-item",t.iconPath=(0,c.getThemeIcon)(e.item.kind),1===e.model.direction)i=[e.item.uri,{selection:e.item.selectionRange.with({end:e.item.selectionRange.start})}];else{let t;if(e.locations)for(const i of e.locations)i.uri.toString()===e.item.uri.toString()&&(t=t?.isBefore(i.range.start)?t:i.range.start);t||(t=e.item.selectionRange.start),i=[e.item.uri,{selection:new a.Range(t,t)}]}return t.command={command:"vscode.open",title:a.l10n.t("Open Call"),arguments:i},t.collapsibleState=a.TreeItemCollapsibleState.Collapsed,t}getChildren(e){return e?this._model.getCallChildren(e):this._model.roots}getParent(e){return e.parent}}},256:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.activate=function(e){const t=new l.SymbolsTree;return c.register(t,e),a.register(t,e),u.register(t,e),{setInput:function(e){t.setInput(e)},getInput:function(){return t.getInput()}}};const a=s(i(475)),c=s(i(464)),l=i(541),u=s(i(227))},76:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.EditorHighlights=void 0;const a=s(i(398));t.EditorHighlights=class{constructor(e,t){this._view=e,this._delegate=t,this._decorationType=a.window.createTextEditorDecorationType({backgroundColor:new a.ThemeColor("editor.findMatchHighlightBackground"),rangeBehavior:a.DecorationRangeBehavior.ClosedClosed,overviewRulerLane:a.OverviewRulerLane.Center,overviewRulerColor:new a.ThemeColor("editor.findMatchHighlightBackground")}),this.disposables=[],this._ignore=new Set,this.disposables.push(a.workspace.onDidChangeTextDocument((e=>this._ignore.add(e.document.uri.toString()))),a.window.onDidChangeActiveTextEditor((()=>e.visible&&this.update())),e.onDidChangeVisibility((e=>e.visible?this._show():this._hide())),e.onDidChangeSelection((()=>{e.visible&&this.update()}))),this._show()}dispose(){a.Disposable.from(...this.disposables).dispose();for(const e of a.window.visibleTextEditors)e.setDecorations(this._decorationType,[])}_show(){const{activeTextEditor:e}=a.window;if(!e||!e.viewColumn)return;if(this._ignore.has(e.document.uri.toString()))return;const[t]=this._view.selection;if(!t)return;const i=this._delegate.getEditorHighlights(t,e.document.uri);i&&e.setDecorations(this._decorationType,i)}_hide(){for(const e of a.window.visibleTextEditors)e.setDecorations(this._decorationType,[])}update(){this._hide(),this._show()}}},87:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.Navigation=void 0;const a=s(i(398)),c=i(376);t.Navigation=class{constructor(e){this._view=e,this._disposables=[],this._ctxCanNavigate=new c.ContextKey("references-view.canNavigate"),this._disposables.push(a.commands.registerCommand("references-view.next",(()=>this.next(!1))),a.commands.registerCommand("references-view.prev",(()=>this.previous(!1))))}dispose(){a.Disposable.from(...this._disposables).dispose()}update(e){this._delegate=e,this._ctxCanNavigate.set(Boolean(this._delegate))}_anchor(){if(!this._delegate)return;const[e]=this._view.selection;return e||(a.window.activeTextEditor?this._delegate.nearest(a.window.activeTextEditor.document.uri,a.window.activeTextEditor.selection.active):void 0)}_open(e,t){a.commands.executeCommand("vscode.open",e.uri,{selection:new a.Selection(e.range.start,e.range.start),preserveFocus:t})}previous(e){if(!this._delegate)return;const t=this._anchor();if(!t)return;const i=this._delegate.previous(t),n=this._delegate.location(i);n&&(this._view.reveal(i,{select:!0,focus:!0}),this._open(n,e))}next(e){if(!this._delegate)return;const t=this._anchor();if(!t)return;const i=this._delegate.next(t),n=this._delegate.location(i);n&&(this._view.reveal(i,{select:!0,focus:!0}),this._open(n,e))}}},464:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.register=function(e,t){function i(t,i){if(a.window.activeTextEditor){const n=new c.ReferencesTreeInput(t,new a.Location(a.window.activeTextEditor.document.uri,a.window.activeTextEditor.selection.active),i);e.setInput(n)}}let n;t.subscriptions.push(a.commands.registerCommand("references-view.findReferences",(()=>i("References","vscode.executeReferenceProvider"))),a.commands.registerCommand("references-view.findImplementations",(()=>i("Implementations","vscode.executeImplementationProvider"))),a.commands.registerCommand("references-view.find",((...e)=>a.commands.executeCommand("references-view.findReferences",...e))),a.commands.registerCommand("references-view.removeReferenceItem",u),a.commands.registerCommand("references-view.copy",h),a.commands.registerCommand("references-view.copyAll",l),a.commands.registerCommand("references-view.copyPath",d));const r="references.preferredLocation";function o(t){if(t&&!t.affectsConfiguration(r))return;const i=a.workspace.getConfiguration().get(r);n?.dispose(),n=void 0,"view"===i&&(n=a.commands.registerCommand("editor.action.showReferences",(async(t,i,n)=>{const r=new c.ReferencesTreeInput(a.l10n.t("References"),new a.Location(t,i),"vscode.executeReferenceProvider",n);e.setInput(r)})))}t.subscriptions.push(a.workspace.onDidChangeConfiguration(o)),t.subscriptions.push({dispose:()=>n?.dispose()}),o()};const a=s(i(398)),c=i(769),l=async e=>{e instanceof c.ReferenceItem?h(e.file.model):e instanceof c.FileItem&&h(e.model)};function u(e){(e instanceof c.FileItem||e instanceof c.ReferenceItem)&&e.remove()}async function h(e){let t;(e instanceof c.ReferencesModel||e instanceof c.ReferenceItem||e instanceof c.FileItem)&&(t=await e.asCopyText()),t&&await a.env.clipboard.writeText(t)}async function d(e){e instanceof c.FileItem&&("file"===e.uri.scheme?a.env.clipboard.writeText(e.uri.fsPath):a.env.clipboard.writeText(e.uri.toString(!0)))}},769:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.ReferenceItem=t.FileItem=t.ReferencesModel=t.ReferencesTreeInput=void 0;const a=s(i(398)),c=i(376);class l{constructor(e,t,i,n){this.title=e,this.location=t,this._command=i,this._result=n,this.contextValue=i}async resolve(){let e;if(this._result)e=new u(this._result);else{const t=await Promise.resolve(a.commands.executeCommand(this._command,this.location.uri,this.location.range.start));e=new u(t??[])}if(0===e.items.length)return;const t=new h(e);return{provider:t,get message(){return e.message},navigation:e,highlights:e,dnd:e,dispose(){t.dispose()}}}with(e){return new l(this.title,e,this._command)}}t.ReferencesTreeInput=l;class u{constructor(e){let t;this._onDidChange=new a.EventEmitter,this.onDidChangeTreeData=this._onDidChange.event,this.items=[];for(const i of e.sort(u._compareLocations)){const e=i instanceof a.Location?i:new a.Location(i.targetUri,i.targetRange);t&&0===u._compareUriIgnoreFragment(t.uri,e.uri)||(t=new d(e.uri.with({fragment:""}),[],this),this.items.push(t)),t.references.push(new f(e,t))}}static _compareUriIgnoreFragment(e,t){const i=e.with({fragment:""}).toString(),n=t.with({fragment:""}).toString();return i<n?-1:i>n?1:0}static _compareLocations(e,t){const i=e instanceof a.Location?e.uri:e.targetUri,n=t instanceof a.Location?t.uri:t.targetUri;if(i.toString()<n.toString())return-1;if(i.toString()>n.toString())return 1;const r=e instanceof a.Location?e.range:e.targetRange,o=t instanceof a.Location?t.range:t.targetRange;return r.start.isBefore(o.start)?-1:r.start.isAfter(o.start)?1:0}get message(){if(0===this.items.length)return a.l10n.t("No results.");const e=this.items.reduce(((e,t)=>e+t.references.length),0),t=this.items.length;return 1===e&&1===t?a.l10n.t("{0} result in {1} file",e,t):1===e?a.l10n.t("{0} result in {1} files",e,t):1===t?a.l10n.t("{0} results in {1} file",e,t):a.l10n.t("{0} results in {1} files",e,t)}location(e){return e instanceof f?e.location:new a.Location(e.uri,e.references[0]?.location.range??new a.Position(0,0))}nearest(e,t){if(0===this.items.length)return;for(const i of this.items)if(i.uri.toString()===e.toString()){for(const e of i.references)if(e.location.range.contains(t))return e;let e;for(const n of i.references){if(n.location.range.end.isAfter(t))return n;e=n}if(e)return e;break}let i=0;const n=u._prefixLen(this.items[i].toString(),e.toString());for(let t=1;t<this.items.length;t++)u._prefixLen(this.items[t].uri.toString(),e.toString())>n&&(i=t);return this.items[i].references[0]}static _prefixLen(e,t){let i=0;for(;i<e.length&&i<t.length&&e.charCodeAt(i)===t.charCodeAt(i);)i+=1;return i}next(e){return this._move(e,!0)??e}previous(e){return this._move(e,!1)??e}_move(e,t){const i=t?1:-1,n=e=>{const t=(this.items.indexOf(e)+i+this.items.length)%this.items.length;return this.items[t]};if(e instanceof d)return t?n(e).references[0]:(0,c.tail)(n(e).references);if(e instanceof f){const t=e.file.references.indexOf(e)+i;return t<0?(0,c.tail)(n(e.file).references):t>=e.file.references.length?n(e.file).references[0]:e.file.references[t]}}getEditorHighlights(e,t){const i=this.items.find((e=>e.uri.toString()===t.toString()));return i?.references.map((e=>e.location.range))}remove(e){e instanceof d?((0,c.del)(this.items,e),this._onDidChange.fire(void 0)):((0,c.del)(e.file.references,e),0===e.file.references.length?((0,c.del)(this.items,e.file),this._onDidChange.fire(void 0)):this._onDidChange.fire(e.file))}async asCopyText(){let e="";for(const t of this.items)e+=`${await t.asCopyText()}\n`;return e}getDragUri(e){return e instanceof d?e.uri:(0,c.asResourceUrl)(e.file.uri,e.location.range)}}t.ReferencesModel=u;class h{constructor(e){this._model=e,this._onDidChange=new a.EventEmitter,this.onDidChangeTreeData=this._onDidChange.event,this._listener=e.onDidChangeTreeData((()=>this._onDidChange.fire(void 0)))}dispose(){this._onDidChange.dispose(),this._listener.dispose()}async getTreeItem(e){if(e instanceof d){const t=new a.TreeItem(e.uri);return t.contextValue="file-item",t.description=!0,t.iconPath=a.ThemeIcon.File,t.collapsibleState=a.TreeItemCollapsibleState.Collapsed,t}{const{range:t}=e.location,i=await e.getDocument(!0),{before:n,inside:r,after:o}=(0,c.getPreviewChunks)(i,t),s={label:n+r+o,highlights:[[n.length,n.length+r.length]]},l=new a.TreeItem(s);return l.collapsibleState=a.TreeItemCollapsibleState.None,l.contextValue="reference-item",l.command={command:"vscode.open",title:a.l10n.t("Open Reference"),arguments:[e.location.uri,{selection:t.with({end:t.start})}]},l}}async getChildren(e){return e?e instanceof d?e.references:void 0:this._model.items}getParent(e){return e instanceof f?e.file:void 0}}class d{constructor(e,t,i){this.uri=e,this.references=t,this.model=i}remove(){this.model.remove(this)}async asCopyText(){let e=`${a.workspace.asRelativePath(this.uri)}\n`;for(const t of this.references)e+=` ${await t.asCopyText()}\n`;return e}}t.FileItem=d;class f{constructor(e,t){this.location=e,this.file=t}async getDocument(e){if(this._document||(this._document=a.workspace.openTextDocument(this.location.uri)),e){const e=this.file.model.next(this.file);e instanceof d&&e!==this.file?a.workspace.openTextDocument(e.uri):e instanceof f&&a.workspace.openTextDocument(e.location.uri)}return this._document}remove(){this.file.model.remove(this)}async asCopyText(){const e=await this.getDocument(),t=(0,c.getPreviewChunks)(e,this.location.range,21,!1);return`${this.location.range.start.line+1}, ${this.location.range.start.character+1}: ${t.before+t.inside+t.after}`}}t.ReferenceItem=f},541:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.SymbolsTree=void 0;const a=s(i(398)),c=i(76),l=i(87),u=i(376);t.SymbolsTree=class{constructor(){this.viewId="references-view.tree",this._ctxIsActive=new u.ContextKey("reference-list.isActive"),this._ctxHasResult=new u.ContextKey("reference-list.hasResult"),this._ctxInputSource=new u.ContextKey("reference-list.source"),this._history=new m(this),this._provider=new h,this._dnd=new d,this._tree=a.window.createTreeView(this.viewId,{treeDataProvider:this._provider,showCollapseAll:!0,dragAndDropController:this._dnd}),this._navigation=new l.Navigation(this._tree)}dispose(){this._history.dispose(),this._tree.dispose(),this._sessionDisposable?.dispose()}getInput(){return this._input}async setInput(e){if(!await(0,u.isValidRequestPosition)(e.location.uri,e.location.range.start))return void this.clearInput();this._ctxInputSource.set(e.contextValue),this._ctxIsActive.set(!0),this._ctxHasResult.set(!0),a.commands.executeCommand(`${this.viewId}.focus`);const t=!this._input||Object.getPrototypeOf(this._input)!==Object.getPrototypeOf(e);this._input=e,this._sessionDisposable?.dispose(),this._tree.title=e.title,this._tree.message=t?void 0:this._tree.message;const i=Promise.resolve(e.resolve());this._provider.update(i.then((e=>e?.provider??this._history))),this._dnd.update(i.then((e=>e?.dnd)));const n=await i;if(this._input!==e)return;if(!n)return void this.clearInput();this._history.add(e),this._tree.message=n.message,this._navigation.update(n.navigation);const r=n.navigation?.nearest(e.location.uri,e.location.range.start);r&&this._tree.visible&&await this._tree.reveal(r,{select:!0,focus:!0,expand:!0});const o=[];let s;n.highlights&&(s=new c.EditorHighlights(this._tree,n.highlights),o.push(s)),n.provider.onDidChangeTreeData&&o.push(n.provider.onDidChangeTreeData((()=>{this._tree.title=e.title,this._tree.message=n.message,s?.update()}))),"function"==typeof n.dispose&&o.push(new a.Disposable((()=>n.dispose()))),this._sessionDisposable=a.Disposable.from(...o)}clearInput(){this._sessionDisposable?.dispose(),this._input=void 0,this._ctxHasResult.set(!1),this._ctxInputSource.reset(),this._tree.title=a.l10n.t("References"),this._tree.message=0===this._history.size?a.l10n.t("No results."):a.l10n.t("No results. Try running a previous search again:"),this._provider.update(Promise.resolve(this._history))}};class h{constructor(){this._onDidChange=new a.EventEmitter,this.onDidChangeTreeData=this._onDidChange.event}update(e){this._sessionDispoables?.dispose(),this._sessionDispoables=void 0,this._onDidChange.fire(void 0),this.provider=e,e.then((t=>{this.provider===e&&t.onDidChangeTreeData&&(this._sessionDispoables=t.onDidChangeTreeData(this._onDidChange.fire,this._onDidChange))})).catch((e=>{this.provider=void 0,console.error(e)}))}async getTreeItem(e){return this._assertProvider(),(await this.provider).getTreeItem(e)}async getChildren(e){return this._assertProvider(),(await this.provider).getChildren(e)}async getParent(e){this._assertProvider();const t=await this.provider;return t.getParent?t.getParent(e):void 0}_assertProvider(){if(!this.provider)throw new Error("MISSING provider")}}class d{constructor(){this.dropMimeTypes=[],this.dragMimeTypes=["text/uri-list"]}update(e){this._delegate=void 0,e.then((e=>this._delegate=e))}handleDrag(e,t){if(this._delegate){const i=[];for(const t of e){const e=this._delegate.getDragUri(t);e&&i.push(e.toString())}i.length>0&&t.set("text/uri-list",new a.DataTransferItem(i.join("\r\n")))}}handleDrop(){throw new Error("Method not implemented.")}}class f{constructor(e,t,i,n){this.key=e,this.word=t,this.anchor=i,this.input=n,this.description=`${a.workspace.asRelativePath(n.location.uri)} • ${n.title.toLocaleLowerCase()}`}}class m{constructor(e){this._tree=e,this._onDidChangeTreeData=new a.EventEmitter,this.onDidChangeTreeData=this._onDidChangeTreeData.event,this._disposables=[],this._ctxHasHistory=new u.ContextKey("reference-list.hasHistory"),this._inputs=new Map,this._disposables.push(a.commands.registerCommand("references-view.clear",(()=>e.clearInput())),a.commands.registerCommand("references-view.clearHistory",(()=>{this.clear(),e.clearInput()})),a.commands.registerCommand("references-view.refind",(e=>{e instanceof f&&this._reRunHistoryItem(e)})),a.commands.registerCommand("references-view.refresh",(()=>{const e=Array.from(this._inputs.values()).pop();e&&this._reRunHistoryItem(e)})),a.commands.registerCommand("_references-view.showHistoryItem",(async e=>{if(e instanceof f){const t=e.anchor.guessedTrackedPosition()??e.input.location.range.start;await a.commands.executeCommand("vscode.open",e.input.location.uri,{selection:new a.Range(t,t)})}})),a.commands.registerCommand("references-view.pickFromHistory",(async()=>{const e=(await this.getChildren()).map((e=>({label:e.word,description:e.description,item:e}))),t=await a.window.showQuickPick(e,{placeHolder:a.l10n.t("Select previous reference search")});t&&this._reRunHistoryItem(t.item)})))}dispose(){a.Disposable.from(...this._disposables).dispose(),this._onDidChangeTreeData.dispose()}_reRunHistoryItem(e){this._inputs.delete(e.key);const t=e.anchor.guessedTrackedPosition();let i=e.input;t&&!e.input.location.range.start.isEqual(t)&&(i=e.input.with(new a.Location(e.input.location.uri,t))),this._tree.setInput(i)}async add(e){const t=await a.workspace.openTextDocument(e.location.uri),i=new u.WordAnchor(t,e.location.range.start),n=t.getWordRangeAtPosition(e.location.range.start)??t.getWordRangeAtPosition(e.location.range.start,/[^\s]+/),r=n?t.getText(n):"???",o=new f(JSON.stringify([n?.start??e.location.range.start,e.location.uri,e.title]),r,i,e);this._inputs.delete(o.key),this._inputs.set(o.key,o),this._ctxHasHistory.set(!0)}clear(){this._inputs.clear(),this._ctxHasHistory.set(!1),this._onDidChangeTreeData.fire(void 0)}get size(){return this._inputs.size}getTreeItem(e){const t=new a.TreeItem(e.word);return t.description=e.description,t.command={command:"_references-view.showHistoryItem",arguments:[e],title:a.l10n.t("Rerun")},t.collapsibleState=a.TreeItemCollapsibleState.None,t.contextValue="history-item",t}getChildren(){return Promise.all([...this._inputs.values()].reverse())}getParent(){}}},227:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.register=function(e,t){const i=new h(t.workspaceState,"subtypes");function n(t,n){let r;i.value=t;const o=e.getInput();n instanceof l.TypeItem?r=new l.TypesTreeInput(new a.Location(n.item.uri,n.item.selectionRange.start),i.value):n instanceof a.Location?r=new l.TypesTreeInput(n,i.value):o instanceof l.TypesTreeInput&&(r=new l.TypesTreeInput(o.location,i.value)),r&&e.setInput(r)}t.subscriptions.push(a.commands.registerCommand("references-view.showTypeHierarchy",(function(){if(a.window.activeTextEditor){const t=new l.TypesTreeInput(new a.Location(a.window.activeTextEditor.document.uri,a.window.activeTextEditor.selection.active),i.value);e.setInput(t)}})),a.commands.registerCommand("references-view.showSupertypes",(e=>n("supertypes",e))),a.commands.registerCommand("references-view.showSubtypes",(e=>n("subtypes",e))),a.commands.registerCommand("references-view.removeTypeItem",u))};const a=s(i(398)),c=i(376),l=i(10);function u(e){e instanceof l.TypeItem&&e.remove()}class h{constructor(e,t="subtypes"){this._mem=e,this._value=t,this._ctxMode=new c.ContextKey("references-view.typeHierarchyMode");const i=e.get(h._key);this.value="string"==typeof i?i:t}get value(){return this._value}set value(e){this._value=e,this._ctxMode.set(e),this._mem.update(h._key,e)}}h._key="references-view.typeHierarchyMode"},10:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.TypeItem=t.TypesTreeInput=void 0;const a=s(i(398)),c=i(376);class l{constructor(e,t){this.location=e,this.direction=t,this.contextValue="typeHierarchy",this.title="supertypes"===t?a.l10n.t("Supertypes Of"):a.l10n.t("Subtypes Of")}async resolve(){const e=await Promise.resolve(a.commands.executeCommand("vscode.prepareTypeHierarchy",this.location.uri,this.location.range.start)),t=new h(this.direction,e??[]),i=new d(t);if(0!==t.roots.length)return{provider:i,get message(){return 0===t.roots.length?a.l10n.t("No results."):void 0},navigation:t,highlights:t,dnd:t,dispose(){i.dispose()}}}with(e){return new l(e,this.direction)}}t.TypesTreeInput=l;class u{constructor(e,t,i){this.model=e,this.item=t,this.parent=i}remove(){this.model.remove(this)}}t.TypeItem=u;class h{constructor(e,t){this.direction=e,this.roots=[],this._onDidChange=new a.EventEmitter,this.onDidChange=this._onDidChange.event,this.roots=t.map((e=>new u(this,e,void 0)))}async _resolveTypes(e){if("supertypes"===this.direction){const t=await a.commands.executeCommand("vscode.provideSupertypes",e.item);return t?t.map((t=>new u(this,t,e))):[]}{const t=await a.commands.executeCommand("vscode.provideSubtypes",e.item);return t?t.map((t=>new u(this,t,e))):[]}}async getTypeChildren(e){return e.children||(e.children=await this._resolveTypes(e)),e.children}getDragUri(e){return(0,c.asResourceUrl)(e.item.uri,e.item.range)}location(e){return new a.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._move(e,!0)??e}previous(e){return this._move(e,!1)??e}_move(e,t){if(e.children?.length)return t?e.children[0]:(0,c.tail)(e.children);const i=this.roots.includes(e)?this.roots:e.parent?.children;if(i?.length){const n=i.indexOf(e);return i[n+(t?1:-1)+i.length%i.length]}}getEditorHighlights(e,t){return 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,c.del)(t,e),this._onDidChange.fire(this))}}class d{constructor(e){this._model=e,this._emitter=new a.EventEmitter,this.onDidChangeTreeData=this._emitter.event,this._modelListener=e.onDidChange((e=>this._emitter.fire(e instanceof u?e:void 0)))}dispose(){this._emitter.dispose(),this._modelListener.dispose()}getTreeItem(e){const t=new a.TreeItem(e.item.name);return t.description=e.item.detail,t.contextValue="type-item",t.iconPath=(0,c.getThemeIcon)(e.item.kind),t.command={command:"vscode.open",title:a.l10n.t("Open Type"),arguments:[e.item.uri,{selection:e.item.selectionRange.with({end:e.item.selectionRange.start})}]},t.collapsibleState=a.TreeItemCollapsibleState.Collapsed,t}getChildren(e){return e?this._model.getTypeChildren(e):this._model.roots}getParent(e){return e.parent}}},376:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.WordAnchor=t.ContextKey=void 0,t.del=function(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)},t.tail=function(e){return e[e.length-1]},t.asResourceUrl=function(e,t){return e.with({fragment:`L${1+t.start.line},${1+t.start.character}-${1+t.end.line},${1+t.end.character}`})},t.isValidRequestPosition=async function(e,t){const i=await a.workspace.openTextDocument(e);let n=i.getWordRangeAtPosition(t);return n||(n=i.getWordRangeAtPosition(t,/[^\s]+/)),Boolean(n)},t.getPreviewChunks=function(e,t,i=8,n=!0){const r=t.start.with({character:Math.max(0,t.start.character-i)}),o=e.getWordRangeAtPosition(r);let s=e.getText(new a.Range(o?o.start:r,t.start));const c=e.getText(t),l=t.end.translate(0,331);let u=e.getText(new a.Range(t.end,l));return n&&(s=s.replace(/^\s*/g,""),u=u.replace(/\s*$/g,"")),{before:s,inside:c,after:u}},t.getThemeIcon=function(e){const t=c[e];return t?new a.ThemeIcon(t):void 0};const a=s(i(398));t.ContextKey=class{constructor(e){this.name=e}async set(e){await a.commands.executeCommand("setContext",this.name,e)}async reset(){await a.commands.executeCommand("setContext",this.name,void 0)}},t.WordAnchor=class{constructor(e,t){this._doc=e,this._position=t,this._version=e.version,this._word=this._getAnchorWord(e,t)}_getAnchorWord(e,t){const i=e.getWordRangeAtPosition(t)||e.getWordRangeAtPosition(t,/[^\s]+/);return i&&e.getText(i)}guessedTrackedPosition(){if(!this._word)return this._position;if(this._version===this._doc.version)return this._position;const e=this._getAnchorWord(this._doc,this._position);if(this._word===e)return this._position;const t=this._position.line;let i,n,r=0;do{if(n=!1,i=t+r,i<this._doc.lineCount){n=!0;const e=this._doc.lineAt(i).text.indexOf(this._word);if(e>=0)return new a.Position(i,e)}if(r+=1,i=t-r,i>=0){n=!0;const e=this._doc.lineAt(i).text.indexOf(this._word);if(e>=0)return new a.Position(i,e)}}while(r<100&&n);return this._position}};const c=["symbol-file","symbol-module","symbol-namespace","symbol-package","symbol-class","symbol-method","symbol-property","symbol-field","symbol-constructor","symbol-enum","symbol-interface","symbol-function","symbol-variable","symbol-constant","symbol-string","symbol-number","symbol-boolean","symbol-array","symbol-object","symbol-key","symbol-null","symbol-enum-member","symbol-struct","symbol-event","symbol-operator","symbol-type-parameter"]},398:e=>{e.exports=require("vscode")}},t={},i=function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}(256),n=exports;for(var r in i)n[r]=i[r];i.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
|
|
1
|
+
(()=>{"use strict";var e={10:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.TypeItem=t.TypesTreeInput=void 0;const a=s(i(398)),c=i(376);class l{constructor(e,t){this.location=e,this.direction=t,this.contextValue="typeHierarchy",this.title="supertypes"===t?a.l10n.t("Supertypes Of"):a.l10n.t("Subtypes Of")}async resolve(){const e=await Promise.resolve(a.commands.executeCommand("vscode.prepareTypeHierarchy",this.location.uri,this.location.range.start)),t=new h(this.direction,e??[]),i=new d(t);if(0!==t.roots.length)return{provider:i,get message(){return 0===t.roots.length?a.l10n.t("No results."):void 0},navigation:t,highlights:t,dnd:t,dispose(){i.dispose()}}}with(e){return new l(e,this.direction)}}t.TypesTreeInput=l;class u{constructor(e,t,i){this.model=e,this.item=t,this.parent=i}remove(){this.model.remove(this)}}t.TypeItem=u;class h{constructor(e,t){this.direction=e,this.roots=[],this._onDidChange=new a.EventEmitter,this.onDidChange=this._onDidChange.event,this.roots=t.map(e=>new u(this,e,void 0))}async _resolveTypes(e){if("supertypes"===this.direction){const t=await a.commands.executeCommand("vscode.provideSupertypes",e.item);return t?t.map(t=>new u(this,t,e)):[]}{const t=await a.commands.executeCommand("vscode.provideSubtypes",e.item);return t?t.map(t=>new u(this,t,e)):[]}}async getTypeChildren(e){return e.children||(e.children=await this._resolveTypes(e)),e.children}getDragUri(e){return(0,c.asResourceUrl)(e.item.uri,e.item.range)}location(e){return new a.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._move(e,!0)??e}previous(e){return this._move(e,!1)??e}_move(e,t){if(e.children?.length)return t?e.children[0]:(0,c.tail)(e.children);const i=this.roots.includes(e)?this.roots:e.parent?.children;if(i?.length){const n=i.indexOf(e);return i[n+(t?1:-1)+i.length%i.length]}}getEditorHighlights(e,t){return 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,c.del)(t,e),this._onDidChange.fire(this))}}class d{constructor(e){this._model=e,this._emitter=new a.EventEmitter,this.onDidChangeTreeData=this._emitter.event,this._modelListener=e.onDidChange(e=>this._emitter.fire(e instanceof u?e:void 0))}dispose(){this._emitter.dispose(),this._modelListener.dispose()}getTreeItem(e){const t=new a.TreeItem(e.item.name);return t.description=e.item.detail,t.contextValue="type-item",t.iconPath=(0,c.getThemeIcon)(e.item.kind),t.command={command:"vscode.open",title:a.l10n.t("Open Type"),arguments:[e.item.uri,{selection:e.item.selectionRange.with({end:e.item.selectionRange.start})}]},t.collapsibleState=a.TreeItemCollapsibleState.Collapsed,t}getChildren(e){return e?this._model.getTypeChildren(e):this._model.roots}getParent(e){return e.parent}}},76:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.EditorHighlights=void 0;const a=s(i(398));t.EditorHighlights=class{constructor(e,t){this._view=e,this._delegate=t,this._decorationType=a.window.createTextEditorDecorationType({backgroundColor:new a.ThemeColor("editor.findMatchHighlightBackground"),rangeBehavior:a.DecorationRangeBehavior.ClosedClosed,overviewRulerLane:a.OverviewRulerLane.Center,overviewRulerColor:new a.ThemeColor("editor.findMatchHighlightBackground")}),this.disposables=[],this._ignore=new Set,this.disposables.push(a.workspace.onDidChangeTextDocument(e=>this._ignore.add(e.document.uri.toString())),a.window.onDidChangeActiveTextEditor(()=>e.visible&&this.update()),e.onDidChangeVisibility(e=>e.visible?this._show():this._hide()),e.onDidChangeSelection(()=>{e.visible&&this.update()})),this._show()}dispose(){a.Disposable.from(...this.disposables).dispose();for(const e of a.window.visibleTextEditors)e.setDecorations(this._decorationType,[])}_show(){const{activeTextEditor:e}=a.window;if(!e||!e.viewColumn)return;if(this._ignore.has(e.document.uri.toString()))return;const[t]=this._view.selection;if(!t)return;const i=this._delegate.getEditorHighlights(t,e.document.uri);i&&e.setDecorations(this._decorationType,i)}_hide(){for(const e of a.window.visibleTextEditors)e.setDecorations(this._decorationType,[])}update(){this._hide(),this._show()}}},87:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.Navigation=void 0;const a=s(i(398)),c=i(376);t.Navigation=class{constructor(e){this._view=e,this._disposables=[],this._ctxCanNavigate=new c.ContextKey("references-view.canNavigate"),this._disposables.push(a.commands.registerCommand("references-view.next",()=>this.next(!1)),a.commands.registerCommand("references-view.prev",()=>this.previous(!1)))}dispose(){a.Disposable.from(...this._disposables).dispose()}update(e){this._delegate=e,this._ctxCanNavigate.set(Boolean(this._delegate))}_anchor(){if(!this._delegate)return;const[e]=this._view.selection;return e||(a.window.activeTextEditor?this._delegate.nearest(a.window.activeTextEditor.document.uri,a.window.activeTextEditor.selection.active):void 0)}_open(e,t){a.commands.executeCommand("vscode.open",e.uri,{selection:new a.Selection(e.range.start,e.range.start),preserveFocus:t})}previous(e){if(!this._delegate)return;const t=this._anchor();if(!t)return;const i=this._delegate.previous(t),n=this._delegate.location(i);n&&(this._view.reveal(i,{select:!0,focus:!0}),this._open(n,e))}next(e){if(!this._delegate)return;const t=this._anchor();if(!t)return;const i=this._delegate.next(t),n=this._delegate.location(i);n&&(this._view.reveal(i,{select:!0,focus:!0}),this._open(n,e))}}},170:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.CallItem=t.CallsTreeInput=void 0;const a=s(i(398)),c=i(376);class l{constructor(e,t){this.location=e,this.direction=t,this.contextValue="callHierarchy",this.title=0===t?a.l10n.t("Callers Of"):a.l10n.t("Calls From")}async resolve(){const e=await Promise.resolve(a.commands.executeCommand("vscode.prepareCallHierarchy",this.location.uri,this.location.range.start)),t=new h(this.direction,e??[]),i=new d(t);if(0!==t.roots.length)return{provider:i,get message(){return 0===t.roots.length?a.l10n.t("No results."):void 0},navigation:t,highlights:t,dnd:t,dispose(){i.dispose()}}}with(e){return new l(e,this.direction)}}t.CallsTreeInput=l;class u{constructor(e,t,i,n){this.model=e,this.item=t,this.parent=i,this.locations=n}remove(){this.model.remove(this)}}t.CallItem=u;class h{constructor(e,t){this.direction=e,this.roots=[],this._onDidChange=new a.EventEmitter,this.onDidChange=this._onDidChange.event,this.roots=t.map(e=>new u(this,e,void 0,void 0))}async _resolveCalls(e){if(0===this.direction){const t=await a.commands.executeCommand("vscode.provideIncomingCalls",e.item);return t?t.map(t=>new u(this,t.from,e,t.fromRanges.map(e=>new a.Location(t.from.uri,e)))):[]}{const t=await a.commands.executeCommand("vscode.provideOutgoingCalls",e.item);return t?t.map(t=>new u(this,t.to,e,t.fromRanges.map(t=>new a.Location(e.item.uri,t)))):[]}}async getCallChildren(e){return e.children||(e.children=await this._resolveCalls(e)),e.children}location(e){return new a.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._move(e,!0)??e}previous(e){return this._move(e,!1)??e}_move(e,t){if(e.children?.length)return t?e.children[0]:(0,c.tail)(e.children);const i=this.roots.includes(e)?this.roots:e.parent?.children;if(i?.length){const n=i.indexOf(e);return i[n+(t?1:-1)+i.length%i.length]}}getDragUri(e){return(0,c.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,c.del)(t,e),this._onDidChange.fire(this))}}class d{constructor(e){this._model=e,this._emitter=new a.EventEmitter,this.onDidChangeTreeData=this._emitter.event,this._modelListener=e.onDidChange(e=>this._emitter.fire(e instanceof u?e:void 0))}dispose(){this._emitter.dispose(),this._modelListener.dispose()}getTreeItem(e){const t=new a.TreeItem(e.item.name);let i;if(t.description=e.item.detail,t.tooltip=t.label&&e.item.detail?`${t.label} - ${e.item.detail}`:t.label?`${t.label}`:e.item.detail,t.contextValue="call-item",t.iconPath=(0,c.getThemeIcon)(e.item.kind),1===e.model.direction)i=[e.item.uri,{selection:e.item.selectionRange.with({end:e.item.selectionRange.start})}];else{let t;if(e.locations)for(const i of e.locations)i.uri.toString()===e.item.uri.toString()&&(t=t?.isBefore(i.range.start)?t:i.range.start);t||(t=e.item.selectionRange.start),i=[e.item.uri,{selection:new a.Range(t,t)}]}return t.command={command:"vscode.open",title:a.l10n.t("Open Call"),arguments:i},t.collapsibleState=a.TreeItemCollapsibleState.Collapsed,t}getChildren(e){return e?this._model.getCallChildren(e):this._model.roots}getParent(e){return e.parent}}},227:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.register=function(e,t){const i=new h(t.workspaceState,"subtypes");function n(t,n){let r;i.value=t;const o=e.getInput();n instanceof l.TypeItem?r=new l.TypesTreeInput(new a.Location(n.item.uri,n.item.selectionRange.start),i.value):n instanceof a.Location?r=new l.TypesTreeInput(n,i.value):o instanceof l.TypesTreeInput&&(r=new l.TypesTreeInput(o.location,i.value)),r&&e.setInput(r)}t.subscriptions.push(a.commands.registerCommand("references-view.showTypeHierarchy",function(){if(a.window.activeTextEditor){const t=new l.TypesTreeInput(new a.Location(a.window.activeTextEditor.document.uri,a.window.activeTextEditor.selection.active),i.value);e.setInput(t)}}),a.commands.registerCommand("references-view.showSupertypes",e=>n("supertypes",e)),a.commands.registerCommand("references-view.showSubtypes",e=>n("subtypes",e)),a.commands.registerCommand("references-view.removeTypeItem",u))};const a=s(i(398)),c=i(376),l=i(10);function u(e){e instanceof l.TypeItem&&e.remove()}class h{constructor(e,t="subtypes"){this._mem=e,this._value=t,this._ctxMode=new c.ContextKey("references-view.typeHierarchyMode");const i=e.get(h._key);this.value="string"==typeof i?i:t}get value(){return this._value}set value(e){this._value=e,this._ctxMode.set(e),this._mem.update(h._key,e)}}h._key="references-view.typeHierarchyMode"},256:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.activate=function(e){const t=new l.SymbolsTree;return c.register(t,e),a.register(t,e),u.register(t,e),{setInput:function(e){t.setInput(e)},getInput:function(){return t.getInput()}}};const a=s(i(475)),c=s(i(464)),l=i(541),u=s(i(227))},376:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.WordAnchor=t.ContextKey=void 0,t.del=function(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)},t.tail=function(e){return e[e.length-1]},t.asResourceUrl=function(e,t){return e.with({fragment:`L${1+t.start.line},${1+t.start.character}-${1+t.end.line},${1+t.end.character}`})},t.isValidRequestPosition=async function(e,t){const i=await a.workspace.openTextDocument(e);let n=i.getWordRangeAtPosition(t);return n||(n=i.getWordRangeAtPosition(t,/[^\s]+/)),Boolean(n)},t.getPreviewChunks=function(e,t,i=8,n=!0){const r=t.start.with({character:Math.max(0,t.start.character-i)}),o=e.getWordRangeAtPosition(r);let s=e.getText(new a.Range(o?o.start:r,t.start));const c=e.getText(t),l=t.end.translate(0,331);let u=e.getText(new a.Range(t.end,l));return n&&(s=s.replace(/^\s*/g,""),u=u.replace(/\s*$/g,"")),{before:s,inside:c,after:u}},t.getThemeIcon=function(e){const t=c[e];return t?new a.ThemeIcon(t):void 0};const a=s(i(398));t.ContextKey=class{constructor(e){this.name=e}async set(e){await a.commands.executeCommand("setContext",this.name,e)}async reset(){await a.commands.executeCommand("setContext",this.name,void 0)}},t.WordAnchor=class{constructor(e,t){this._doc=e,this._position=t,this._version=e.version,this._word=this._getAnchorWord(e,t)}_getAnchorWord(e,t){const i=e.getWordRangeAtPosition(t)||e.getWordRangeAtPosition(t,/[^\s]+/);return i&&e.getText(i)}guessedTrackedPosition(){if(!this._word)return this._position;if(this._version===this._doc.version)return this._position;const e=this._getAnchorWord(this._doc,this._position);if(this._word===e)return this._position;const t=this._position.line;let i,n,r=0;do{if(n=!1,i=t+r,i<this._doc.lineCount){n=!0;const e=this._doc.lineAt(i).text.indexOf(this._word);if(e>=0)return new a.Position(i,e)}if(r+=1,i=t-r,i>=0){n=!0;const e=this._doc.lineAt(i).text.indexOf(this._word);if(e>=0)return new a.Position(i,e)}}while(r<100&&n);return this._position}};const c=["symbol-file","symbol-module","symbol-namespace","symbol-package","symbol-class","symbol-method","symbol-property","symbol-field","symbol-constructor","symbol-enum","symbol-interface","symbol-function","symbol-variable","symbol-constant","symbol-string","symbol-number","symbol-boolean","symbol-array","symbol-object","symbol-key","symbol-null","symbol-enum-member","symbol-struct","symbol-event","symbol-operator","symbol-type-parameter"]},398:e=>{e.exports=require("vscode")},464:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.register=function(e,t){function i(t,i){if(a.window.activeTextEditor){const n=new c.ReferencesTreeInput(t,new a.Location(a.window.activeTextEditor.document.uri,a.window.activeTextEditor.selection.active),i);e.setInput(n)}}let n;t.subscriptions.push(a.commands.registerCommand("references-view.findReferences",()=>i("References","vscode.executeReferenceProvider")),a.commands.registerCommand("references-view.findImplementations",()=>i("Implementations","vscode.executeImplementationProvider")),a.commands.registerCommand("references-view.find",(...e)=>a.commands.executeCommand("references-view.findReferences",...e)),a.commands.registerCommand("references-view.removeReferenceItem",u),a.commands.registerCommand("references-view.copy",h),a.commands.registerCommand("references-view.copyAll",l),a.commands.registerCommand("references-view.copyPath",d));const r="references.preferredLocation";function o(t){if(t&&!t.affectsConfiguration(r))return;const i=a.workspace.getConfiguration().get(r);n?.dispose(),n=void 0,"view"===i&&(n=a.commands.registerCommand("editor.action.showReferences",async(t,i,n)=>{const r=new c.ReferencesTreeInput(a.l10n.t("References"),new a.Location(t,i),"vscode.executeReferenceProvider",n);e.setInput(r)}))}t.subscriptions.push(a.workspace.onDidChangeConfiguration(o)),t.subscriptions.push({dispose:()=>n?.dispose()}),o()};const a=s(i(398)),c=i(769),l=async e=>{e instanceof c.ReferenceItem?h(e.file.model):e instanceof c.FileItem&&h(e.model)};function u(e){(e instanceof c.FileItem||e instanceof c.ReferenceItem)&&e.remove()}async function h(e){let t;(e instanceof c.ReferencesModel||e instanceof c.ReferenceItem||e instanceof c.FileItem)&&(t=await e.asCopyText()),t&&await a.env.clipboard.writeText(t)}async function d(e){e instanceof c.FileItem&&("file"===e.uri.scheme?a.env.clipboard.writeText(e.uri.fsPath):a.env.clipboard.writeText(e.uri.toString(!0)))}},475:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.register=function(e,t){const i=new h(t.workspaceState,0);function n(t,n){let r;i.value=t;const o=e.getInput();n instanceof l.CallItem?r=new l.CallsTreeInput(new a.Location(n.item.uri,n.item.selectionRange.start),i.value):o instanceof l.CallsTreeInput&&(r=new l.CallsTreeInput(o.location,i.value)),r&&e.setInput(r)}t.subscriptions.push(a.commands.registerCommand("references-view.showCallHierarchy",function(){if(a.window.activeTextEditor){const t=new l.CallsTreeInput(new a.Location(a.window.activeTextEditor.document.uri,a.window.activeTextEditor.selection.active),i.value);e.setInput(t)}}),a.commands.registerCommand("references-view.showOutgoingCalls",e=>n(1,e)),a.commands.registerCommand("references-view.showIncomingCalls",e=>n(0,e)),a.commands.registerCommand("references-view.removeCallItem",u))};const a=s(i(398)),c=i(376),l=i(170);function u(e){e instanceof l.CallItem&&e.remove()}class h{constructor(e,t=1){this._mem=e,this._value=t,this._ctxMode=new c.ContextKey("references-view.callHierarchyMode");const i=e.get(h._key);this.value="number"==typeof i&&i>=0&&i<=1?i:t}get value(){return this._value}set value(e){this._value=e,this._ctxMode.set(0===this._value?"showIncoming":"showOutgoing"),this._mem.update(h._key,e)}}h._key="references-view.callHierarchyMode"},541:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.SymbolsTree=void 0;const a=s(i(398)),c=i(76),l=i(87),u=i(376);t.SymbolsTree=class{constructor(){this.viewId="references-view.tree",this._ctxIsActive=new u.ContextKey("reference-list.isActive"),this._ctxHasResult=new u.ContextKey("reference-list.hasResult"),this._ctxInputSource=new u.ContextKey("reference-list.source"),this._history=new m(this),this._provider=new h,this._dnd=new d,this._tree=a.window.createTreeView(this.viewId,{treeDataProvider:this._provider,showCollapseAll:!0,dragAndDropController:this._dnd}),this._navigation=new l.Navigation(this._tree)}dispose(){this._history.dispose(),this._tree.dispose(),this._sessionDisposable?.dispose()}getInput(){return this._input}async setInput(e){if(!await(0,u.isValidRequestPosition)(e.location.uri,e.location.range.start))return void this.clearInput();this._ctxInputSource.set(e.contextValue),this._ctxIsActive.set(!0),this._ctxHasResult.set(!0),a.commands.executeCommand(`${this.viewId}.focus`);const t=!this._input||Object.getPrototypeOf(this._input)!==Object.getPrototypeOf(e);this._input=e,this._sessionDisposable?.dispose(),this._tree.title=e.title,this._tree.message=t?void 0:this._tree.message;const i=Promise.resolve(e.resolve());this._provider.update(i.then(e=>e?.provider??this._history)),this._dnd.update(i.then(e=>e?.dnd));const n=await i;if(this._input!==e)return;if(!n)return void this.clearInput();this._history.add(e),this._tree.message=n.message,this._navigation.update(n.navigation);const r=n.navigation?.nearest(e.location.uri,e.location.range.start);r&&this._tree.visible&&await this._tree.reveal(r,{select:!0,focus:!0,expand:!0});const o=[];let s;n.highlights&&(s=new c.EditorHighlights(this._tree,n.highlights),o.push(s)),n.provider.onDidChangeTreeData&&o.push(n.provider.onDidChangeTreeData(()=>{this._tree.title=e.title,this._tree.message=n.message,s?.update()})),"function"==typeof n.dispose&&o.push(new a.Disposable(()=>n.dispose())),this._sessionDisposable=a.Disposable.from(...o)}clearInput(){this._sessionDisposable?.dispose(),this._input=void 0,this._ctxHasResult.set(!1),this._ctxInputSource.reset(),this._tree.title=a.l10n.t("References"),this._tree.message=0===this._history.size?a.l10n.t("No results."):a.l10n.t("No results. Try running a previous search again:"),this._provider.update(Promise.resolve(this._history))}};class h{constructor(){this._onDidChange=new a.EventEmitter,this.onDidChangeTreeData=this._onDidChange.event}update(e){this._sessionDispoables?.dispose(),this._sessionDispoables=void 0,this._onDidChange.fire(void 0),this.provider=e,e.then(t=>{this.provider===e&&t.onDidChangeTreeData&&(this._sessionDispoables=t.onDidChangeTreeData(this._onDidChange.fire,this._onDidChange))}).catch(e=>{this.provider=void 0,console.error(e)})}async getTreeItem(e){return this._assertProvider(),(await this.provider).getTreeItem(e)}async getChildren(e){return this._assertProvider(),(await this.provider).getChildren(e)}async getParent(e){this._assertProvider();const t=await this.provider;return t.getParent?t.getParent(e):void 0}_assertProvider(){if(!this.provider)throw new Error("MISSING provider")}}class d{constructor(){this.dropMimeTypes=[],this.dragMimeTypes=["text/uri-list"]}update(e){this._delegate=void 0,e.then(e=>this._delegate=e)}handleDrag(e,t){if(this._delegate){const i=[];for(const t of e){const e=this._delegate.getDragUri(t);e&&i.push(e.toString())}i.length>0&&t.set("text/uri-list",new a.DataTransferItem(i.join("\r\n")))}}handleDrop(){throw new Error("Method not implemented.")}}class f{constructor(e,t,i,n){this.key=e,this.word=t,this.anchor=i,this.input=n,this.description=`${a.workspace.asRelativePath(n.location.uri)} • ${n.title.toLocaleLowerCase()}`}}class m{constructor(e){this._tree=e,this._onDidChangeTreeData=new a.EventEmitter,this.onDidChangeTreeData=this._onDidChangeTreeData.event,this._disposables=[],this._ctxHasHistory=new u.ContextKey("reference-list.hasHistory"),this._inputs=new Map,this._disposables.push(a.commands.registerCommand("references-view.clear",()=>e.clearInput()),a.commands.registerCommand("references-view.clearHistory",()=>{this.clear(),e.clearInput()}),a.commands.registerCommand("references-view.refind",e=>{e instanceof f&&this._reRunHistoryItem(e)}),a.commands.registerCommand("references-view.refresh",()=>{const e=Array.from(this._inputs.values()).pop();e&&this._reRunHistoryItem(e)}),a.commands.registerCommand("_references-view.showHistoryItem",async e=>{if(e instanceof f){const t=e.anchor.guessedTrackedPosition()??e.input.location.range.start;await a.commands.executeCommand("vscode.open",e.input.location.uri,{selection:new a.Range(t,t)})}}),a.commands.registerCommand("references-view.pickFromHistory",async()=>{const e=(await this.getChildren()).map(e=>({label:e.word,description:e.description,item:e})),t=await a.window.showQuickPick(e,{placeHolder:a.l10n.t("Select previous reference search")});t&&this._reRunHistoryItem(t.item)}))}dispose(){a.Disposable.from(...this._disposables).dispose(),this._onDidChangeTreeData.dispose()}_reRunHistoryItem(e){this._inputs.delete(e.key);const t=e.anchor.guessedTrackedPosition();let i=e.input;t&&!e.input.location.range.start.isEqual(t)&&(i=e.input.with(new a.Location(e.input.location.uri,t))),this._tree.setInput(i)}async add(e){const t=await a.workspace.openTextDocument(e.location.uri),i=new u.WordAnchor(t,e.location.range.start),n=t.getWordRangeAtPosition(e.location.range.start)??t.getWordRangeAtPosition(e.location.range.start,/[^\s]+/),r=n?t.getText(n):"???",o=new f(JSON.stringify([n?.start??e.location.range.start,e.location.uri,e.title]),r,i,e);this._inputs.delete(o.key),this._inputs.set(o.key,o),this._ctxHasHistory.set(!0)}clear(){this._inputs.clear(),this._ctxHasHistory.set(!1),this._onDidChangeTreeData.fire(void 0)}get size(){return this._inputs.size}getTreeItem(e){const t=new a.TreeItem(e.word);return t.description=e.description,t.command={command:"_references-view.showHistoryItem",arguments:[e],title:a.l10n.t("Rerun")},t.collapsibleState=a.TreeItemCollapsibleState.None,t.contextValue="history-item",t}getChildren(){return Promise.all([...this._inputs.values()].reverse())}getParent(){}}},769:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&r(t,e,i[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.ReferenceItem=t.FileItem=t.ReferencesModel=t.ReferencesTreeInput=void 0;const a=s(i(398)),c=i(376);class l{constructor(e,t,i,n){this.title=e,this.location=t,this._command=i,this._result=n,this.contextValue=i}async resolve(){let e;if(this._result)e=new u(this._result);else{const t=await Promise.resolve(a.commands.executeCommand(this._command,this.location.uri,this.location.range.start));e=new u(t??[])}if(0===e.items.length)return;const t=new h(e);return{provider:t,get message(){return e.message},navigation:e,highlights:e,dnd:e,dispose(){t.dispose()}}}with(e){return new l(this.title,e,this._command)}}t.ReferencesTreeInput=l;class u{constructor(e){let t;this._onDidChange=new a.EventEmitter,this.onDidChangeTreeData=this._onDidChange.event,this.items=[];for(const i of e.sort(u._compareLocations)){const e=i instanceof a.Location?i:new a.Location(i.targetUri,i.targetRange);t&&0===u._compareUriIgnoreFragment(t.uri,e.uri)||(t=new d(e.uri.with({fragment:""}),[],this),this.items.push(t)),t.references.push(new f(e,t))}}static _compareUriIgnoreFragment(e,t){const i=e.with({fragment:""}).toString(),n=t.with({fragment:""}).toString();return i<n?-1:i>n?1:0}static _compareLocations(e,t){const i=e instanceof a.Location?e.uri:e.targetUri,n=t instanceof a.Location?t.uri:t.targetUri;if(i.toString()<n.toString())return-1;if(i.toString()>n.toString())return 1;const r=e instanceof a.Location?e.range:e.targetRange,o=t instanceof a.Location?t.range:t.targetRange;return r.start.isBefore(o.start)?-1:r.start.isAfter(o.start)?1:0}get message(){if(0===this.items.length)return a.l10n.t("No results.");const e=this.items.reduce((e,t)=>e+t.references.length,0),t=this.items.length;return 1===e&&1===t?a.l10n.t("{0} result in {1} file",e,t):1===e?a.l10n.t("{0} result in {1} files",e,t):1===t?a.l10n.t("{0} results in {1} file",e,t):a.l10n.t("{0} results in {1} files",e,t)}location(e){return e instanceof f?e.location:new a.Location(e.uri,e.references[0]?.location.range??new a.Position(0,0))}nearest(e,t){if(0===this.items.length)return;for(const i of this.items)if(i.uri.toString()===e.toString()){for(const e of i.references)if(e.location.range.contains(t))return e;let e;for(const n of i.references){if(n.location.range.end.isAfter(t))return n;e=n}if(e)return e;break}let i=0;const n=u._prefixLen(this.items[i].toString(),e.toString());for(let t=1;t<this.items.length;t++)u._prefixLen(this.items[t].uri.toString(),e.toString())>n&&(i=t);return this.items[i].references[0]}static _prefixLen(e,t){let i=0;for(;i<e.length&&i<t.length&&e.charCodeAt(i)===t.charCodeAt(i);)i+=1;return i}next(e){return this._move(e,!0)??e}previous(e){return this._move(e,!1)??e}_move(e,t){const i=t?1:-1,n=e=>{const t=(this.items.indexOf(e)+i+this.items.length)%this.items.length;return this.items[t]};if(e instanceof d)return t?n(e).references[0]:(0,c.tail)(n(e).references);if(e instanceof f){const t=e.file.references.indexOf(e)+i;return t<0?(0,c.tail)(n(e.file).references):t>=e.file.references.length?n(e.file).references[0]:e.file.references[t]}}getEditorHighlights(e,t){const i=this.items.find(e=>e.uri.toString()===t.toString());return i?.references.map(e=>e.location.range)}remove(e){e instanceof d?((0,c.del)(this.items,e),this._onDidChange.fire(void 0)):((0,c.del)(e.file.references,e),0===e.file.references.length?((0,c.del)(this.items,e.file),this._onDidChange.fire(void 0)):this._onDidChange.fire(e.file))}async asCopyText(){let e="";for(const t of this.items)e+=`${await t.asCopyText()}\n`;return e}getDragUri(e){return e instanceof d?e.uri:(0,c.asResourceUrl)(e.file.uri,e.location.range)}}t.ReferencesModel=u;class h{constructor(e){this._model=e,this._onDidChange=new a.EventEmitter,this.onDidChangeTreeData=this._onDidChange.event,this._listener=e.onDidChangeTreeData(()=>this._onDidChange.fire(void 0))}dispose(){this._onDidChange.dispose(),this._listener.dispose()}async getTreeItem(e){if(e instanceof d){const t=new a.TreeItem(e.uri);return t.contextValue="file-item",t.description=!0,t.iconPath=a.ThemeIcon.File,t.collapsibleState=a.TreeItemCollapsibleState.Collapsed,t}{const{range:t}=e.location,i=await e.getDocument(!0),{before:n,inside:r,after:o}=(0,c.getPreviewChunks)(i,t),s={label:n+r+o,highlights:[[n.length,n.length+r.length]]},l=new a.TreeItem(s);return l.collapsibleState=a.TreeItemCollapsibleState.None,l.contextValue="reference-item",l.command={command:"vscode.open",title:a.l10n.t("Open Reference"),arguments:[e.location.uri,{selection:t.with({end:t.start})}]},l}}async getChildren(e){return e?e instanceof d?e.references:void 0:this._model.items}getParent(e){return e instanceof f?e.file:void 0}}class d{constructor(e,t,i){this.uri=e,this.references=t,this.model=i}remove(){this.model.remove(this)}async asCopyText(){let e=`${a.workspace.asRelativePath(this.uri)}\n`;for(const t of this.references)e+=` ${await t.asCopyText()}\n`;return e}}t.FileItem=d;class f{constructor(e,t){this.location=e,this.file=t}async getDocument(e){if(this._document||(this._document=a.workspace.openTextDocument(this.location.uri)),e){const e=this.file.model.next(this.file);e instanceof d&&e!==this.file?a.workspace.openTextDocument(e.uri):e instanceof f&&a.workspace.openTextDocument(e.location.uri)}return this._document}remove(){this.file.model.remove(this)}async asCopyText(){const e=await this.getDocument(),t=(0,c.getPreviewChunks)(e,this.location.range,21,!1);return`${this.location.range.start.line+1}, ${this.location.range.start.character+1}: ${t.before+t.inside+t.after}`}}t.ReferenceItem=f}},t={},i=function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}(256),n=exports;for(var r in i)n[r]=i[r];i.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
|
|
2
2
|
//# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/undefined/extensions/references-view/dist/extension.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","mappings":"23BAUA,oBAAyBA,EAAmBC,GAE3C,MAAMC,EAAY,IAAIC,EAAmBF,EAAQG,eAAgB,GASjE,SAASC,EAAkBC,EAAuBC,GAGjD,IAAIC,EAFJN,EAAUI,MAAQA,EAGlB,MAAMG,EAAWT,EAAKU,WAClBH,aAAkB,EAAAI,SACrBH,EAAW,IAAI,EAAAI,eAAe,IAAIC,EAAOC,SAASP,EAAOQ,KAAKC,IAAKT,EAAOQ,KAAKE,eAAeC,OAAQhB,EAAUI,OACtGG,aAAoB,EAAAG,iBAC9BJ,EAAW,IAAI,EAAAI,eAAeH,EAASU,SAAUjB,EAAUI,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AAKwC,SACb,GAID,MAAMmR,EAAgB,CACrB,cAAe,gBAAiB,mBAAoB,iBAAkB,eAAgB,gBACtF,kBAAmB,eAAgB,qBAAsB,cAAe,mBACxE,kBAAmB,kBAAmB,kBAAmB,gBAAiB,gBAAiB,iBAC3F,eAAgB,gBAAiB,aAAc,cAAe,qBAAsB,gBACpF,eAAgB,kBAAmB,wB,UCjIpCa,EAAOC,QAAUC,QAAQ,S,GCCrBC,EAA2B,CAAC,ECE5BC,EDCJ,SAASC,EAAoBC,GAE5B,IAAIC,EAAeJ,EAAyBG,GAC5C,QAAqB3T,IAAjB4T,EACH,OAAOA,EAAaN,QAGrB,IAAID,EAASG,EAAyBG,GAAY,CAGjDL,QAAS,CAAC,GAOX,OAHAO,EAAoBF,GAAU9S,KAAKwS,EAAOC,QAASD,EAAQA,EAAOC,QAASI,GAGpEL,EAAOC,OACf,CCnB0BI,CAAoB,K","sources":["webpack://references-view/./src/calls/index.ts","webpack://references-view/./src/calls/model.ts","webpack://references-view/./src/extension.ts","webpack://references-view/./src/highlights.ts","webpack://references-view/./src/navigation.ts","webpack://references-view/./src/references/index.ts","webpack://references-view/./src/references/model.ts","webpack://references-view/./src/tree.ts","webpack://references-view/./src/types/index.ts","webpack://references-view/./src/types/model.ts","webpack://references-view/./src/utils.ts","webpack://references-view/external commonjs \"vscode\"","webpack://references-view/webpack/bootstrap","webpack://references-view/webpack/startup"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolsTree } from '../tree';\nimport { ContextKey } from '../utils';\nimport { CallItem, CallsDirection, CallsTreeInput } from './model';\n\nexport function register(tree: SymbolsTree, context: vscode.ExtensionContext): void {\n\n\tconst direction = new RichCallsDirection(context.workspaceState, CallsDirection.Incoming);\n\n\tfunction showCallHierarchy() {\n\t\tif (vscode.window.activeTextEditor) {\n\t\t\tconst input = new CallsTreeInput(new vscode.Location(vscode.window.activeTextEditor.document.uri, vscode.window.activeTextEditor.selection.active), direction.value);\n\t\t\ttree.setInput(input);\n\t\t}\n\t}\n\n\tfunction setCallsDirection(value: CallsDirection, anchor: CallItem | unknown) {\n\t\tdirection.value = value;\n\n\t\tlet newInput: CallsTreeInput | undefined;\n\t\tconst oldInput = tree.getInput();\n\t\tif (anchor instanceof CallItem) {\n\t\t\tnewInput = new CallsTreeInput(new vscode.Location(anchor.item.uri, anchor.item.selectionRange.start), direction.value);\n\t\t} else if (oldInput instanceof CallsTreeInput) {\n\t\t\tnewInput = new CallsTreeInput(oldInput.location, direction.value);\n\t\t}\n\t\tif (newInput) {\n\t\t\ttree.setInput(newInput);\n\t\t}\n\t}\n\n\tcontext.subscriptions.push(\n\t\tvscode.commands.registerCommand('references-view.showCallHierarchy', showCallHierarchy),\n\t\tvscode.commands.registerCommand('references-view.showOutgoingCalls', (item: CallItem | unknown) => setCallsDirection(CallsDirection.Outgoing, item)),\n\t\tvscode.commands.registerCommand('references-view.showIncomingCalls', (item: CallItem | unknown) => setCallsDirection(CallsDirection.Incoming, item)),\n\t\tvscode.commands.registerCommand('references-view.removeCallItem', removeCallItem)\n\t);\n}\n\nfunction removeCallItem(item: CallItem | unknown): void {\n\tif (item instanceof CallItem) {\n\t\titem.remove();\n\t}\n}\n\nclass RichCallsDirection {\n\n\tprivate static _key = 'references-view.callHierarchyMode';\n\n\tprivate _ctxMode = new ContextKey<'showIncoming' | 'showOutgoing'>('references-view.callHierarchyMode');\n\n\tconstructor(\n\t\tprivate _mem: vscode.Memento,\n\t\tprivate _value: CallsDirection = CallsDirection.Outgoing,\n\t) {\n\t\tconst raw = _mem.get<number>(RichCallsDirection._key);\n\t\tif (typeof raw === 'number' && raw >= 0 && raw <= 1) {\n\t\t\tthis.value = raw;\n\t\t} else {\n\t\t\tthis.value = _value;\n\t\t}\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\tset value(value: CallsDirection) {\n\t\tthis._value = value;\n\t\tthis._ctxMode.set(this._value === CallsDirection.Incoming ? 'showIncoming' : 'showOutgoing');\n\t\tthis._mem.update(RichCallsDirection._key, value);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolItemDragAndDrop, SymbolItemEditorHighlights, SymbolItemNavigation, SymbolTreeInput } from '../references-view';\nimport { asResourceUrl, del, getThemeIcon, tail } from '../utils';\n\nexport class CallsTreeInput implements SymbolTreeInput<CallItem> {\n\n\treadonly title: string;\n\treadonly contextValue: string = 'callHierarchy';\n\n\tconstructor(\n\t\treadonly location: vscode.Location,\n\t\treadonly direction: CallsDirection,\n\t) {\n\t\tthis.title = direction === CallsDirection.Incoming\n\t\t\t? vscode.l10n.t('Callers Of')\n\t\t\t: vscode.l10n.t('Calls From');\n\t}\n\n\tasync resolve() {\n\n\t\tconst items = await Promise.resolve(vscode.commands.executeCommand<vscode.CallHierarchyItem[]>('vscode.prepareCallHierarchy', this.location.uri, this.location.range.start));\n\t\tconst model = new CallsModel(this.direction, items ?? []);\n\t\tconst provider = new CallItemDataProvider(model);\n\n\t\tif (model.roots.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn {\n\t\t\tprovider,\n\t\t\tget message() { return model.roots.length === 0 ? vscode.l10n.t('No results.') : undefined; },\n\t\t\tnavigation: model,\n\t\t\thighlights: model,\n\t\t\tdnd: model,\n\t\t\tdispose() {\n\t\t\t\tprovider.dispose();\n\t\t\t}\n\t\t};\n\t}\n\n\twith(location: vscode.Location): CallsTreeInput {\n\t\treturn new CallsTreeInput(location, this.direction);\n\t}\n}\n\n\nexport const enum CallsDirection {\n\tIncoming,\n\tOutgoing\n}\n\n\n\nexport class CallItem {\n\n\tchildren?: CallItem[];\n\n\tconstructor(\n\t\treadonly model: CallsModel,\n\t\treadonly item: vscode.CallHierarchyItem,\n\t\treadonly parent: CallItem | undefined,\n\t\treadonly locations: vscode.Location[] | undefined\n\t) { }\n\n\tremove(): void {\n\t\tthis.model.remove(this);\n\t}\n}\n\nclass CallsModel implements SymbolItemNavigation<CallItem>, SymbolItemEditorHighlights<CallItem>, SymbolItemDragAndDrop<CallItem> {\n\n\treadonly roots: CallItem[] = [];\n\n\tprivate readonly _onDidChange = new vscode.EventEmitter<CallsModel>();\n\treadonly onDidChange = this._onDidChange.event;\n\n\tconstructor(readonly direction: CallsDirection, items: vscode.CallHierarchyItem[]) {\n\t\tthis.roots = items.map(item => new CallItem(this, item, undefined, undefined));\n\t}\n\n\tprivate async _resolveCalls(call: CallItem): Promise<CallItem[]> {\n\t\tif (this.direction === CallsDirection.Incoming) {\n\t\t\tconst calls = await vscode.commands.executeCommand<vscode.CallHierarchyIncomingCall[]>('vscode.provideIncomingCalls', call.item);\n\t\t\treturn calls ? calls.map(item => new CallItem(this, item.from, call, item.fromRanges.map(range => new vscode.Location(item.from.uri, range)))) : [];\n\t\t} else {\n\t\t\tconst calls = await vscode.commands.executeCommand<vscode.CallHierarchyOutgoingCall[]>('vscode.provideOutgoingCalls', call.item);\n\t\t\treturn calls ? calls.map(item => new CallItem(this, item.to, call, item.fromRanges.map(range => new vscode.Location(call.item.uri, range)))) : [];\n\t\t}\n\t}\n\n\tasync getCallChildren(call: CallItem): Promise<CallItem[]> {\n\t\tif (!call.children) {\n\t\t\tcall.children = await this._resolveCalls(call);\n\t\t}\n\t\treturn call.children;\n\t}\n\n\t// -- navigation\n\n\tlocation(item: CallItem) {\n\t\treturn new vscode.Location(item.item.uri, item.item.range);\n\t}\n\n\tnearest(uri: vscode.Uri, _position: vscode.Position): CallItem | undefined {\n\t\treturn this.roots.find(item => item.item.uri.toString() === uri.toString()) ?? this.roots[0];\n\t}\n\n\tnext(from: CallItem): CallItem {\n\t\treturn this._move(from, true) ?? from;\n\t}\n\n\tprevious(from: CallItem): CallItem {\n\t\treturn this._move(from, false) ?? from;\n\t}\n\n\tprivate _move(item: CallItem, fwd: boolean): CallItem | void {\n\t\tif (item.children?.length) {\n\t\t\treturn fwd ? item.children[0] : tail(item.children);\n\t\t}\n\t\tconst array = this.roots.includes(item) ? this.roots : item.parent?.children;\n\t\tif (array?.length) {\n\t\t\tconst idx = array.indexOf(item);\n\t\t\tconst delta = fwd ? 1 : -1;\n\t\t\treturn array[idx + delta + array.length % array.length];\n\t\t}\n\t}\n\n\t// --- dnd\n\n\tgetDragUri(item: CallItem): vscode.Uri | undefined {\n\t\treturn asResourceUrl(item.item.uri, item.item.range);\n\t}\n\n\t// --- highlights\n\n\tgetEditorHighlights(item: CallItem, uri: vscode.Uri): vscode.Range[] | undefined {\n\t\tif (!item.locations) {\n\t\t\treturn item.item.uri.toString() === uri.toString() ? [item.item.selectionRange] : undefined;\n\t\t}\n\t\treturn item.locations\n\t\t\t.filter(loc => loc.uri.toString() === uri.toString())\n\t\t\t.map(loc => loc.range);\n\t}\n\n\tremove(item: CallItem) {\n\t\tconst isInRoot = this.roots.includes(item);\n\t\tconst siblings = isInRoot ? this.roots : item.parent?.children;\n\t\tif (siblings) {\n\t\t\tdel(siblings, item);\n\t\t\tthis._onDidChange.fire(this);\n\t\t}\n\t}\n}\n\nclass CallItemDataProvider implements vscode.TreeDataProvider<CallItem> {\n\n\tprivate readonly _emitter = new vscode.EventEmitter<CallItem | undefined>();\n\treadonly onDidChangeTreeData = this._emitter.event;\n\n\tprivate readonly _modelListener: vscode.Disposable;\n\n\tconstructor(private _model: CallsModel) {\n\t\tthis._modelListener = _model.onDidChange(e => this._emitter.fire(e instanceof CallItem ? e : undefined));\n\t}\n\n\tdispose(): void {\n\t\tthis._emitter.dispose();\n\t\tthis._modelListener.dispose();\n\t}\n\n\tgetTreeItem(element: CallItem): vscode.TreeItem {\n\n\t\tconst item = new vscode.TreeItem(element.item.name);\n\t\titem.description = element.item.detail;\n\t\titem.tooltip = item.label && element.item.detail ? `${item.label} - ${element.item.detail}` : item.label ? `${item.label}` : element.item.detail;\n\t\titem.contextValue = 'call-item';\n\t\titem.iconPath = getThemeIcon(element.item.kind);\n\n\t\ttype OpenArgs = [vscode.Uri, vscode.TextDocumentShowOptions];\n\t\tlet openArgs: OpenArgs;\n\n\t\tif (element.model.direction === CallsDirection.Outgoing) {\n\n\t\t\topenArgs = [element.item.uri, { selection: element.item.selectionRange.with({ end: element.item.selectionRange.start }) }];\n\n\t\t} else {\n\t\t\t// incoming call -> reveal first call instead of caller\n\t\t\tlet firstLoctionStart: vscode.Position | undefined;\n\t\t\tif (element.locations) {\n\t\t\t\tfor (const loc of element.locations) {\n\t\t\t\t\tif (loc.uri.toString() === element.item.uri.toString()) {\n\t\t\t\t\t\tfirstLoctionStart = firstLoctionStart?.isBefore(loc.range.start) ? firstLoctionStart : loc.range.start;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!firstLoctionStart) {\n\t\t\t\tfirstLoctionStart = element.item.selectionRange.start;\n\t\t\t}\n\t\t\topenArgs = [element.item.uri, { selection: new vscode.Range(firstLoctionStart, firstLoctionStart) }];\n\t\t}\n\n\t\titem.command = {\n\t\t\tcommand: 'vscode.open',\n\t\t\ttitle: vscode.l10n.t('Open Call'),\n\t\t\targuments: openArgs\n\t\t};\n\t\titem.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed;\n\t\treturn item;\n\t}\n\n\tgetChildren(element?: CallItem | undefined) {\n\t\treturn element\n\t\t\t? this._model.getCallChildren(element)\n\t\t\t: this._model.roots;\n\t}\n\n\tgetParent(element: CallItem) {\n\t\treturn element.parent;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport * as calls from './calls';\nimport * as references from './references';\nimport { SymbolTree, SymbolTreeInput } from './references-view';\nimport { SymbolsTree } from './tree';\nimport * as types from './types';\n\nexport function activate(context: vscode.ExtensionContext): SymbolTree {\n\n\tconst tree = new SymbolsTree();\n\n\treferences.register(tree, context);\n\tcalls.register(tree, context);\n\ttypes.register(tree, context);\n\n\tfunction setInput(input: SymbolTreeInput<unknown>) {\n\t\ttree.setInput(input);\n\t}\n\n\tfunction getInput(): SymbolTreeInput<unknown> | undefined {\n\t\treturn tree.getInput();\n\t}\n\n\treturn { setInput, getInput };\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolItemEditorHighlights } from './references-view';\n\nexport class EditorHighlights<T> {\n\n\tprivate readonly _decorationType = vscode.window.createTextEditorDecorationType({\n\t\tbackgroundColor: new vscode.ThemeColor('editor.findMatchHighlightBackground'),\n\t\trangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed,\n\t\toverviewRulerLane: vscode.OverviewRulerLane.Center,\n\t\toverviewRulerColor: new vscode.ThemeColor('editor.findMatchHighlightBackground'),\n\t});\n\n\tprivate readonly disposables: vscode.Disposable[] = [];\n\tprivate readonly _ignore = new Set<string>();\n\n\tconstructor(private readonly _view: vscode.TreeView<T>, private readonly _delegate: SymbolItemEditorHighlights<T>) {\n\t\tthis.disposables.push(\n\t\t\tvscode.workspace.onDidChangeTextDocument(e => this._ignore.add(e.document.uri.toString())),\n\t\t\tvscode.window.onDidChangeActiveTextEditor(() => _view.visible && this.update()),\n\t\t\t_view.onDidChangeVisibility(e => e.visible ? this._show() : this._hide()),\n\t\t\t_view.onDidChangeSelection(() => {\n\t\t\t\tif (_view.visible) {\n\t\t\t\t\tthis.update();\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\t\tthis._show();\n\t}\n\n\tdispose() {\n\t\tvscode.Disposable.from(...this.disposables).dispose();\n\t\tfor (const editor of vscode.window.visibleTextEditors) {\n\t\t\teditor.setDecorations(this._decorationType, []);\n\t\t}\n\t}\n\n\tprivate _show(): void {\n\t\tconst { activeTextEditor: editor } = vscode.window;\n\t\tif (!editor || !editor.viewColumn) {\n\t\t\treturn;\n\t\t}\n\t\tif (this._ignore.has(editor.document.uri.toString())) {\n\t\t\treturn;\n\t\t}\n\t\tconst [anchor] = this._view.selection;\n\t\tif (!anchor) {\n\t\t\treturn;\n\t\t}\n\t\tconst ranges = this._delegate.getEditorHighlights(anchor, editor.document.uri);\n\t\tif (ranges) {\n\t\t\teditor.setDecorations(this._decorationType, ranges);\n\t\t}\n\t}\n\n\tprivate _hide(): void {\n\t\tfor (const editor of vscode.window.visibleTextEditors) {\n\t\t\teditor.setDecorations(this._decorationType, []);\n\t\t}\n\t}\n\n\tupdate(): void {\n\t\tthis._hide();\n\t\tthis._show();\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolItemNavigation } from './references-view';\nimport { ContextKey } from './utils';\n\nexport class Navigation {\n\n\tprivate readonly _disposables: vscode.Disposable[] = [];\n\tprivate readonly _ctxCanNavigate = new ContextKey<boolean>('references-view.canNavigate');\n\n\tprivate _delegate?: SymbolItemNavigation<unknown>;\n\n\tconstructor(private readonly _view: vscode.TreeView<unknown>) {\n\t\tthis._disposables.push(\n\t\t\tvscode.commands.registerCommand('references-view.next', () => this.next(false)),\n\t\t\tvscode.commands.registerCommand('references-view.prev', () => this.previous(false)),\n\t\t);\n\t}\n\n\tdispose(): void {\n\t\tvscode.Disposable.from(...this._disposables).dispose();\n\t}\n\n\tupdate(delegate: SymbolItemNavigation<unknown> | undefined) {\n\t\tthis._delegate = delegate;\n\t\tthis._ctxCanNavigate.set(Boolean(this._delegate));\n\t}\n\n\tprivate _anchor(): undefined | unknown {\n\t\tif (!this._delegate) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst [sel] = this._view.selection;\n\t\tif (sel) {\n\t\t\treturn sel;\n\t\t}\n\t\tif (!vscode.window.activeTextEditor) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this._delegate.nearest(vscode.window.activeTextEditor.document.uri, vscode.window.activeTextEditor.selection.active);\n\t}\n\n\tprivate _open(loc: vscode.Location, preserveFocus: boolean) {\n\t\tvscode.commands.executeCommand('vscode.open', loc.uri, {\n\t\t\tselection: new vscode.Selection(loc.range.start, loc.range.start),\n\t\t\tpreserveFocus\n\t\t});\n\t}\n\n\tprevious(preserveFocus: boolean): void {\n\t\tif (!this._delegate) {\n\t\t\treturn;\n\t\t}\n\t\tconst item = this._anchor();\n\t\tif (!item) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItem = this._delegate.previous(item);\n\t\tconst newLocation = this._delegate.location(newItem);\n\t\tif (newLocation) {\n\t\t\tthis._view.reveal(newItem, { select: true, focus: true });\n\t\t\tthis._open(newLocation, preserveFocus);\n\t\t}\n\t}\n\n\tnext(preserveFocus: boolean): void {\n\t\tif (!this._delegate) {\n\t\t\treturn;\n\t\t}\n\t\tconst item = this._anchor();\n\t\tif (!item) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItem = this._delegate.next(item);\n\t\tconst newLocation = this._delegate.location(newItem);\n\t\tif (newLocation) {\n\t\t\tthis._view.reveal(newItem, { select: true, focus: true });\n\t\t\tthis._open(newLocation, preserveFocus);\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolsTree } from '../tree';\nimport { FileItem, ReferenceItem, ReferencesModel, ReferencesTreeInput } from './model';\n\nexport function register(tree: SymbolsTree, context: vscode.ExtensionContext): void {\n\n\tfunction findLocations(title: string, command: string) {\n\t\tif (vscode.window.activeTextEditor) {\n\t\t\tconst input = new ReferencesTreeInput(title, new vscode.Location(vscode.window.activeTextEditor.document.uri, vscode.window.activeTextEditor.selection.active), command);\n\t\t\ttree.setInput(input);\n\t\t}\n\t}\n\n\tcontext.subscriptions.push(\n\t\tvscode.commands.registerCommand('references-view.findReferences', () => findLocations('References', 'vscode.executeReferenceProvider')),\n\t\tvscode.commands.registerCommand('references-view.findImplementations', () => findLocations('Implementations', 'vscode.executeImplementationProvider')),\n\t\t// --- legacy name\n\t\tvscode.commands.registerCommand('references-view.find', (...args: any[]) => vscode.commands.executeCommand('references-view.findReferences', ...args)),\n\t\tvscode.commands.registerCommand('references-view.removeReferenceItem', removeReferenceItem),\n\t\tvscode.commands.registerCommand('references-view.copy', copyCommand),\n\t\tvscode.commands.registerCommand('references-view.copyAll', copyAllCommand),\n\t\tvscode.commands.registerCommand('references-view.copyPath', copyPathCommand),\n\t);\n\n\n\t// --- references.preferredLocation setting\n\n\tlet showReferencesDisposable: vscode.Disposable | undefined;\n\tconst config = 'references.preferredLocation';\n\tfunction updateShowReferences(event?: vscode.ConfigurationChangeEvent) {\n\t\tif (event && !event.affectsConfiguration(config)) {\n\t\t\treturn;\n\t\t}\n\t\tconst value = vscode.workspace.getConfiguration().get<string>(config);\n\n\t\tshowReferencesDisposable?.dispose();\n\t\tshowReferencesDisposable = undefined;\n\n\t\tif (value === 'view') {\n\t\t\tshowReferencesDisposable = vscode.commands.registerCommand('editor.action.showReferences', async (uri: vscode.Uri, position: vscode.Position, locations: vscode.Location[]) => {\n\t\t\t\tconst input = new ReferencesTreeInput(vscode.l10n.t('References'), new vscode.Location(uri, position), 'vscode.executeReferenceProvider', locations);\n\t\t\t\ttree.setInput(input);\n\t\t\t});\n\t\t}\n\t}\n\tcontext.subscriptions.push(vscode.workspace.onDidChangeConfiguration(updateShowReferences));\n\tcontext.subscriptions.push({ dispose: () => showReferencesDisposable?.dispose() });\n\tupdateShowReferences();\n}\n\nconst copyAllCommand = async (item: ReferenceItem | FileItem | unknown) => {\n\tif (item instanceof ReferenceItem) {\n\t\tcopyCommand(item.file.model);\n\t} else if (item instanceof FileItem) {\n\t\tcopyCommand(item.model);\n\t}\n};\n\nfunction removeReferenceItem(item: FileItem | ReferenceItem | unknown) {\n\tif (item instanceof FileItem) {\n\t\titem.remove();\n\t} else if (item instanceof ReferenceItem) {\n\t\titem.remove();\n\t}\n}\n\n\nasync function copyCommand(item: ReferencesModel | ReferenceItem | FileItem | unknown) {\n\tlet val: string | undefined;\n\tif (item instanceof ReferencesModel) {\n\t\tval = await item.asCopyText();\n\t} else if (item instanceof ReferenceItem) {\n\t\tval = await item.asCopyText();\n\t} else if (item instanceof FileItem) {\n\t\tval = await item.asCopyText();\n\t}\n\tif (val) {\n\t\tawait vscode.env.clipboard.writeText(val);\n\t}\n}\n\nasync function copyPathCommand(item: FileItem | unknown) {\n\tif (item instanceof FileItem) {\n\t\tif (item.uri.scheme === 'file') {\n\t\t\tvscode.env.clipboard.writeText(item.uri.fsPath);\n\t\t} else {\n\t\t\tvscode.env.clipboard.writeText(item.uri.toString(true));\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolItemDragAndDrop, SymbolItemEditorHighlights, SymbolItemNavigation, SymbolTreeInput, SymbolTreeModel } from '../references-view';\nimport { asResourceUrl, del, getPreviewChunks, tail } from '../utils';\n\nexport class ReferencesTreeInput implements SymbolTreeInput<FileItem | ReferenceItem> {\n\n\treadonly contextValue: string;\n\n\tconstructor(\n\t\treadonly title: string,\n\t\treadonly location: vscode.Location,\n\t\tprivate readonly _command: string,\n\t\tprivate readonly _result?: vscode.Location[] | vscode.LocationLink[]\n\t) {\n\t\tthis.contextValue = _command;\n\t}\n\n\tasync resolve(): Promise<SymbolTreeModel<FileItem | ReferenceItem> | undefined> {\n\n\t\tlet model: ReferencesModel;\n\t\tif (this._result) {\n\t\t\tmodel = new ReferencesModel(this._result);\n\t\t} else {\n\t\t\tconst resut = await Promise.resolve(vscode.commands.executeCommand<vscode.Location[] | vscode.LocationLink[]>(this._command, this.location.uri, this.location.range.start));\n\t\t\tmodel = new ReferencesModel(resut ?? []);\n\t\t}\n\n\t\tif (model.items.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst provider = new ReferencesTreeDataProvider(model);\n\t\treturn {\n\t\t\tprovider,\n\t\t\tget message() { return model.message; },\n\t\t\tnavigation: model,\n\t\t\thighlights: model,\n\t\t\tdnd: model,\n\t\t\tdispose(): void {\n\t\t\t\tprovider.dispose();\n\t\t\t}\n\t\t};\n\t}\n\n\twith(location: vscode.Location): ReferencesTreeInput {\n\t\treturn new ReferencesTreeInput(this.title, location, this._command);\n\t}\n}\n\nexport class ReferencesModel implements SymbolItemNavigation<FileItem | ReferenceItem>, SymbolItemEditorHighlights<FileItem | ReferenceItem>, SymbolItemDragAndDrop<FileItem | ReferenceItem> {\n\n\tprivate _onDidChange = new vscode.EventEmitter<FileItem | ReferenceItem | undefined>();\n\treadonly onDidChangeTreeData = this._onDidChange.event;\n\n\treadonly items: FileItem[] = [];\n\n\tconstructor(locations: vscode.Location[] | vscode.LocationLink[]) {\n\t\tlet last: FileItem | undefined;\n\t\tfor (const item of locations.sort(ReferencesModel._compareLocations)) {\n\t\t\tconst loc = item instanceof vscode.Location\n\t\t\t\t? item\n\t\t\t\t: new vscode.Location(item.targetUri, item.targetRange);\n\n\t\t\tif (!last || ReferencesModel._compareUriIgnoreFragment(last.uri, loc.uri) !== 0) {\n\t\t\t\tlast = new FileItem(loc.uri.with({ fragment: '' }), [], this);\n\t\t\t\tthis.items.push(last);\n\t\t\t}\n\t\t\tlast.references.push(new ReferenceItem(loc, last));\n\t\t}\n\t}\n\n\tprivate static _compareUriIgnoreFragment(a: vscode.Uri, b: vscode.Uri): number {\n\t\tconst aStr = a.with({ fragment: '' }).toString();\n\t\tconst bStr = b.with({ fragment: '' }).toString();\n\t\tif (aStr < bStr) {\n\t\t\treturn -1;\n\t\t} else if (aStr > bStr) {\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tprivate static _compareLocations(a: vscode.Location | vscode.LocationLink, b: vscode.Location | vscode.LocationLink): number {\n\t\tconst aUri = a instanceof vscode.Location ? a.uri : a.targetUri;\n\t\tconst bUri = b instanceof vscode.Location ? b.uri : b.targetUri;\n\t\tif (aUri.toString() < bUri.toString()) {\n\t\t\treturn -1;\n\t\t} else if (aUri.toString() > bUri.toString()) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tconst aRange = a instanceof vscode.Location ? a.range : a.targetRange;\n\t\tconst bRange = b instanceof vscode.Location ? b.range : b.targetRange;\n\t\tif (aRange.start.isBefore(bRange.start)) {\n\t\t\treturn -1;\n\t\t} else if (aRange.start.isAfter(bRange.start)) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\t// --- adapter\n\n\tget message() {\n\t\tif (this.items.length === 0) {\n\t\t\treturn vscode.l10n.t('No results.');\n\t\t}\n\t\tconst total = this.items.reduce((prev, cur) => prev + cur.references.length, 0);\n\t\tconst files = this.items.length;\n\t\tif (total === 1 && files === 1) {\n\t\t\treturn vscode.l10n.t('{0} result in {1} file', total, files);\n\t\t} else if (total === 1) {\n\t\t\treturn vscode.l10n.t('{0} result in {1} files', total, files);\n\t\t} else if (files === 1) {\n\t\t\treturn vscode.l10n.t('{0} results in {1} file', total, files);\n\t\t} else {\n\t\t\treturn vscode.l10n.t('{0} results in {1} files', total, files);\n\t\t}\n\t}\n\n\tlocation(item: FileItem | ReferenceItem) {\n\t\treturn item instanceof ReferenceItem\n\t\t\t? item.location\n\t\t\t: new vscode.Location(item.uri, item.references[0]?.location.range ?? new vscode.Position(0, 0));\n\t}\n\n\tnearest(uri: vscode.Uri, position: vscode.Position): FileItem | ReferenceItem | undefined {\n\n\t\tif (this.items.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\t// NOTE: this.items is sorted by location (uri/range)\n\t\tfor (const item of this.items) {\n\t\t\tif (item.uri.toString() === uri.toString()) {\n\t\t\t\t// (1) pick the item at the request position\n\t\t\t\tfor (const ref of item.references) {\n\t\t\t\t\tif (ref.location.range.contains(position)) {\n\t\t\t\t\t\treturn ref;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// (2) pick the first item after or last before the request position\n\t\t\t\tlet lastBefore: ReferenceItem | undefined;\n\t\t\t\tfor (const ref of item.references) {\n\t\t\t\t\tif (ref.location.range.end.isAfter(position)) {\n\t\t\t\t\t\treturn ref;\n\t\t\t\t\t}\n\t\t\t\t\tlastBefore = ref;\n\t\t\t\t}\n\t\t\t\tif (lastBefore) {\n\t\t\t\t\treturn lastBefore;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// (3) pick the file with the longest common prefix\n\t\tlet best = 0;\n\t\tconst bestValue = ReferencesModel._prefixLen(this.items[best].toString(), uri.toString());\n\n\t\tfor (let i = 1; i < this.items.length; i++) {\n\t\t\tconst value = ReferencesModel._prefixLen(this.items[i].uri.toString(), uri.toString());\n\t\t\tif (value > bestValue) {\n\t\t\t\tbest = i;\n\t\t\t}\n\t\t}\n\n\t\treturn this.items[best].references[0];\n\t}\n\n\tprivate static _prefixLen(a: string, b: string): number {\n\t\tlet pos = 0;\n\t\twhile (pos < a.length && pos < b.length && a.charCodeAt(pos) === b.charCodeAt(pos)) {\n\t\t\tpos += 1;\n\t\t}\n\t\treturn pos;\n\t}\n\n\tnext(item: FileItem | ReferenceItem): FileItem | ReferenceItem {\n\t\treturn this._move(item, true) ?? item;\n\t}\n\n\tprevious(item: FileItem | ReferenceItem): FileItem | ReferenceItem {\n\t\treturn this._move(item, false) ?? item;\n\t}\n\n\tprivate _move(item: FileItem | ReferenceItem, fwd: boolean): ReferenceItem | void {\n\n\t\tconst delta = fwd ? +1 : -1;\n\n\t\tconst _move = (item: FileItem): FileItem => {\n\t\t\tconst idx = (this.items.indexOf(item) + delta + this.items.length) % this.items.length;\n\t\t\treturn this.items[idx];\n\t\t};\n\n\t\tif (item instanceof FileItem) {\n\t\t\tif (fwd) {\n\t\t\t\treturn _move(item).references[0];\n\t\t\t} else {\n\t\t\t\treturn tail(_move(item).references);\n\t\t\t}\n\t\t}\n\n\t\tif (item instanceof ReferenceItem) {\n\t\t\tconst idx = item.file.references.indexOf(item) + delta;\n\t\t\tif (idx < 0) {\n\t\t\t\treturn tail(_move(item.file).references);\n\t\t\t} else if (idx >= item.file.references.length) {\n\t\t\t\treturn _move(item.file).references[0];\n\t\t\t} else {\n\t\t\t\treturn item.file.references[idx];\n\t\t\t}\n\t\t}\n\t}\n\n\tgetEditorHighlights(_item: FileItem | ReferenceItem, uri: vscode.Uri): vscode.Range[] | undefined {\n\t\tconst file = this.items.find(file => file.uri.toString() === uri.toString());\n\t\treturn file?.references.map(ref => ref.location.range);\n\t}\n\n\tremove(item: FileItem | ReferenceItem) {\n\t\tif (item instanceof FileItem) {\n\t\t\tdel(this.items, item);\n\t\t\tthis._onDidChange.fire(undefined);\n\t\t} else {\n\t\t\tdel(item.file.references, item);\n\t\t\tif (item.file.references.length === 0) {\n\t\t\t\tdel(this.items, item.file);\n\t\t\t\tthis._onDidChange.fire(undefined);\n\t\t\t} else {\n\t\t\t\tthis._onDidChange.fire(item.file);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync asCopyText() {\n\t\tlet result = '';\n\t\tfor (const item of this.items) {\n\t\t\tresult += `${await item.asCopyText()}\\n`;\n\t\t}\n\t\treturn result;\n\t}\n\n\tgetDragUri(item: FileItem | ReferenceItem): vscode.Uri | undefined {\n\t\tif (item instanceof FileItem) {\n\t\t\treturn item.uri;\n\t\t} else {\n\t\t\treturn asResourceUrl(item.file.uri, item.location.range);\n\t\t}\n\t}\n}\n\nclass ReferencesTreeDataProvider implements vscode.TreeDataProvider<FileItem | ReferenceItem> {\n\n\tprivate readonly _listener: vscode.Disposable;\n\tprivate readonly _onDidChange = new vscode.EventEmitter<FileItem | ReferenceItem | undefined>();\n\n\treadonly onDidChangeTreeData = this._onDidChange.event;\n\n\tconstructor(private readonly _model: ReferencesModel) {\n\t\tthis._listener = _model.onDidChangeTreeData(() => this._onDidChange.fire(undefined));\n\t}\n\n\tdispose(): void {\n\t\tthis._onDidChange.dispose();\n\t\tthis._listener.dispose();\n\t}\n\n\tasync getTreeItem(element: FileItem | ReferenceItem) {\n\t\tif (element instanceof FileItem) {\n\t\t\t// files\n\t\t\tconst result = new vscode.TreeItem(element.uri);\n\t\t\tresult.contextValue = 'file-item';\n\t\t\tresult.description = true;\n\t\t\tresult.iconPath = vscode.ThemeIcon.File;\n\t\t\tresult.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed;\n\t\t\treturn result;\n\n\t\t} else {\n\t\t\t// references\n\t\t\tconst { range } = element.location;\n\t\t\tconst doc = await element.getDocument(true);\n\t\t\tconst { before, inside, after } = getPreviewChunks(doc, range);\n\n\t\t\tconst label: vscode.TreeItemLabel = {\n\t\t\t\tlabel: before + inside + after,\n\t\t\t\thighlights: [[before.length, before.length + inside.length]]\n\t\t\t};\n\n\t\t\tconst result = new vscode.TreeItem(label);\n\t\t\tresult.collapsibleState = vscode.TreeItemCollapsibleState.None;\n\t\t\tresult.contextValue = 'reference-item';\n\t\t\tresult.command = {\n\t\t\t\tcommand: 'vscode.open',\n\t\t\t\ttitle: vscode.l10n.t('Open Reference'),\n\t\t\t\targuments: [\n\t\t\t\t\telement.location.uri,\n\t\t\t\t\t{ selection: range.with({ end: range.start }) } satisfies vscode.TextDocumentShowOptions\n\t\t\t\t]\n\t\t\t};\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tasync getChildren(element?: FileItem | ReferenceItem) {\n\t\tif (!element) {\n\t\t\treturn this._model.items;\n\t\t}\n\t\tif (element instanceof FileItem) {\n\t\t\treturn element.references;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tgetParent(element: FileItem | ReferenceItem) {\n\t\treturn element instanceof ReferenceItem ? element.file : undefined;\n\t}\n}\n\nexport class FileItem {\n\n\tconstructor(\n\t\treadonly uri: vscode.Uri,\n\t\treadonly references: Array<ReferenceItem>,\n\t\treadonly model: ReferencesModel\n\t) { }\n\n\t// --- adapter\n\n\tremove(): void {\n\t\tthis.model.remove(this);\n\t}\n\n\tasync asCopyText() {\n\t\tlet result = `${vscode.workspace.asRelativePath(this.uri)}\\n`;\n\t\tfor (const ref of this.references) {\n\t\t\tresult += ` ${await ref.asCopyText()}\\n`;\n\t\t}\n\t\treturn result;\n\t}\n}\n\nexport class ReferenceItem {\n\n\tprivate _document: Thenable<vscode.TextDocument> | undefined;\n\n\tconstructor(\n\t\treadonly location: vscode.Location,\n\t\treadonly file: FileItem,\n\t) { }\n\n\tasync getDocument(warmUpNext?: boolean) {\n\t\tif (!this._document) {\n\t\t\tthis._document = vscode.workspace.openTextDocument(this.location.uri);\n\t\t}\n\t\tif (warmUpNext) {\n\t\t\t// load next document once this document has been loaded\n\t\t\tconst next = this.file.model.next(this.file);\n\t\t\tif (next instanceof FileItem && next !== this.file) {\n\t\t\t\tvscode.workspace.openTextDocument(next.uri);\n\t\t\t} else if (next instanceof ReferenceItem) {\n\t\t\t\tvscode.workspace.openTextDocument(next.location.uri);\n\t\t\t}\n\t\t}\n\t\treturn this._document;\n\t}\n\n\t// --- adapter\n\n\tremove(): void {\n\t\tthis.file.model.remove(this);\n\t}\n\n\tasync asCopyText() {\n\t\tconst doc = await this.getDocument();\n\t\tconst chunks = getPreviewChunks(doc, this.location.range, 21, false);\n\t\treturn `${this.location.range.start.line + 1}, ${this.location.range.start.character + 1}: ${chunks.before + chunks.inside + chunks.after}`;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { EditorHighlights } from './highlights';\nimport { Navigation } from './navigation';\nimport { SymbolItemDragAndDrop, SymbolTreeInput } from './references-view';\nimport { ContextKey, isValidRequestPosition, WordAnchor } from './utils';\n\n\nexport class SymbolsTree {\n\n\treadonly viewId = 'references-view.tree';\n\n\tprivate readonly _ctxIsActive = new ContextKey<boolean>('reference-list.isActive');\n\tprivate readonly _ctxHasResult = new ContextKey<boolean>('reference-list.hasResult');\n\tprivate readonly _ctxInputSource = new ContextKey<string>('reference-list.source');\n\n\tprivate readonly _history = new TreeInputHistory(this);\n\tprivate readonly _provider = new TreeDataProviderDelegate();\n\tprivate readonly _dnd = new TreeDndDelegate();\n\tprivate readonly _tree: vscode.TreeView<unknown>;\n\tprivate readonly _navigation: Navigation;\n\n\tprivate _input?: SymbolTreeInput<unknown>;\n\tprivate _sessionDisposable?: vscode.Disposable;\n\n\tconstructor() {\n\t\tthis._tree = vscode.window.createTreeView<unknown>(this.viewId, {\n\t\t\ttreeDataProvider: this._provider,\n\t\t\tshowCollapseAll: true,\n\t\t\tdragAndDropController: this._dnd\n\t\t});\n\t\tthis._navigation = new Navigation(this._tree);\n\t}\n\n\tdispose(): void {\n\t\tthis._history.dispose();\n\t\tthis._tree.dispose();\n\t\tthis._sessionDisposable?.dispose();\n\t}\n\n\tgetInput(): SymbolTreeInput<unknown> | undefined {\n\t\treturn this._input;\n\t}\n\n\tasync setInput(input: SymbolTreeInput<unknown>) {\n\n\t\tif (!await isValidRequestPosition(input.location.uri, input.location.range.start)) {\n\t\t\tthis.clearInput();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._ctxInputSource.set(input.contextValue);\n\t\tthis._ctxIsActive.set(true);\n\t\tthis._ctxHasResult.set(true);\n\t\tvscode.commands.executeCommand(`${this.viewId}.focus`);\n\n\t\tconst newInputKind = !this._input || Object.getPrototypeOf(this._input) !== Object.getPrototypeOf(input);\n\t\tthis._input = input;\n\t\tthis._sessionDisposable?.dispose();\n\n\t\tthis._tree.title = input.title;\n\t\tthis._tree.message = newInputKind ? undefined : this._tree.message;\n\n\t\tconst modelPromise = Promise.resolve(input.resolve());\n\n\t\t// set promise to tree data provider to trigger tree loading UI\n\t\tthis._provider.update(modelPromise.then(model => model?.provider ?? this._history));\n\t\tthis._dnd.update(modelPromise.then(model => model?.dnd));\n\n\t\tconst model = await modelPromise;\n\t\tif (this._input !== input) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!model) {\n\t\t\tthis.clearInput();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._history.add(input);\n\t\tthis._tree.message = model.message;\n\n\t\t// navigation\n\t\tthis._navigation.update(model.navigation);\n\n\t\t// reveal & select\n\t\tconst selection = model.navigation?.nearest(input.location.uri, input.location.range.start);\n\t\tif (selection && this._tree.visible) {\n\t\t\tawait this._tree.reveal(selection, { select: true, focus: true, expand: true });\n\t\t}\n\n\t\tconst disposables: vscode.Disposable[] = [];\n\n\t\t// editor highlights\n\t\tlet highlights: EditorHighlights<unknown> | undefined;\n\t\tif (model.highlights) {\n\t\t\thighlights = new EditorHighlights(this._tree, model.highlights);\n\t\t\tdisposables.push(highlights);\n\t\t}\n\n\t\t// listener\n\t\tif (model.provider.onDidChangeTreeData) {\n\t\t\tdisposables.push(model.provider.onDidChangeTreeData(() => {\n\t\t\t\tthis._tree.title = input.title;\n\t\t\t\tthis._tree.message = model.message;\n\t\t\t\thighlights?.update();\n\t\t\t}));\n\t\t}\n\t\tif (typeof model.dispose === 'function') {\n\t\t\tdisposables.push(new vscode.Disposable(() => model.dispose!()));\n\t\t}\n\t\tthis._sessionDisposable = vscode.Disposable.from(...disposables);\n\t}\n\n\tclearInput(): void {\n\t\tthis._sessionDisposable?.dispose();\n\t\tthis._input = undefined;\n\t\tthis._ctxHasResult.set(false);\n\t\tthis._ctxInputSource.reset();\n\t\tthis._tree.title = vscode.l10n.t('References');\n\t\tthis._tree.message = this._history.size === 0\n\t\t\t? vscode.l10n.t('No results.')\n\t\t\t: vscode.l10n.t('No results. Try running a previous search again:');\n\t\tthis._provider.update(Promise.resolve(this._history));\n\t}\n}\n\n// --- tree data\n\ninterface ActiveTreeDataProviderWrapper {\n\tprovider: Promise<vscode.TreeDataProvider<any>>;\n}\n\nclass TreeDataProviderDelegate implements vscode.TreeDataProvider<undefined> {\n\n\tprovider?: Promise<vscode.TreeDataProvider<any>>;\n\n\tprivate _sessionDispoables?: vscode.Disposable;\n\tprivate _onDidChange = new vscode.EventEmitter<any>();\n\n\treadonly onDidChangeTreeData = this._onDidChange.event;\n\n\tupdate(provider: Promise<vscode.TreeDataProvider<any>>) {\n\n\t\tthis._sessionDispoables?.dispose();\n\t\tthis._sessionDispoables = undefined;\n\n\t\tthis._onDidChange.fire(undefined);\n\n\t\tthis.provider = provider;\n\n\t\tprovider.then(value => {\n\t\t\tif (this.provider === provider && value.onDidChangeTreeData) {\n\t\t\t\tthis._sessionDispoables = value.onDidChangeTreeData(this._onDidChange.fire, this._onDidChange);\n\t\t\t}\n\t\t}).catch(err => {\n\t\t\tthis.provider = undefined;\n\t\t\tconsole.error(err);\n\t\t});\n\t}\n\n\tasync getTreeItem(element: unknown) {\n\t\tthis._assertProvider();\n\t\treturn (await this.provider).getTreeItem(element);\n\t}\n\n\tasync getChildren(parent?: unknown | undefined) {\n\t\tthis._assertProvider();\n\t\treturn (await this.provider).getChildren(parent);\n\t}\n\n\tasync getParent(element: unknown) {\n\t\tthis._assertProvider();\n\t\tconst provider = await this.provider;\n\t\treturn provider.getParent ? provider.getParent(element) : undefined;\n\t}\n\n\tprivate _assertProvider(): asserts this is ActiveTreeDataProviderWrapper {\n\t\tif (!this.provider) {\n\t\t\tthrow new Error('MISSING provider');\n\t\t}\n\t}\n}\n\n// --- tree dnd\n\nclass TreeDndDelegate implements vscode.TreeDragAndDropController<undefined> {\n\n\tprivate _delegate: SymbolItemDragAndDrop<undefined> | undefined;\n\n\treadonly dropMimeTypes: string[] = [];\n\n\treadonly dragMimeTypes: string[] = ['text/uri-list'];\n\n\tupdate(delegate: Promise<SymbolItemDragAndDrop<unknown> | undefined>) {\n\t\tthis._delegate = undefined;\n\t\tdelegate.then(value => this._delegate = value);\n\t}\n\n\thandleDrag(source: undefined[], data: vscode.DataTransfer) {\n\t\tif (this._delegate) {\n\t\t\tconst urls: string[] = [];\n\t\t\tfor (const item of source) {\n\t\t\t\tconst uri = this._delegate.getDragUri(item);\n\t\t\t\tif (uri) {\n\t\t\t\t\turls.push(uri.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (urls.length > 0) {\n\t\t\t\tdata.set('text/uri-list', new vscode.DataTransferItem(urls.join('\\r\\n')));\n\t\t\t}\n\t\t}\n\t}\n\n\thandleDrop(): void | Thenable<void> {\n\t\tthrow new Error('Method not implemented.');\n\t}\n}\n\n// --- history\n\nclass HistoryItem {\n\n\treadonly description: string;\n\n\tconstructor(\n\t\treadonly key: string,\n\t\treadonly word: string,\n\t\treadonly anchor: WordAnchor,\n\t\treadonly input: SymbolTreeInput<unknown>,\n\t) {\n\t\tthis.description = `${vscode.workspace.asRelativePath(input.location.uri)} • ${input.title.toLocaleLowerCase()}`;\n\t}\n}\n\nclass TreeInputHistory implements vscode.TreeDataProvider<HistoryItem> {\n\n\tprivate readonly _onDidChangeTreeData = new vscode.EventEmitter<HistoryItem | undefined>();\n\treadonly onDidChangeTreeData = this._onDidChangeTreeData.event;\n\n\tprivate readonly _disposables: vscode.Disposable[] = [];\n\tprivate readonly _ctxHasHistory = new ContextKey<boolean>('reference-list.hasHistory');\n\tprivate readonly _inputs = new Map<string, HistoryItem>();\n\n\tconstructor(private readonly _tree: SymbolsTree) {\n\n\t\tthis._disposables.push(\n\t\t\tvscode.commands.registerCommand('references-view.clear', () => _tree.clearInput()),\n\t\t\tvscode.commands.registerCommand('references-view.clearHistory', () => {\n\t\t\t\tthis.clear();\n\t\t\t\t_tree.clearInput();\n\t\t\t}),\n\t\t\tvscode.commands.registerCommand('references-view.refind', (item) => {\n\t\t\t\tif (item instanceof HistoryItem) {\n\t\t\t\t\tthis._reRunHistoryItem(item);\n\t\t\t\t}\n\t\t\t}),\n\t\t\tvscode.commands.registerCommand('references-view.refresh', () => {\n\t\t\t\tconst item = Array.from(this._inputs.values()).pop();\n\t\t\t\tif (item) {\n\t\t\t\t\tthis._reRunHistoryItem(item);\n\t\t\t\t}\n\t\t\t}),\n\t\t\tvscode.commands.registerCommand('_references-view.showHistoryItem', async (item) => {\n\t\t\t\tif (item instanceof HistoryItem) {\n\t\t\t\t\tconst position = item.anchor.guessedTrackedPosition() ?? item.input.location.range.start;\n\t\t\t\t\tawait vscode.commands.executeCommand('vscode.open', item.input.location.uri, { selection: new vscode.Range(position, position) });\n\t\t\t\t}\n\t\t\t}),\n\t\t\tvscode.commands.registerCommand('references-view.pickFromHistory', async () => {\n\t\t\t\tinterface HistoryPick extends vscode.QuickPickItem {\n\t\t\t\t\titem: HistoryItem;\n\t\t\t\t}\n\t\t\t\tconst entries = await this.getChildren();\n\t\t\t\tconst picks = entries.map((item): HistoryPick => ({\n\t\t\t\t\tlabel: item.word,\n\t\t\t\t\tdescription: item.description,\n\t\t\t\t\titem\n\t\t\t\t}));\n\t\t\t\tconst pick = await vscode.window.showQuickPick(picks, { placeHolder: vscode.l10n.t('Select previous reference search') });\n\t\t\t\tif (pick) {\n\t\t\t\t\tthis._reRunHistoryItem(pick.item);\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\t}\n\n\tdispose(): void {\n\t\tvscode.Disposable.from(...this._disposables).dispose();\n\t\tthis._onDidChangeTreeData.dispose();\n\t}\n\n\tprivate _reRunHistoryItem(item: HistoryItem): void {\n\t\tthis._inputs.delete(item.key);\n\t\tconst newPosition = item.anchor.guessedTrackedPosition();\n\t\tlet newInput = item.input;\n\t\t// create a new input when having a tracked position which is\n\t\t// different than the original position.\n\t\tif (newPosition && !item.input.location.range.start.isEqual(newPosition)) {\n\t\t\tnewInput = item.input.with(new vscode.Location(item.input.location.uri, newPosition));\n\t\t}\n\t\tthis._tree.setInput(newInput);\n\t}\n\n\tasync add(input: SymbolTreeInput<unknown>) {\n\n\t\tconst doc = await vscode.workspace.openTextDocument(input.location.uri);\n\n\t\tconst anchor = new WordAnchor(doc, input.location.range.start);\n\t\tconst range = doc.getWordRangeAtPosition(input.location.range.start) ?? doc.getWordRangeAtPosition(input.location.range.start, /[^\\s]+/);\n\t\tconst word = range ? doc.getText(range) : '???';\n\n\t\tconst item = new HistoryItem(JSON.stringify([range?.start ?? input.location.range.start, input.location.uri, input.title]), word, anchor, input);\n\t\t// use filo-ordering of native maps\n\t\tthis._inputs.delete(item.key);\n\t\tthis._inputs.set(item.key, item);\n\t\tthis._ctxHasHistory.set(true);\n\t}\n\n\tclear(): void {\n\t\tthis._inputs.clear();\n\t\tthis._ctxHasHistory.set(false);\n\t\tthis._onDidChangeTreeData.fire(undefined);\n\t}\n\n\tget size() {\n\t\treturn this._inputs.size;\n\t}\n\n\t// --- tree data provider\n\n\tgetTreeItem(item: HistoryItem): vscode.TreeItem {\n\t\tconst result = new vscode.TreeItem(item.word);\n\t\tresult.description = item.description;\n\t\tresult.command = { command: '_references-view.showHistoryItem', arguments: [item], title: vscode.l10n.t('Rerun') };\n\t\tresult.collapsibleState = vscode.TreeItemCollapsibleState.None;\n\t\tresult.contextValue = 'history-item';\n\t\treturn result;\n\t}\n\n\tgetChildren() {\n\t\treturn Promise.all([...this._inputs.values()].reverse());\n\t}\n\n\tgetParent() {\n\t\treturn undefined;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolsTree } from '../tree';\nimport { ContextKey } from '../utils';\nimport { TypeHierarchyDirection, TypeItem, TypesTreeInput } from './model';\n\nexport function register(tree: SymbolsTree, context: vscode.ExtensionContext): void {\n\n\tconst direction = new RichTypesDirection(context.workspaceState, TypeHierarchyDirection.Subtypes);\n\n\tfunction showTypeHierarchy() {\n\t\tif (vscode.window.activeTextEditor) {\n\t\t\tconst input = new TypesTreeInput(new vscode.Location(vscode.window.activeTextEditor.document.uri, vscode.window.activeTextEditor.selection.active), direction.value);\n\t\t\ttree.setInput(input);\n\t\t}\n\t}\n\n\tfunction setTypeHierarchyDirection(value: TypeHierarchyDirection, anchor: TypeItem | vscode.Location | unknown) {\n\t\tdirection.value = value;\n\n\t\tlet newInput: TypesTreeInput | undefined;\n\t\tconst oldInput = tree.getInput();\n\t\tif (anchor instanceof TypeItem) {\n\t\t\tnewInput = new TypesTreeInput(new vscode.Location(anchor.item.uri, anchor.item.selectionRange.start), direction.value);\n\t\t} else if (anchor instanceof vscode.Location) {\n\t\t\tnewInput = new TypesTreeInput(anchor, direction.value);\n\t\t} else if (oldInput instanceof TypesTreeInput) {\n\t\t\tnewInput = new TypesTreeInput(oldInput.location, direction.value);\n\t\t}\n\t\tif (newInput) {\n\t\t\ttree.setInput(newInput);\n\t\t}\n\t}\n\n\tcontext.subscriptions.push(\n\t\tvscode.commands.registerCommand('references-view.showTypeHierarchy', showTypeHierarchy),\n\t\tvscode.commands.registerCommand('references-view.showSupertypes', (item: TypeItem | vscode.Location | unknown) => setTypeHierarchyDirection(TypeHierarchyDirection.Supertypes, item)),\n\t\tvscode.commands.registerCommand('references-view.showSubtypes', (item: TypeItem | vscode.Location | unknown) => setTypeHierarchyDirection(TypeHierarchyDirection.Subtypes, item)),\n\t\tvscode.commands.registerCommand('references-view.removeTypeItem', removeTypeItem)\n\t);\n}\n\nfunction removeTypeItem(item: TypeItem | unknown): void {\n\tif (item instanceof TypeItem) {\n\t\titem.remove();\n\t}\n}\n\nclass RichTypesDirection {\n\n\tprivate static _key = 'references-view.typeHierarchyMode';\n\n\tprivate _ctxMode = new ContextKey<TypeHierarchyDirection>('references-view.typeHierarchyMode');\n\n\tconstructor(\n\t\tprivate _mem: vscode.Memento,\n\t\tprivate _value: TypeHierarchyDirection = TypeHierarchyDirection.Subtypes,\n\t) {\n\t\tconst raw = _mem.get<TypeHierarchyDirection>(RichTypesDirection._key);\n\t\tif (typeof raw === 'string') {\n\t\t\tthis.value = raw;\n\t\t} else {\n\t\t\tthis.value = _value;\n\t\t}\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\tset value(value: TypeHierarchyDirection) {\n\t\tthis._value = value;\n\t\tthis._ctxMode.set(value);\n\t\tthis._mem.update(RichTypesDirection._key, value);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolItemDragAndDrop, SymbolItemEditorHighlights, SymbolItemNavigation, SymbolTreeInput } from '../references-view';\nimport { asResourceUrl, del, getThemeIcon, tail } from '../utils';\n\nexport class TypesTreeInput implements SymbolTreeInput<TypeItem> {\n\n\treadonly title: string;\n\treadonly contextValue: string = 'typeHierarchy';\n\n\tconstructor(\n\t\treadonly location: vscode.Location,\n\t\treadonly direction: TypeHierarchyDirection,\n\t) {\n\t\tthis.title = direction === TypeHierarchyDirection.Supertypes\n\t\t\t? vscode.l10n.t('Supertypes Of')\n\t\t\t: vscode.l10n.t('Subtypes Of');\n\t}\n\n\tasync resolve() {\n\n\t\tconst items = await Promise.resolve(vscode.commands.executeCommand<vscode.TypeHierarchyItem[]>('vscode.prepareTypeHierarchy', this.location.uri, this.location.range.start));\n\t\tconst model = new TypesModel(this.direction, items ?? []);\n\t\tconst provider = new TypeItemDataProvider(model);\n\n\t\tif (model.roots.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn {\n\t\t\tprovider,\n\t\t\tget message() { return model.roots.length === 0 ? vscode.l10n.t('No results.') : undefined; },\n\t\t\tnavigation: model,\n\t\t\thighlights: model,\n\t\t\tdnd: model,\n\t\t\tdispose() {\n\t\t\t\tprovider.dispose();\n\t\t\t}\n\t\t};\n\t}\n\n\twith(location: vscode.Location): TypesTreeInput {\n\t\treturn new TypesTreeInput(location, this.direction);\n\t}\n}\n\n\nexport const enum TypeHierarchyDirection {\n\tSubtypes = 'subtypes',\n\tSupertypes = 'supertypes'\n}\n\n\nexport class TypeItem {\n\n\tchildren?: TypeItem[];\n\n\tconstructor(\n\t\treadonly model: TypesModel,\n\t\treadonly item: vscode.TypeHierarchyItem,\n\t\treadonly parent: TypeItem | undefined,\n\t) { }\n\n\tremove(): void {\n\t\tthis.model.remove(this);\n\t}\n}\n\nclass TypesModel implements SymbolItemNavigation<TypeItem>, SymbolItemEditorHighlights<TypeItem>, SymbolItemDragAndDrop<TypeItem> {\n\n\treadonly roots: TypeItem[] = [];\n\n\tprivate readonly _onDidChange = new vscode.EventEmitter<TypesModel>();\n\treadonly onDidChange = this._onDidChange.event;\n\n\tconstructor(readonly direction: TypeHierarchyDirection, items: vscode.TypeHierarchyItem[]) {\n\t\tthis.roots = items.map(item => new TypeItem(this, item, undefined));\n\t}\n\n\tprivate async _resolveTypes(currentType: TypeItem): Promise<TypeItem[]> {\n\t\tif (this.direction === TypeHierarchyDirection.Supertypes) {\n\t\t\tconst types = await vscode.commands.executeCommand<vscode.TypeHierarchyItem[]>('vscode.provideSupertypes', currentType.item);\n\t\t\treturn types ? types.map(item => new TypeItem(this, item, currentType)) : [];\n\t\t} else {\n\t\t\tconst types = await vscode.commands.executeCommand<vscode.TypeHierarchyItem[]>('vscode.provideSubtypes', currentType.item);\n\t\t\treturn types ? types.map(item => new TypeItem(this, item, currentType)) : [];\n\t\t}\n\t}\n\n\tasync getTypeChildren(item: TypeItem): Promise<TypeItem[]> {\n\t\tif (!item.children) {\n\t\t\titem.children = await this._resolveTypes(item);\n\t\t}\n\t\treturn item.children;\n\t}\n\n\t// -- dnd\n\n\tgetDragUri(item: TypeItem): vscode.Uri | undefined {\n\t\treturn asResourceUrl(item.item.uri, item.item.range);\n\t}\n\n\t// -- navigation\n\n\tlocation(currentType: TypeItem) {\n\t\treturn new vscode.Location(currentType.item.uri, currentType.item.range);\n\t}\n\n\tnearest(uri: vscode.Uri, _position: vscode.Position): TypeItem | undefined {\n\t\treturn this.roots.find(item => item.item.uri.toString() === uri.toString()) ?? this.roots[0];\n\t}\n\n\tnext(from: TypeItem): TypeItem {\n\t\treturn this._move(from, true) ?? from;\n\t}\n\n\tprevious(from: TypeItem): TypeItem {\n\t\treturn this._move(from, false) ?? from;\n\t}\n\n\tprivate _move(item: TypeItem, fwd: boolean): TypeItem | void {\n\t\tif (item.children?.length) {\n\t\t\treturn fwd ? item.children[0] : tail(item.children);\n\t\t}\n\t\tconst array = this.roots.includes(item) ? this.roots : item.parent?.children;\n\t\tif (array?.length) {\n\t\t\tconst idx = array.indexOf(item);\n\t\t\tconst delta = fwd ? 1 : -1;\n\t\t\treturn array[idx + delta + array.length % array.length];\n\t\t}\n\t}\n\n\t// --- highlights\n\n\tgetEditorHighlights(currentType: TypeItem, uri: vscode.Uri): vscode.Range[] | undefined {\n\t\treturn currentType.item.uri.toString() === uri.toString() ? [currentType.item.selectionRange] : undefined;\n\t}\n\n\tremove(item: TypeItem) {\n\t\tconst isInRoot = this.roots.includes(item);\n\t\tconst siblings = isInRoot ? this.roots : item.parent?.children;\n\t\tif (siblings) {\n\t\t\tdel(siblings, item);\n\t\t\tthis._onDidChange.fire(this);\n\t\t}\n\t}\n}\n\nclass TypeItemDataProvider implements vscode.TreeDataProvider<TypeItem> {\n\n\tprivate readonly _emitter = new vscode.EventEmitter<TypeItem | undefined>();\n\treadonly onDidChangeTreeData = this._emitter.event;\n\n\tprivate readonly _modelListener: vscode.Disposable;\n\n\tconstructor(private _model: TypesModel) {\n\t\tthis._modelListener = _model.onDidChange(e => this._emitter.fire(e instanceof TypeItem ? e : undefined));\n\t}\n\n\tdispose(): void {\n\t\tthis._emitter.dispose();\n\t\tthis._modelListener.dispose();\n\t}\n\n\tgetTreeItem(element: TypeItem): vscode.TreeItem {\n\n\t\tconst item = new vscode.TreeItem(element.item.name);\n\t\titem.description = element.item.detail;\n\t\titem.contextValue = 'type-item';\n\t\titem.iconPath = getThemeIcon(element.item.kind);\n\t\titem.command = {\n\t\t\tcommand: 'vscode.open',\n\t\t\ttitle: vscode.l10n.t('Open Type'),\n\t\t\targuments: [\n\t\t\t\telement.item.uri,\n\t\t\t\t{ selection: element.item.selectionRange.with({ end: element.item.selectionRange.start }) } satisfies vscode.TextDocumentShowOptions\n\t\t\t]\n\t\t};\n\t\titem.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed;\n\t\treturn item;\n\t}\n\n\tgetChildren(element?: TypeItem | undefined) {\n\t\treturn element\n\t\t\t? this._model.getTypeChildren(element)\n\t\t\t: this._model.roots;\n\t}\n\n\tgetParent(element: TypeItem) {\n\t\treturn element.parent;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\n\nexport function del<T>(array: T[], e: T): void {\n\tconst idx = array.indexOf(e);\n\tif (idx >= 0) {\n\t\tarray.splice(idx, 1);\n\t}\n}\n\nexport function tail<T>(array: T[]): T | undefined {\n\treturn array[array.length - 1];\n}\n\nexport function asResourceUrl(uri: vscode.Uri, range: vscode.Range): vscode.Uri {\n\treturn uri.with({ fragment: `L${1 + range.start.line},${1 + range.start.character}-${1 + range.end.line},${1 + range.end.character}` });\n}\n\nexport async function isValidRequestPosition(uri: vscode.Uri, position: vscode.Position) {\n\tconst doc = await vscode.workspace.openTextDocument(uri);\n\tlet range = doc.getWordRangeAtPosition(position);\n\tif (!range) {\n\t\trange = doc.getWordRangeAtPosition(position, /[^\\s]+/);\n\t}\n\treturn Boolean(range);\n}\n\nexport function getPreviewChunks(doc: vscode.TextDocument, range: vscode.Range, beforeLen: number = 8, trim: boolean = true) {\n\tconst previewStart = range.start.with({ character: Math.max(0, range.start.character - beforeLen) });\n\tconst wordRange = doc.getWordRangeAtPosition(previewStart);\n\tlet before = doc.getText(new vscode.Range(wordRange ? wordRange.start : previewStart, range.start));\n\tconst inside = doc.getText(range);\n\tconst previewEnd = range.end.translate(0, 331);\n\tlet after = doc.getText(new vscode.Range(range.end, previewEnd));\n\tif (trim) {\n\t\tbefore = before.replace(/^\\s*/g, '');\n\t\tafter = after.replace(/\\s*$/g, '');\n\t}\n\treturn { before, inside, after };\n}\n\nexport class ContextKey<V> {\n\n\tconstructor(readonly name: string) { }\n\n\tasync set(value: V) {\n\t\tawait vscode.commands.executeCommand('setContext', this.name, value);\n\t}\n\n\tasync reset() {\n\t\tawait vscode.commands.executeCommand('setContext', this.name, undefined);\n\t}\n}\n\nexport class WordAnchor {\n\n\tprivate readonly _version: number;\n\tprivate readonly _word: string | undefined;\n\n\tconstructor(private readonly _doc: vscode.TextDocument, private readonly _position: vscode.Position) {\n\t\tthis._version = _doc.version;\n\t\tthis._word = this._getAnchorWord(_doc, _position);\n\t}\n\n\tprivate _getAnchorWord(doc: vscode.TextDocument, pos: vscode.Position): string | undefined {\n\t\tconst range = doc.getWordRangeAtPosition(pos) || doc.getWordRangeAtPosition(pos, /[^\\s]+/);\n\t\treturn range && doc.getText(range);\n\t}\n\n\tguessedTrackedPosition(): vscode.Position | undefined {\n\t\t// funky entry\n\t\tif (!this._word) {\n\t\t\treturn this._position;\n\t\t}\n\n\t\t// no changes\n\t\tif (this._version === this._doc.version) {\n\t\t\treturn this._position;\n\t\t}\n\n\t\t// no changes here...\n\t\tconst wordNow = this._getAnchorWord(this._doc, this._position);\n\t\tif (this._word === wordNow) {\n\t\t\treturn this._position;\n\t\t}\n\n\t\t// changes: search _word downwards and upwards\n\t\tconst startLine = this._position.line;\n\t\tlet i = 0;\n\t\tlet line: number;\n\t\tlet checked: boolean;\n\t\tdo {\n\t\t\tchecked = false;\n\t\t\t// nth line down\n\t\t\tline = startLine + i;\n\t\t\tif (line < this._doc.lineCount) {\n\t\t\t\tchecked = true;\n\t\t\t\tconst ch = this._doc.lineAt(line).text.indexOf(this._word);\n\t\t\t\tif (ch >= 0) {\n\t\t\t\t\treturn new vscode.Position(line, ch);\n\t\t\t\t}\n\t\t\t}\n\t\t\ti += 1;\n\t\t\t// nth line up\n\t\t\tline = startLine - i;\n\t\t\tif (line >= 0) {\n\t\t\t\tchecked = true;\n\t\t\t\tconst ch = this._doc.lineAt(line).text.indexOf(this._word);\n\t\t\t\tif (ch >= 0) {\n\t\t\t\t\treturn new vscode.Position(line, ch);\n\t\t\t\t}\n\t\t\t}\n\t\t} while (i < 100 && checked);\n\n\t\t// fallback\n\t\treturn this._position;\n\t}\n}\n\n// vscode.SymbolKind.File === 0, Module === 1, etc...\nconst _themeIconIds = [\n\t'symbol-file', 'symbol-module', 'symbol-namespace', 'symbol-package', 'symbol-class', 'symbol-method',\n\t'symbol-property', 'symbol-field', 'symbol-constructor', 'symbol-enum', 'symbol-interface',\n\t'symbol-function', 'symbol-variable', 'symbol-constant', 'symbol-string', 'symbol-number', 'symbol-boolean',\n\t'symbol-array', 'symbol-object', 'symbol-key', 'symbol-null', 'symbol-enum-member', 'symbol-struct',\n\t'symbol-event', 'symbol-operator', 'symbol-type-parameter'\n];\n\nexport function getThemeIcon(kind: vscode.SymbolKind): vscode.ThemeIcon | undefined {\n\tconst id = _themeIconIds[kind];\n\treturn id ? new vscode.ThemeIcon(id) : undefined;\n}\n","module.exports = require(\"vscode\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(256);\n"],"names":["tree","context","direction","RichCallsDirection","workspaceState","setCallsDirection","value","anchor","newInput","oldInput","getInput","CallItem","CallsTreeInput","vscode","Location","item","uri","selectionRange","start","location","setInput","subscriptions","push","commands","registerCommand","window","activeTextEditor","input","document","selection","active","removeCallItem","remove","constructor","_mem","_value","_ctxMode","ContextKey","raw","get","_key","this","set","update","contextValue","title","l10n","t","resolve","items","Promise","executeCommand","range","model","CallsModel","provider","CallItemDataProvider","roots","length","message","undefined","navigation","highlights","dnd","dispose","parent","locations","_onDidChange","EventEmitter","onDidChange","event","map","_resolveCalls","call","calls","from","fromRanges","to","getCallChildren","children","nearest","_position","find","toString","next","_move","previous","fwd","tail","array","includes","idx","indexOf","getDragUri","asResourceUrl","getEditorHighlights","filter","loc","siblings","del","fire","_model","_emitter","onDidChangeTreeData","_modelListener","e","getTreeItem","element","TreeItem","name","openArgs","description","detail","tooltip","label","iconPath","getThemeIcon","kind","with","end","firstLoctionStart","isBefore","Range","command","arguments","collapsibleState","TreeItemCollapsibleState","Collapsed","getChildren","getParent","SymbolsTree","references","register","types","_view","_delegate","_decorationType","createTextEditorDecorationType","backgroundColor","ThemeColor","rangeBehavior","DecorationRangeBehavior","ClosedClosed","overviewRulerLane","OverviewRulerLane","Center","overviewRulerColor","disposables","_ignore","Set","workspace","onDidChangeTextDocument","add","onDidChangeActiveTextEditor","visible","onDidChangeVisibility","_show","_hide","onDidChangeSelection","Disposable","editor","visibleTextEditors","setDecorations","viewColumn","has","ranges","_disposables","_ctxCanNavigate","delegate","Boolean","_anchor","sel","_open","preserveFocus","Selection","newItem","newLocation","reveal","select","focus","findLocations","ReferencesTreeInput","showReferencesDisposable","args","removeReferenceItem","copyCommand","copyAllCommand","copyPathCommand","config","updateShowReferences","affectsConfiguration","getConfiguration","async","position","onDidChangeConfiguration","ReferenceItem","file","FileItem","val","ReferencesModel","asCopyText","env","clipboard","writeText","scheme","fsPath","_command","_result","resut","ReferencesTreeDataProvider","last","sort","_compareLocations","targetUri","targetRange","_compareUriIgnoreFragment","fragment","a","b","aStr","bStr","aUri","bUri","aRange","bRange","isAfter","total","reduce","prev","cur","files","Position","ref","contains","lastBefore","best","bestValue","_prefixLen","i","pos","charCodeAt","delta","_item","result","_listener","ThemeIcon","File","doc","getDocument","before","inside","after","getPreviewChunks","None","asRelativePath","warmUpNext","_document","openTextDocument","chunks","line","character","viewId","_ctxIsActive","_ctxHasResult","_ctxInputSource","_history","TreeInputHistory","_provider","TreeDataProviderDelegate","_dnd","TreeDndDelegate","_tree","createTreeView","treeDataProvider","showCollapseAll","dragAndDropController","_navigation","Navigation","_sessionDisposable","_input","isValidRequestPosition","clearInput","newInputKind","Object","getPrototypeOf","modelPromise","then","expand","EditorHighlights","reset","size","_sessionDispoables","catch","err","console","error","_assertProvider","Error","dropMimeTypes","dragMimeTypes","handleDrag","source","data","urls","DataTransferItem","join","handleDrop","HistoryItem","key","word","toLocaleLowerCase","_onDidChangeTreeData","_ctxHasHistory","_inputs","Map","clear","_reRunHistoryItem","Array","values","pop","guessedTrackedPosition","picks","pick","showQuickPick","placeHolder","delete","newPosition","isEqual","WordAnchor","getWordRangeAtPosition","getText","JSON","stringify","all","reverse","RichTypesDirection","setTypeHierarchyDirection","TypeItem","TypesTreeInput","removeTypeItem","TypesModel","TypeItemDataProvider","_resolveTypes","currentType","getTypeChildren","splice","beforeLen","trim","previewStart","Math","max","wordRange","previewEnd","translate","replace","id","_themeIconIds","_doc","_version","version","_word","_getAnchorWord","wordNow","startLine","checked","lineCount","ch","lineAt","text","module","exports","require","__webpack_module_cache__","__webpack_exports__","__webpack_require__","moduleId","cachedModule","__webpack_modules__"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"extension.js","mappings":"65BAKA,kBAEA,SAEA,MAAaA,EAKZ,WAAAC,CACUC,EACAC,GADA,KAAAD,SAAAA,EACA,KAAAC,UAAAA,EAJD,KAAAC,aAAuB,gBAM/BC,KAAKC,MAAsB,eAAdH,EAC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KAC7C/O,EAAOqG,UAAUsF,iBAAiB/I,EAAKpC,KAC7BoC,aAAgBkM,GAC1B9O,EAAOqG,UAAUsF,iBAAiB/I,EAAKjD,SAASa,IAElD,CACA,OAAOV,KAAK6W,SACb,CAIA,MAAAjV,GACC5B,KAAKiP,KAAKpO,MAAMe,OAAO5B,KACxB,CAEA,gBAAMqP,GACL,MAAMzD,QAAY5L,KAAK0W,cACjBI,GAAS,IAAAH,kBAAiB/K,EAAK5L,KAAKH,SAASc,MAAO,IAAI,GAC9D,MAAO,GAAGX,KAAKH,SAASc,MAAMC,MAAM4K,KAAO,MAAMxL,KAAKH,SAASc,MAAMC,MAAM6K,UAAY,MAAMqL,EAAOzK,OAASyK,EAAOvK,OAASuK,EAAOpK,OACrI,EAnCD,iB,GC3VIqK,EAA2B,CAAC,ECE5BC,EDCJ,SAASC,EAAoBC,GAE5B,IAAIC,EAAeJ,EAAyBG,GAC5C,QAAqB9V,IAAjB+V,EACH,OAAOA,EAAalJ,QAGrB,IAAID,EAAS+I,EAAyBG,GAAY,CAGjDjJ,QAAS,CAAC,GAOX,OAHAmJ,EAAoBF,GAAU9N,KAAK4E,EAAOC,QAASD,EAAQA,EAAOC,QAASgJ,GAGpEjJ,EAAOC,OACf,CCnB0BgJ,CAAoB,K","sources":["webpack://references-view/./src/types/model.ts","webpack://references-view/./src/highlights.ts","webpack://references-view/./src/navigation.ts","webpack://references-view/./src/calls/model.ts","webpack://references-view/./src/types/index.ts","webpack://references-view/./src/extension.ts","webpack://references-view/./src/utils.ts","webpack://references-view/external commonjs \"vscode\"","webpack://references-view/./src/references/index.ts","webpack://references-view/./src/calls/index.ts","webpack://references-view/./src/tree.ts","webpack://references-view/./src/references/model.ts","webpack://references-view/webpack/bootstrap","webpack://references-view/webpack/startup"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolItemDragAndDrop, SymbolItemEditorHighlights, SymbolItemNavigation, SymbolTreeInput } from '../references-view';\nimport { asResourceUrl, del, getThemeIcon, tail } from '../utils';\n\nexport class TypesTreeInput implements SymbolTreeInput<TypeItem> {\n\n\treadonly title: string;\n\treadonly contextValue: string = 'typeHierarchy';\n\n\tconstructor(\n\t\treadonly location: vscode.Location,\n\t\treadonly direction: TypeHierarchyDirection,\n\t) {\n\t\tthis.title = direction === TypeHierarchyDirection.Supertypes\n\t\t\t? vscode.l10n.t('Supertypes Of')\n\t\t\t: vscode.l10n.t('Subtypes Of');\n\t}\n\n\tasync resolve() {\n\n\t\tconst items = await Promise.resolve(vscode.commands.executeCommand<vscode.TypeHierarchyItem[]>('vscode.prepareTypeHierarchy', this.location.uri, this.location.range.start));\n\t\tconst model = new TypesModel(this.direction, items ?? []);\n\t\tconst provider = new TypeItemDataProvider(model);\n\n\t\tif (model.roots.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn {\n\t\t\tprovider,\n\t\t\tget message() { return model.roots.length === 0 ? vscode.l10n.t('No results.') : undefined; },\n\t\t\tnavigation: model,\n\t\t\thighlights: model,\n\t\t\tdnd: model,\n\t\t\tdispose() {\n\t\t\t\tprovider.dispose();\n\t\t\t}\n\t\t};\n\t}\n\n\twith(location: vscode.Location): TypesTreeInput {\n\t\treturn new TypesTreeInput(location, this.direction);\n\t}\n}\n\n\nexport const enum TypeHierarchyDirection {\n\tSubtypes = 'subtypes',\n\tSupertypes = 'supertypes'\n}\n\n\nexport class TypeItem {\n\n\tchildren?: TypeItem[];\n\n\tconstructor(\n\t\treadonly model: TypesModel,\n\t\treadonly item: vscode.TypeHierarchyItem,\n\t\treadonly parent: TypeItem | undefined,\n\t) { }\n\n\tremove(): void {\n\t\tthis.model.remove(this);\n\t}\n}\n\nclass TypesModel implements SymbolItemNavigation<TypeItem>, SymbolItemEditorHighlights<TypeItem>, SymbolItemDragAndDrop<TypeItem> {\n\n\treadonly roots: TypeItem[] = [];\n\n\tprivate readonly _onDidChange = new vscode.EventEmitter<TypesModel>();\n\treadonly onDidChange = this._onDidChange.event;\n\n\tconstructor(readonly direction: TypeHierarchyDirection, items: vscode.TypeHierarchyItem[]) {\n\t\tthis.roots = items.map(item => new TypeItem(this, item, undefined));\n\t}\n\n\tprivate async _resolveTypes(currentType: TypeItem): Promise<TypeItem[]> {\n\t\tif (this.direction === TypeHierarchyDirection.Supertypes) {\n\t\t\tconst types = await vscode.commands.executeCommand<vscode.TypeHierarchyItem[]>('vscode.provideSupertypes', currentType.item);\n\t\t\treturn types ? types.map(item => new TypeItem(this, item, currentType)) : [];\n\t\t} else {\n\t\t\tconst types = await vscode.commands.executeCommand<vscode.TypeHierarchyItem[]>('vscode.provideSubtypes', currentType.item);\n\t\t\treturn types ? types.map(item => new TypeItem(this, item, currentType)) : [];\n\t\t}\n\t}\n\n\tasync getTypeChildren(item: TypeItem): Promise<TypeItem[]> {\n\t\tif (!item.children) {\n\t\t\titem.children = await this._resolveTypes(item);\n\t\t}\n\t\treturn item.children;\n\t}\n\n\t// -- dnd\n\n\tgetDragUri(item: TypeItem): vscode.Uri | undefined {\n\t\treturn asResourceUrl(item.item.uri, item.item.range);\n\t}\n\n\t// -- navigation\n\n\tlocation(currentType: TypeItem) {\n\t\treturn new vscode.Location(currentType.item.uri, currentType.item.range);\n\t}\n\n\tnearest(uri: vscode.Uri, _position: vscode.Position): TypeItem | undefined {\n\t\treturn this.roots.find(item => item.item.uri.toString() === uri.toString()) ?? this.roots[0];\n\t}\n\n\tnext(from: TypeItem): TypeItem {\n\t\treturn this._move(from, true) ?? from;\n\t}\n\n\tprevious(from: TypeItem): TypeItem {\n\t\treturn this._move(from, false) ?? from;\n\t}\n\n\tprivate _move(item: TypeItem, fwd: boolean): TypeItem | void {\n\t\tif (item.children?.length) {\n\t\t\treturn fwd ? item.children[0] : tail(item.children);\n\t\t}\n\t\tconst array = this.roots.includes(item) ? this.roots : item.parent?.children;\n\t\tif (array?.length) {\n\t\t\tconst idx = array.indexOf(item);\n\t\t\tconst delta = fwd ? 1 : -1;\n\t\t\treturn array[idx + delta + array.length % array.length];\n\t\t}\n\t}\n\n\t// --- highlights\n\n\tgetEditorHighlights(currentType: TypeItem, uri: vscode.Uri): vscode.Range[] | undefined {\n\t\treturn currentType.item.uri.toString() === uri.toString() ? [currentType.item.selectionRange] : undefined;\n\t}\n\n\tremove(item: TypeItem) {\n\t\tconst isInRoot = this.roots.includes(item);\n\t\tconst siblings = isInRoot ? this.roots : item.parent?.children;\n\t\tif (siblings) {\n\t\t\tdel(siblings, item);\n\t\t\tthis._onDidChange.fire(this);\n\t\t}\n\t}\n}\n\nclass TypeItemDataProvider implements vscode.TreeDataProvider<TypeItem> {\n\n\tprivate readonly _emitter = new vscode.EventEmitter<TypeItem | undefined>();\n\treadonly onDidChangeTreeData = this._emitter.event;\n\n\tprivate readonly _modelListener: vscode.Disposable;\n\n\tconstructor(private _model: TypesModel) {\n\t\tthis._modelListener = _model.onDidChange(e => this._emitter.fire(e instanceof TypeItem ? e : undefined));\n\t}\n\n\tdispose(): void {\n\t\tthis._emitter.dispose();\n\t\tthis._modelListener.dispose();\n\t}\n\n\tgetTreeItem(element: TypeItem): vscode.TreeItem {\n\n\t\tconst item = new vscode.TreeItem(element.item.name);\n\t\titem.description = element.item.detail;\n\t\titem.contextValue = 'type-item';\n\t\titem.iconPath = getThemeIcon(element.item.kind);\n\t\titem.command = {\n\t\t\tcommand: 'vscode.open',\n\t\t\ttitle: vscode.l10n.t('Open Type'),\n\t\t\targuments: [\n\t\t\t\telement.item.uri,\n\t\t\t\t{ selection: element.item.selectionRange.with({ end: element.item.selectionRange.start }) } satisfies vscode.TextDocumentShowOptions\n\t\t\t]\n\t\t};\n\t\titem.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed;\n\t\treturn item;\n\t}\n\n\tgetChildren(element?: TypeItem | undefined) {\n\t\treturn element\n\t\t\t? this._model.getTypeChildren(element)\n\t\t\t: this._model.roots;\n\t}\n\n\tgetParent(element: TypeItem) {\n\t\treturn element.parent;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolItemEditorHighlights } from './references-view';\n\nexport class EditorHighlights<T> {\n\n\tprivate readonly _decorationType = vscode.window.createTextEditorDecorationType({\n\t\tbackgroundColor: new vscode.ThemeColor('editor.findMatchHighlightBackground'),\n\t\trangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed,\n\t\toverviewRulerLane: vscode.OverviewRulerLane.Center,\n\t\toverviewRulerColor: new vscode.ThemeColor('editor.findMatchHighlightBackground'),\n\t});\n\n\tprivate readonly disposables: vscode.Disposable[] = [];\n\tprivate readonly _ignore = new Set<string>();\n\n\tconstructor(private readonly _view: vscode.TreeView<T>, private readonly _delegate: SymbolItemEditorHighlights<T>) {\n\t\tthis.disposables.push(\n\t\t\tvscode.workspace.onDidChangeTextDocument(e => this._ignore.add(e.document.uri.toString())),\n\t\t\tvscode.window.onDidChangeActiveTextEditor(() => _view.visible && this.update()),\n\t\t\t_view.onDidChangeVisibility(e => e.visible ? this._show() : this._hide()),\n\t\t\t_view.onDidChangeSelection(() => {\n\t\t\t\tif (_view.visible) {\n\t\t\t\t\tthis.update();\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\t\tthis._show();\n\t}\n\n\tdispose() {\n\t\tvscode.Disposable.from(...this.disposables).dispose();\n\t\tfor (const editor of vscode.window.visibleTextEditors) {\n\t\t\teditor.setDecorations(this._decorationType, []);\n\t\t}\n\t}\n\n\tprivate _show(): void {\n\t\tconst { activeTextEditor: editor } = vscode.window;\n\t\tif (!editor || !editor.viewColumn) {\n\t\t\treturn;\n\t\t}\n\t\tif (this._ignore.has(editor.document.uri.toString())) {\n\t\t\treturn;\n\t\t}\n\t\tconst [anchor] = this._view.selection;\n\t\tif (!anchor) {\n\t\t\treturn;\n\t\t}\n\t\tconst ranges = this._delegate.getEditorHighlights(anchor, editor.document.uri);\n\t\tif (ranges) {\n\t\t\teditor.setDecorations(this._decorationType, ranges);\n\t\t}\n\t}\n\n\tprivate _hide(): void {\n\t\tfor (const editor of vscode.window.visibleTextEditors) {\n\t\t\teditor.setDecorations(this._decorationType, []);\n\t\t}\n\t}\n\n\tupdate(): void {\n\t\tthis._hide();\n\t\tthis._show();\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolItemNavigation } from './references-view';\nimport { ContextKey } from './utils';\n\nexport class Navigation {\n\n\tprivate readonly _disposables: vscode.Disposable[] = [];\n\tprivate readonly _ctxCanNavigate = new ContextKey<boolean>('references-view.canNavigate');\n\n\tprivate _delegate?: SymbolItemNavigation<unknown>;\n\n\tconstructor(private readonly _view: vscode.TreeView<unknown>) {\n\t\tthis._disposables.push(\n\t\t\tvscode.commands.registerCommand('references-view.next', () => this.next(false)),\n\t\t\tvscode.commands.registerCommand('references-view.prev', () => this.previous(false)),\n\t\t);\n\t}\n\n\tdispose(): void {\n\t\tvscode.Disposable.from(...this._disposables).dispose();\n\t}\n\n\tupdate(delegate: SymbolItemNavigation<unknown> | undefined) {\n\t\tthis._delegate = delegate;\n\t\tthis._ctxCanNavigate.set(Boolean(this._delegate));\n\t}\n\n\tprivate _anchor(): undefined | unknown {\n\t\tif (!this._delegate) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst [sel] = this._view.selection;\n\t\tif (sel) {\n\t\t\treturn sel;\n\t\t}\n\t\tif (!vscode.window.activeTextEditor) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this._delegate.nearest(vscode.window.activeTextEditor.document.uri, vscode.window.activeTextEditor.selection.active);\n\t}\n\n\tprivate _open(loc: vscode.Location, preserveFocus: boolean) {\n\t\tvscode.commands.executeCommand('vscode.open', loc.uri, {\n\t\t\tselection: new vscode.Selection(loc.range.start, loc.range.start),\n\t\t\tpreserveFocus\n\t\t});\n\t}\n\n\tprevious(preserveFocus: boolean): void {\n\t\tif (!this._delegate) {\n\t\t\treturn;\n\t\t}\n\t\tconst item = this._anchor();\n\t\tif (!item) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItem = this._delegate.previous(item);\n\t\tconst newLocation = this._delegate.location(newItem);\n\t\tif (newLocation) {\n\t\t\tthis._view.reveal(newItem, { select: true, focus: true });\n\t\t\tthis._open(newLocation, preserveFocus);\n\t\t}\n\t}\n\n\tnext(preserveFocus: boolean): void {\n\t\tif (!this._delegate) {\n\t\t\treturn;\n\t\t}\n\t\tconst item = this._anchor();\n\t\tif (!item) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItem = this._delegate.next(item);\n\t\tconst newLocation = this._delegate.location(newItem);\n\t\tif (newLocation) {\n\t\t\tthis._view.reveal(newItem, { select: true, focus: true });\n\t\t\tthis._open(newLocation, preserveFocus);\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolItemDragAndDrop, SymbolItemEditorHighlights, SymbolItemNavigation, SymbolTreeInput } from '../references-view';\nimport { asResourceUrl, del, getThemeIcon, tail } from '../utils';\n\nexport class CallsTreeInput implements SymbolTreeInput<CallItem> {\n\n\treadonly title: string;\n\treadonly contextValue: string = 'callHierarchy';\n\n\tconstructor(\n\t\treadonly location: vscode.Location,\n\t\treadonly direction: CallsDirection,\n\t) {\n\t\tthis.title = direction === CallsDirection.Incoming\n\t\t\t? vscode.l10n.t('Callers Of')\n\t\t\t: vscode.l10n.t('Calls From');\n\t}\n\n\tasync resolve() {\n\n\t\tconst items = await Promise.resolve(vscode.commands.executeCommand<vscode.CallHierarchyItem[]>('vscode.prepareCallHierarchy', this.location.uri, this.location.range.start));\n\t\tconst model = new CallsModel(this.direction, items ?? []);\n\t\tconst provider = new CallItemDataProvider(model);\n\n\t\tif (model.roots.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn {\n\t\t\tprovider,\n\t\t\tget message() { return model.roots.length === 0 ? vscode.l10n.t('No results.') : undefined; },\n\t\t\tnavigation: model,\n\t\t\thighlights: model,\n\t\t\tdnd: model,\n\t\t\tdispose() {\n\t\t\t\tprovider.dispose();\n\t\t\t}\n\t\t};\n\t}\n\n\twith(location: vscode.Location): CallsTreeInput {\n\t\treturn new CallsTreeInput(location, this.direction);\n\t}\n}\n\n\nexport const enum CallsDirection {\n\tIncoming,\n\tOutgoing\n}\n\n\n\nexport class CallItem {\n\n\tchildren?: CallItem[];\n\n\tconstructor(\n\t\treadonly model: CallsModel,\n\t\treadonly item: vscode.CallHierarchyItem,\n\t\treadonly parent: CallItem | undefined,\n\t\treadonly locations: vscode.Location[] | undefined\n\t) { }\n\n\tremove(): void {\n\t\tthis.model.remove(this);\n\t}\n}\n\nclass CallsModel implements SymbolItemNavigation<CallItem>, SymbolItemEditorHighlights<CallItem>, SymbolItemDragAndDrop<CallItem> {\n\n\treadonly roots: CallItem[] = [];\n\n\tprivate readonly _onDidChange = new vscode.EventEmitter<CallsModel>();\n\treadonly onDidChange = this._onDidChange.event;\n\n\tconstructor(readonly direction: CallsDirection, items: vscode.CallHierarchyItem[]) {\n\t\tthis.roots = items.map(item => new CallItem(this, item, undefined, undefined));\n\t}\n\n\tprivate async _resolveCalls(call: CallItem): Promise<CallItem[]> {\n\t\tif (this.direction === CallsDirection.Incoming) {\n\t\t\tconst calls = await vscode.commands.executeCommand<vscode.CallHierarchyIncomingCall[]>('vscode.provideIncomingCalls', call.item);\n\t\t\treturn calls ? calls.map(item => new CallItem(this, item.from, call, item.fromRanges.map(range => new vscode.Location(item.from.uri, range)))) : [];\n\t\t} else {\n\t\t\tconst calls = await vscode.commands.executeCommand<vscode.CallHierarchyOutgoingCall[]>('vscode.provideOutgoingCalls', call.item);\n\t\t\treturn calls ? calls.map(item => new CallItem(this, item.to, call, item.fromRanges.map(range => new vscode.Location(call.item.uri, range)))) : [];\n\t\t}\n\t}\n\n\tasync getCallChildren(call: CallItem): Promise<CallItem[]> {\n\t\tif (!call.children) {\n\t\t\tcall.children = await this._resolveCalls(call);\n\t\t}\n\t\treturn call.children;\n\t}\n\n\t// -- navigation\n\n\tlocation(item: CallItem) {\n\t\treturn new vscode.Location(item.item.uri, item.item.range);\n\t}\n\n\tnearest(uri: vscode.Uri, _position: vscode.Position): CallItem | undefined {\n\t\treturn this.roots.find(item => item.item.uri.toString() === uri.toString()) ?? this.roots[0];\n\t}\n\n\tnext(from: CallItem): CallItem {\n\t\treturn this._move(from, true) ?? from;\n\t}\n\n\tprevious(from: CallItem): CallItem {\n\t\treturn this._move(from, false) ?? from;\n\t}\n\n\tprivate _move(item: CallItem, fwd: boolean): CallItem | void {\n\t\tif (item.children?.length) {\n\t\t\treturn fwd ? item.children[0] : tail(item.children);\n\t\t}\n\t\tconst array = this.roots.includes(item) ? this.roots : item.parent?.children;\n\t\tif (array?.length) {\n\t\t\tconst idx = array.indexOf(item);\n\t\t\tconst delta = fwd ? 1 : -1;\n\t\t\treturn array[idx + delta + array.length % array.length];\n\t\t}\n\t}\n\n\t// --- dnd\n\n\tgetDragUri(item: CallItem): vscode.Uri | undefined {\n\t\treturn asResourceUrl(item.item.uri, item.item.range);\n\t}\n\n\t// --- highlights\n\n\tgetEditorHighlights(item: CallItem, uri: vscode.Uri): vscode.Range[] | undefined {\n\t\tif (!item.locations) {\n\t\t\treturn item.item.uri.toString() === uri.toString() ? [item.item.selectionRange] : undefined;\n\t\t}\n\t\treturn item.locations\n\t\t\t.filter(loc => loc.uri.toString() === uri.toString())\n\t\t\t.map(loc => loc.range);\n\t}\n\n\tremove(item: CallItem) {\n\t\tconst isInRoot = this.roots.includes(item);\n\t\tconst siblings = isInRoot ? this.roots : item.parent?.children;\n\t\tif (siblings) {\n\t\t\tdel(siblings, item);\n\t\t\tthis._onDidChange.fire(this);\n\t\t}\n\t}\n}\n\nclass CallItemDataProvider implements vscode.TreeDataProvider<CallItem> {\n\n\tprivate readonly _emitter = new vscode.EventEmitter<CallItem | undefined>();\n\treadonly onDidChangeTreeData = this._emitter.event;\n\n\tprivate readonly _modelListener: vscode.Disposable;\n\n\tconstructor(private _model: CallsModel) {\n\t\tthis._modelListener = _model.onDidChange(e => this._emitter.fire(e instanceof CallItem ? e : undefined));\n\t}\n\n\tdispose(): void {\n\t\tthis._emitter.dispose();\n\t\tthis._modelListener.dispose();\n\t}\n\n\tgetTreeItem(element: CallItem): vscode.TreeItem {\n\n\t\tconst item = new vscode.TreeItem(element.item.name);\n\t\titem.description = element.item.detail;\n\t\titem.tooltip = item.label && element.item.detail ? `${item.label} - ${element.item.detail}` : item.label ? `${item.label}` : element.item.detail;\n\t\titem.contextValue = 'call-item';\n\t\titem.iconPath = getThemeIcon(element.item.kind);\n\n\t\ttype OpenArgs = [vscode.Uri, vscode.TextDocumentShowOptions];\n\t\tlet openArgs: OpenArgs;\n\n\t\tif (element.model.direction === CallsDirection.Outgoing) {\n\n\t\t\topenArgs = [element.item.uri, { selection: element.item.selectionRange.with({ end: element.item.selectionRange.start }) }];\n\n\t\t} else {\n\t\t\t// incoming call -> reveal first call instead of caller\n\t\t\tlet firstLoctionStart: vscode.Position | undefined;\n\t\t\tif (element.locations) {\n\t\t\t\tfor (const loc of element.locations) {\n\t\t\t\t\tif (loc.uri.toString() === element.item.uri.toString()) {\n\t\t\t\t\t\tfirstLoctionStart = firstLoctionStart?.isBefore(loc.range.start) ? firstLoctionStart : loc.range.start;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!firstLoctionStart) {\n\t\t\t\tfirstLoctionStart = element.item.selectionRange.start;\n\t\t\t}\n\t\t\topenArgs = [element.item.uri, { selection: new vscode.Range(firstLoctionStart, firstLoctionStart) }];\n\t\t}\n\n\t\titem.command = {\n\t\t\tcommand: 'vscode.open',\n\t\t\ttitle: vscode.l10n.t('Open Call'),\n\t\t\targuments: openArgs\n\t\t};\n\t\titem.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed;\n\t\treturn item;\n\t}\n\n\tgetChildren(element?: CallItem | undefined) {\n\t\treturn element\n\t\t\t? this._model.getCallChildren(element)\n\t\t\t: this._model.roots;\n\t}\n\n\tgetParent(element: CallItem) {\n\t\treturn element.parent;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolsTree } from '../tree';\nimport { ContextKey } from '../utils';\nimport { TypeHierarchyDirection, TypeItem, TypesTreeInput } from './model';\n\nexport function register(tree: SymbolsTree, context: vscode.ExtensionContext): void {\n\n\tconst direction = new RichTypesDirection(context.workspaceState, TypeHierarchyDirection.Subtypes);\n\n\tfunction showTypeHierarchy() {\n\t\tif (vscode.window.activeTextEditor) {\n\t\t\tconst input = new TypesTreeInput(new vscode.Location(vscode.window.activeTextEditor.document.uri, vscode.window.activeTextEditor.selection.active), direction.value);\n\t\t\ttree.setInput(input);\n\t\t}\n\t}\n\n\tfunction setTypeHierarchyDirection(value: TypeHierarchyDirection, anchor: TypeItem | vscode.Location | unknown) {\n\t\tdirection.value = value;\n\n\t\tlet newInput: TypesTreeInput | undefined;\n\t\tconst oldInput = tree.getInput();\n\t\tif (anchor instanceof TypeItem) {\n\t\t\tnewInput = new TypesTreeInput(new vscode.Location(anchor.item.uri, anchor.item.selectionRange.start), direction.value);\n\t\t} else if (anchor instanceof vscode.Location) {\n\t\t\tnewInput = new TypesTreeInput(anchor, direction.value);\n\t\t} else if (oldInput instanceof TypesTreeInput) {\n\t\t\tnewInput = new TypesTreeInput(oldInput.location, direction.value);\n\t\t}\n\t\tif (newInput) {\n\t\t\ttree.setInput(newInput);\n\t\t}\n\t}\n\n\tcontext.subscriptions.push(\n\t\tvscode.commands.registerCommand('references-view.showTypeHierarchy', showTypeHierarchy),\n\t\tvscode.commands.registerCommand('references-view.showSupertypes', (item: TypeItem | vscode.Location | unknown) => setTypeHierarchyDirection(TypeHierarchyDirection.Supertypes, item)),\n\t\tvscode.commands.registerCommand('references-view.showSubtypes', (item: TypeItem | vscode.Location | unknown) => setTypeHierarchyDirection(TypeHierarchyDirection.Subtypes, item)),\n\t\tvscode.commands.registerCommand('references-view.removeTypeItem', removeTypeItem)\n\t);\n}\n\nfunction removeTypeItem(item: TypeItem | unknown): void {\n\tif (item instanceof TypeItem) {\n\t\titem.remove();\n\t}\n}\n\nclass RichTypesDirection {\n\n\tprivate static _key = 'references-view.typeHierarchyMode';\n\n\tprivate _ctxMode = new ContextKey<TypeHierarchyDirection>('references-view.typeHierarchyMode');\n\n\tconstructor(\n\t\tprivate _mem: vscode.Memento,\n\t\tprivate _value: TypeHierarchyDirection = TypeHierarchyDirection.Subtypes,\n\t) {\n\t\tconst raw = _mem.get<TypeHierarchyDirection>(RichTypesDirection._key);\n\t\tif (typeof raw === 'string') {\n\t\t\tthis.value = raw;\n\t\t} else {\n\t\t\tthis.value = _value;\n\t\t}\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\tset value(value: TypeHierarchyDirection) {\n\t\tthis._value = value;\n\t\tthis._ctxMode.set(value);\n\t\tthis._mem.update(RichTypesDirection._key, value);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport * as calls from './calls';\nimport * as references from './references';\nimport { SymbolTree, SymbolTreeInput } from './references-view';\nimport { SymbolsTree } from './tree';\nimport * as types from './types';\n\nexport function activate(context: vscode.ExtensionContext): SymbolTree {\n\n\tconst tree = new SymbolsTree();\n\n\treferences.register(tree, context);\n\tcalls.register(tree, context);\n\ttypes.register(tree, context);\n\n\tfunction setInput(input: SymbolTreeInput<unknown>) {\n\t\ttree.setInput(input);\n\t}\n\n\tfunction getInput(): SymbolTreeInput<unknown> | undefined {\n\t\treturn tree.getInput();\n\t}\n\n\treturn { setInput, getInput };\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\n\nexport function del<T>(array: T[], e: T): void {\n\tconst idx = array.indexOf(e);\n\tif (idx >= 0) {\n\t\tarray.splice(idx, 1);\n\t}\n}\n\nexport function tail<T>(array: T[]): T | undefined {\n\treturn array[array.length - 1];\n}\n\nexport function asResourceUrl(uri: vscode.Uri, range: vscode.Range): vscode.Uri {\n\treturn uri.with({ fragment: `L${1 + range.start.line},${1 + range.start.character}-${1 + range.end.line},${1 + range.end.character}` });\n}\n\nexport async function isValidRequestPosition(uri: vscode.Uri, position: vscode.Position) {\n\tconst doc = await vscode.workspace.openTextDocument(uri);\n\tlet range = doc.getWordRangeAtPosition(position);\n\tif (!range) {\n\t\trange = doc.getWordRangeAtPosition(position, /[^\\s]+/);\n\t}\n\treturn Boolean(range);\n}\n\nexport function getPreviewChunks(doc: vscode.TextDocument, range: vscode.Range, beforeLen: number = 8, trim: boolean = true) {\n\tconst previewStart = range.start.with({ character: Math.max(0, range.start.character - beforeLen) });\n\tconst wordRange = doc.getWordRangeAtPosition(previewStart);\n\tlet before = doc.getText(new vscode.Range(wordRange ? wordRange.start : previewStart, range.start));\n\tconst inside = doc.getText(range);\n\tconst previewEnd = range.end.translate(0, 331);\n\tlet after = doc.getText(new vscode.Range(range.end, previewEnd));\n\tif (trim) {\n\t\tbefore = before.replace(/^\\s*/g, '');\n\t\tafter = after.replace(/\\s*$/g, '');\n\t}\n\treturn { before, inside, after };\n}\n\nexport class ContextKey<V> {\n\n\tconstructor(readonly name: string) { }\n\n\tasync set(value: V) {\n\t\tawait vscode.commands.executeCommand('setContext', this.name, value);\n\t}\n\n\tasync reset() {\n\t\tawait vscode.commands.executeCommand('setContext', this.name, undefined);\n\t}\n}\n\nexport class WordAnchor {\n\n\tprivate readonly _version: number;\n\tprivate readonly _word: string | undefined;\n\n\tconstructor(private readonly _doc: vscode.TextDocument, private readonly _position: vscode.Position) {\n\t\tthis._version = _doc.version;\n\t\tthis._word = this._getAnchorWord(_doc, _position);\n\t}\n\n\tprivate _getAnchorWord(doc: vscode.TextDocument, pos: vscode.Position): string | undefined {\n\t\tconst range = doc.getWordRangeAtPosition(pos) || doc.getWordRangeAtPosition(pos, /[^\\s]+/);\n\t\treturn range && doc.getText(range);\n\t}\n\n\tguessedTrackedPosition(): vscode.Position | undefined {\n\t\t// funky entry\n\t\tif (!this._word) {\n\t\t\treturn this._position;\n\t\t}\n\n\t\t// no changes\n\t\tif (this._version === this._doc.version) {\n\t\t\treturn this._position;\n\t\t}\n\n\t\t// no changes here...\n\t\tconst wordNow = this._getAnchorWord(this._doc, this._position);\n\t\tif (this._word === wordNow) {\n\t\t\treturn this._position;\n\t\t}\n\n\t\t// changes: search _word downwards and upwards\n\t\tconst startLine = this._position.line;\n\t\tlet i = 0;\n\t\tlet line: number;\n\t\tlet checked: boolean;\n\t\tdo {\n\t\t\tchecked = false;\n\t\t\t// nth line down\n\t\t\tline = startLine + i;\n\t\t\tif (line < this._doc.lineCount) {\n\t\t\t\tchecked = true;\n\t\t\t\tconst ch = this._doc.lineAt(line).text.indexOf(this._word);\n\t\t\t\tif (ch >= 0) {\n\t\t\t\t\treturn new vscode.Position(line, ch);\n\t\t\t\t}\n\t\t\t}\n\t\t\ti += 1;\n\t\t\t// nth line up\n\t\t\tline = startLine - i;\n\t\t\tif (line >= 0) {\n\t\t\t\tchecked = true;\n\t\t\t\tconst ch = this._doc.lineAt(line).text.indexOf(this._word);\n\t\t\t\tif (ch >= 0) {\n\t\t\t\t\treturn new vscode.Position(line, ch);\n\t\t\t\t}\n\t\t\t}\n\t\t} while (i < 100 && checked);\n\n\t\t// fallback\n\t\treturn this._position;\n\t}\n}\n\n// vscode.SymbolKind.File === 0, Module === 1, etc...\nconst _themeIconIds = [\n\t'symbol-file', 'symbol-module', 'symbol-namespace', 'symbol-package', 'symbol-class', 'symbol-method',\n\t'symbol-property', 'symbol-field', 'symbol-constructor', 'symbol-enum', 'symbol-interface',\n\t'symbol-function', 'symbol-variable', 'symbol-constant', 'symbol-string', 'symbol-number', 'symbol-boolean',\n\t'symbol-array', 'symbol-object', 'symbol-key', 'symbol-null', 'symbol-enum-member', 'symbol-struct',\n\t'symbol-event', 'symbol-operator', 'symbol-type-parameter'\n];\n\nexport function getThemeIcon(kind: vscode.SymbolKind): vscode.ThemeIcon | undefined {\n\tconst id = _themeIconIds[kind];\n\treturn id ? new vscode.ThemeIcon(id) : undefined;\n}\n","module.exports = require(\"vscode\");","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolsTree } from '../tree';\nimport { FileItem, ReferenceItem, ReferencesModel, ReferencesTreeInput } from './model';\n\nexport function register(tree: SymbolsTree, context: vscode.ExtensionContext): void {\n\n\tfunction findLocations(title: string, command: string) {\n\t\tif (vscode.window.activeTextEditor) {\n\t\t\tconst input = new ReferencesTreeInput(title, new vscode.Location(vscode.window.activeTextEditor.document.uri, vscode.window.activeTextEditor.selection.active), command);\n\t\t\ttree.setInput(input);\n\t\t}\n\t}\n\n\tcontext.subscriptions.push(\n\t\tvscode.commands.registerCommand('references-view.findReferences', () => findLocations('References', 'vscode.executeReferenceProvider')),\n\t\tvscode.commands.registerCommand('references-view.findImplementations', () => findLocations('Implementations', 'vscode.executeImplementationProvider')),\n\t\t// --- legacy name\n\t\tvscode.commands.registerCommand('references-view.find', (...args: any[]) => vscode.commands.executeCommand('references-view.findReferences', ...args)),\n\t\tvscode.commands.registerCommand('references-view.removeReferenceItem', removeReferenceItem),\n\t\tvscode.commands.registerCommand('references-view.copy', copyCommand),\n\t\tvscode.commands.registerCommand('references-view.copyAll', copyAllCommand),\n\t\tvscode.commands.registerCommand('references-view.copyPath', copyPathCommand),\n\t);\n\n\n\t// --- references.preferredLocation setting\n\n\tlet showReferencesDisposable: vscode.Disposable | undefined;\n\tconst config = 'references.preferredLocation';\n\tfunction updateShowReferences(event?: vscode.ConfigurationChangeEvent) {\n\t\tif (event && !event.affectsConfiguration(config)) {\n\t\t\treturn;\n\t\t}\n\t\tconst value = vscode.workspace.getConfiguration().get<string>(config);\n\n\t\tshowReferencesDisposable?.dispose();\n\t\tshowReferencesDisposable = undefined;\n\n\t\tif (value === 'view') {\n\t\t\tshowReferencesDisposable = vscode.commands.registerCommand('editor.action.showReferences', async (uri: vscode.Uri, position: vscode.Position, locations: vscode.Location[]) => {\n\t\t\t\tconst input = new ReferencesTreeInput(vscode.l10n.t('References'), new vscode.Location(uri, position), 'vscode.executeReferenceProvider', locations);\n\t\t\t\ttree.setInput(input);\n\t\t\t});\n\t\t}\n\t}\n\tcontext.subscriptions.push(vscode.workspace.onDidChangeConfiguration(updateShowReferences));\n\tcontext.subscriptions.push({ dispose: () => showReferencesDisposable?.dispose() });\n\tupdateShowReferences();\n}\n\nconst copyAllCommand = async (item: ReferenceItem | FileItem | unknown) => {\n\tif (item instanceof ReferenceItem) {\n\t\tcopyCommand(item.file.model);\n\t} else if (item instanceof FileItem) {\n\t\tcopyCommand(item.model);\n\t}\n};\n\nfunction removeReferenceItem(item: FileItem | ReferenceItem | unknown) {\n\tif (item instanceof FileItem) {\n\t\titem.remove();\n\t} else if (item instanceof ReferenceItem) {\n\t\titem.remove();\n\t}\n}\n\n\nasync function copyCommand(item: ReferencesModel | ReferenceItem | FileItem | unknown) {\n\tlet val: string | undefined;\n\tif (item instanceof ReferencesModel) {\n\t\tval = await item.asCopyText();\n\t} else if (item instanceof ReferenceItem) {\n\t\tval = await item.asCopyText();\n\t} else if (item instanceof FileItem) {\n\t\tval = await item.asCopyText();\n\t}\n\tif (val) {\n\t\tawait vscode.env.clipboard.writeText(val);\n\t}\n}\n\nasync function copyPathCommand(item: FileItem | unknown) {\n\tif (item instanceof FileItem) {\n\t\tif (item.uri.scheme === 'file') {\n\t\t\tvscode.env.clipboard.writeText(item.uri.fsPath);\n\t\t} else {\n\t\t\tvscode.env.clipboard.writeText(item.uri.toString(true));\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolsTree } from '../tree';\nimport { ContextKey } from '../utils';\nimport { CallItem, CallsDirection, CallsTreeInput } from './model';\n\nexport function register(tree: SymbolsTree, context: vscode.ExtensionContext): void {\n\n\tconst direction = new RichCallsDirection(context.workspaceState, CallsDirection.Incoming);\n\n\tfunction showCallHierarchy() {\n\t\tif (vscode.window.activeTextEditor) {\n\t\t\tconst input = new CallsTreeInput(new vscode.Location(vscode.window.activeTextEditor.document.uri, vscode.window.activeTextEditor.selection.active), direction.value);\n\t\t\ttree.setInput(input);\n\t\t}\n\t}\n\n\tfunction setCallsDirection(value: CallsDirection, anchor: CallItem | unknown) {\n\t\tdirection.value = value;\n\n\t\tlet newInput: CallsTreeInput | undefined;\n\t\tconst oldInput = tree.getInput();\n\t\tif (anchor instanceof CallItem) {\n\t\t\tnewInput = new CallsTreeInput(new vscode.Location(anchor.item.uri, anchor.item.selectionRange.start), direction.value);\n\t\t} else if (oldInput instanceof CallsTreeInput) {\n\t\t\tnewInput = new CallsTreeInput(oldInput.location, direction.value);\n\t\t}\n\t\tif (newInput) {\n\t\t\ttree.setInput(newInput);\n\t\t}\n\t}\n\n\tcontext.subscriptions.push(\n\t\tvscode.commands.registerCommand('references-view.showCallHierarchy', showCallHierarchy),\n\t\tvscode.commands.registerCommand('references-view.showOutgoingCalls', (item: CallItem | unknown) => setCallsDirection(CallsDirection.Outgoing, item)),\n\t\tvscode.commands.registerCommand('references-view.showIncomingCalls', (item: CallItem | unknown) => setCallsDirection(CallsDirection.Incoming, item)),\n\t\tvscode.commands.registerCommand('references-view.removeCallItem', removeCallItem)\n\t);\n}\n\nfunction removeCallItem(item: CallItem | unknown): void {\n\tif (item instanceof CallItem) {\n\t\titem.remove();\n\t}\n}\n\nclass RichCallsDirection {\n\n\tprivate static _key = 'references-view.callHierarchyMode';\n\n\tprivate _ctxMode = new ContextKey<'showIncoming' | 'showOutgoing'>('references-view.callHierarchyMode');\n\n\tconstructor(\n\t\tprivate _mem: vscode.Memento,\n\t\tprivate _value: CallsDirection = CallsDirection.Outgoing,\n\t) {\n\t\tconst raw = _mem.get<number>(RichCallsDirection._key);\n\t\tif (typeof raw === 'number' && raw >= 0 && raw <= 1) {\n\t\t\tthis.value = raw;\n\t\t} else {\n\t\t\tthis.value = _value;\n\t\t}\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\tset value(value: CallsDirection) {\n\t\tthis._value = value;\n\t\tthis._ctxMode.set(this._value === CallsDirection.Incoming ? 'showIncoming' : 'showOutgoing');\n\t\tthis._mem.update(RichCallsDirection._key, value);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { EditorHighlights } from './highlights';\nimport { Navigation } from './navigation';\nimport { SymbolItemDragAndDrop, SymbolTreeInput } from './references-view';\nimport { ContextKey, isValidRequestPosition, WordAnchor } from './utils';\n\n\nexport class SymbolsTree {\n\n\treadonly viewId = 'references-view.tree';\n\n\tprivate readonly _ctxIsActive = new ContextKey<boolean>('reference-list.isActive');\n\tprivate readonly _ctxHasResult = new ContextKey<boolean>('reference-list.hasResult');\n\tprivate readonly _ctxInputSource = new ContextKey<string>('reference-list.source');\n\n\tprivate readonly _history = new TreeInputHistory(this);\n\tprivate readonly _provider = new TreeDataProviderDelegate();\n\tprivate readonly _dnd = new TreeDndDelegate();\n\tprivate readonly _tree: vscode.TreeView<unknown>;\n\tprivate readonly _navigation: Navigation;\n\n\tprivate _input?: SymbolTreeInput<unknown>;\n\tprivate _sessionDisposable?: vscode.Disposable;\n\n\tconstructor() {\n\t\tthis._tree = vscode.window.createTreeView<unknown>(this.viewId, {\n\t\t\ttreeDataProvider: this._provider,\n\t\t\tshowCollapseAll: true,\n\t\t\tdragAndDropController: this._dnd\n\t\t});\n\t\tthis._navigation = new Navigation(this._tree);\n\t}\n\n\tdispose(): void {\n\t\tthis._history.dispose();\n\t\tthis._tree.dispose();\n\t\tthis._sessionDisposable?.dispose();\n\t}\n\n\tgetInput(): SymbolTreeInput<unknown> | undefined {\n\t\treturn this._input;\n\t}\n\n\tasync setInput(input: SymbolTreeInput<unknown>) {\n\n\t\tif (!await isValidRequestPosition(input.location.uri, input.location.range.start)) {\n\t\t\tthis.clearInput();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._ctxInputSource.set(input.contextValue);\n\t\tthis._ctxIsActive.set(true);\n\t\tthis._ctxHasResult.set(true);\n\t\tvscode.commands.executeCommand(`${this.viewId}.focus`);\n\n\t\tconst newInputKind = !this._input || Object.getPrototypeOf(this._input) !== Object.getPrototypeOf(input);\n\t\tthis._input = input;\n\t\tthis._sessionDisposable?.dispose();\n\n\t\tthis._tree.title = input.title;\n\t\tthis._tree.message = newInputKind ? undefined : this._tree.message;\n\n\t\tconst modelPromise = Promise.resolve(input.resolve());\n\n\t\t// set promise to tree data provider to trigger tree loading UI\n\t\tthis._provider.update(modelPromise.then(model => model?.provider ?? this._history));\n\t\tthis._dnd.update(modelPromise.then(model => model?.dnd));\n\n\t\tconst model = await modelPromise;\n\t\tif (this._input !== input) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!model) {\n\t\t\tthis.clearInput();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._history.add(input);\n\t\tthis._tree.message = model.message;\n\n\t\t// navigation\n\t\tthis._navigation.update(model.navigation);\n\n\t\t// reveal & select\n\t\tconst selection = model.navigation?.nearest(input.location.uri, input.location.range.start);\n\t\tif (selection && this._tree.visible) {\n\t\t\tawait this._tree.reveal(selection, { select: true, focus: true, expand: true });\n\t\t}\n\n\t\tconst disposables: vscode.Disposable[] = [];\n\n\t\t// editor highlights\n\t\tlet highlights: EditorHighlights<unknown> | undefined;\n\t\tif (model.highlights) {\n\t\t\thighlights = new EditorHighlights(this._tree, model.highlights);\n\t\t\tdisposables.push(highlights);\n\t\t}\n\n\t\t// listener\n\t\tif (model.provider.onDidChangeTreeData) {\n\t\t\tdisposables.push(model.provider.onDidChangeTreeData(() => {\n\t\t\t\tthis._tree.title = input.title;\n\t\t\t\tthis._tree.message = model.message;\n\t\t\t\thighlights?.update();\n\t\t\t}));\n\t\t}\n\t\tif (typeof model.dispose === 'function') {\n\t\t\tdisposables.push(new vscode.Disposable(() => model.dispose!()));\n\t\t}\n\t\tthis._sessionDisposable = vscode.Disposable.from(...disposables);\n\t}\n\n\tclearInput(): void {\n\t\tthis._sessionDisposable?.dispose();\n\t\tthis._input = undefined;\n\t\tthis._ctxHasResult.set(false);\n\t\tthis._ctxInputSource.reset();\n\t\tthis._tree.title = vscode.l10n.t('References');\n\t\tthis._tree.message = this._history.size === 0\n\t\t\t? vscode.l10n.t('No results.')\n\t\t\t: vscode.l10n.t('No results. Try running a previous search again:');\n\t\tthis._provider.update(Promise.resolve(this._history));\n\t}\n}\n\n// --- tree data\n\ninterface ActiveTreeDataProviderWrapper {\n\tprovider: Promise<vscode.TreeDataProvider<any>>;\n}\n\nclass TreeDataProviderDelegate implements vscode.TreeDataProvider<undefined> {\n\n\tprovider?: Promise<vscode.TreeDataProvider<any>>;\n\n\tprivate _sessionDispoables?: vscode.Disposable;\n\tprivate _onDidChange = new vscode.EventEmitter<any>();\n\n\treadonly onDidChangeTreeData = this._onDidChange.event;\n\n\tupdate(provider: Promise<vscode.TreeDataProvider<any>>) {\n\n\t\tthis._sessionDispoables?.dispose();\n\t\tthis._sessionDispoables = undefined;\n\n\t\tthis._onDidChange.fire(undefined);\n\n\t\tthis.provider = provider;\n\n\t\tprovider.then(value => {\n\t\t\tif (this.provider === provider && value.onDidChangeTreeData) {\n\t\t\t\tthis._sessionDispoables = value.onDidChangeTreeData(this._onDidChange.fire, this._onDidChange);\n\t\t\t}\n\t\t}).catch(err => {\n\t\t\tthis.provider = undefined;\n\t\t\tconsole.error(err);\n\t\t});\n\t}\n\n\tasync getTreeItem(element: unknown) {\n\t\tthis._assertProvider();\n\t\treturn (await this.provider).getTreeItem(element);\n\t}\n\n\tasync getChildren(parent?: unknown | undefined) {\n\t\tthis._assertProvider();\n\t\treturn (await this.provider).getChildren(parent);\n\t}\n\n\tasync getParent(element: unknown) {\n\t\tthis._assertProvider();\n\t\tconst provider = await this.provider;\n\t\treturn provider.getParent ? provider.getParent(element) : undefined;\n\t}\n\n\tprivate _assertProvider(): asserts this is ActiveTreeDataProviderWrapper {\n\t\tif (!this.provider) {\n\t\t\tthrow new Error('MISSING provider');\n\t\t}\n\t}\n}\n\n// --- tree dnd\n\nclass TreeDndDelegate implements vscode.TreeDragAndDropController<undefined> {\n\n\tprivate _delegate: SymbolItemDragAndDrop<undefined> | undefined;\n\n\treadonly dropMimeTypes: string[] = [];\n\n\treadonly dragMimeTypes: string[] = ['text/uri-list'];\n\n\tupdate(delegate: Promise<SymbolItemDragAndDrop<unknown> | undefined>) {\n\t\tthis._delegate = undefined;\n\t\tdelegate.then(value => this._delegate = value);\n\t}\n\n\thandleDrag(source: undefined[], data: vscode.DataTransfer) {\n\t\tif (this._delegate) {\n\t\t\tconst urls: string[] = [];\n\t\t\tfor (const item of source) {\n\t\t\t\tconst uri = this._delegate.getDragUri(item);\n\t\t\t\tif (uri) {\n\t\t\t\t\turls.push(uri.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (urls.length > 0) {\n\t\t\t\tdata.set('text/uri-list', new vscode.DataTransferItem(urls.join('\\r\\n')));\n\t\t\t}\n\t\t}\n\t}\n\n\thandleDrop(): void | Thenable<void> {\n\t\tthrow new Error('Method not implemented.');\n\t}\n}\n\n// --- history\n\nclass HistoryItem {\n\n\treadonly description: string;\n\n\tconstructor(\n\t\treadonly key: string,\n\t\treadonly word: string,\n\t\treadonly anchor: WordAnchor,\n\t\treadonly input: SymbolTreeInput<unknown>,\n\t) {\n\t\tthis.description = `${vscode.workspace.asRelativePath(input.location.uri)} • ${input.title.toLocaleLowerCase()}`;\n\t}\n}\n\nclass TreeInputHistory implements vscode.TreeDataProvider<HistoryItem> {\n\n\tprivate readonly _onDidChangeTreeData = new vscode.EventEmitter<HistoryItem | undefined>();\n\treadonly onDidChangeTreeData = this._onDidChangeTreeData.event;\n\n\tprivate readonly _disposables: vscode.Disposable[] = [];\n\tprivate readonly _ctxHasHistory = new ContextKey<boolean>('reference-list.hasHistory');\n\tprivate readonly _inputs = new Map<string, HistoryItem>();\n\n\tconstructor(private readonly _tree: SymbolsTree) {\n\n\t\tthis._disposables.push(\n\t\t\tvscode.commands.registerCommand('references-view.clear', () => _tree.clearInput()),\n\t\t\tvscode.commands.registerCommand('references-view.clearHistory', () => {\n\t\t\t\tthis.clear();\n\t\t\t\t_tree.clearInput();\n\t\t\t}),\n\t\t\tvscode.commands.registerCommand('references-view.refind', (item) => {\n\t\t\t\tif (item instanceof HistoryItem) {\n\t\t\t\t\tthis._reRunHistoryItem(item);\n\t\t\t\t}\n\t\t\t}),\n\t\t\tvscode.commands.registerCommand('references-view.refresh', () => {\n\t\t\t\tconst item = Array.from(this._inputs.values()).pop();\n\t\t\t\tif (item) {\n\t\t\t\t\tthis._reRunHistoryItem(item);\n\t\t\t\t}\n\t\t\t}),\n\t\t\tvscode.commands.registerCommand('_references-view.showHistoryItem', async (item) => {\n\t\t\t\tif (item instanceof HistoryItem) {\n\t\t\t\t\tconst position = item.anchor.guessedTrackedPosition() ?? item.input.location.range.start;\n\t\t\t\t\tawait vscode.commands.executeCommand('vscode.open', item.input.location.uri, { selection: new vscode.Range(position, position) });\n\t\t\t\t}\n\t\t\t}),\n\t\t\tvscode.commands.registerCommand('references-view.pickFromHistory', async () => {\n\t\t\t\tinterface HistoryPick extends vscode.QuickPickItem {\n\t\t\t\t\titem: HistoryItem;\n\t\t\t\t}\n\t\t\t\tconst entries = await this.getChildren();\n\t\t\t\tconst picks = entries.map((item): HistoryPick => ({\n\t\t\t\t\tlabel: item.word,\n\t\t\t\t\tdescription: item.description,\n\t\t\t\t\titem\n\t\t\t\t}));\n\t\t\t\tconst pick = await vscode.window.showQuickPick(picks, { placeHolder: vscode.l10n.t('Select previous reference search') });\n\t\t\t\tif (pick) {\n\t\t\t\t\tthis._reRunHistoryItem(pick.item);\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\t}\n\n\tdispose(): void {\n\t\tvscode.Disposable.from(...this._disposables).dispose();\n\t\tthis._onDidChangeTreeData.dispose();\n\t}\n\n\tprivate _reRunHistoryItem(item: HistoryItem): void {\n\t\tthis._inputs.delete(item.key);\n\t\tconst newPosition = item.anchor.guessedTrackedPosition();\n\t\tlet newInput = item.input;\n\t\t// create a new input when having a tracked position which is\n\t\t// different than the original position.\n\t\tif (newPosition && !item.input.location.range.start.isEqual(newPosition)) {\n\t\t\tnewInput = item.input.with(new vscode.Location(item.input.location.uri, newPosition));\n\t\t}\n\t\tthis._tree.setInput(newInput);\n\t}\n\n\tasync add(input: SymbolTreeInput<unknown>) {\n\n\t\tconst doc = await vscode.workspace.openTextDocument(input.location.uri);\n\n\t\tconst anchor = new WordAnchor(doc, input.location.range.start);\n\t\tconst range = doc.getWordRangeAtPosition(input.location.range.start) ?? doc.getWordRangeAtPosition(input.location.range.start, /[^\\s]+/);\n\t\tconst word = range ? doc.getText(range) : '???';\n\n\t\tconst item = new HistoryItem(JSON.stringify([range?.start ?? input.location.range.start, input.location.uri, input.title]), word, anchor, input);\n\t\t// use filo-ordering of native maps\n\t\tthis._inputs.delete(item.key);\n\t\tthis._inputs.set(item.key, item);\n\t\tthis._ctxHasHistory.set(true);\n\t}\n\n\tclear(): void {\n\t\tthis._inputs.clear();\n\t\tthis._ctxHasHistory.set(false);\n\t\tthis._onDidChangeTreeData.fire(undefined);\n\t}\n\n\tget size() {\n\t\treturn this._inputs.size;\n\t}\n\n\t// --- tree data provider\n\n\tgetTreeItem(item: HistoryItem): vscode.TreeItem {\n\t\tconst result = new vscode.TreeItem(item.word);\n\t\tresult.description = item.description;\n\t\tresult.command = { command: '_references-view.showHistoryItem', arguments: [item], title: vscode.l10n.t('Rerun') };\n\t\tresult.collapsibleState = vscode.TreeItemCollapsibleState.None;\n\t\tresult.contextValue = 'history-item';\n\t\treturn result;\n\t}\n\n\tgetChildren() {\n\t\treturn Promise.all([...this._inputs.values()].reverse());\n\t}\n\n\tgetParent() {\n\t\treturn undefined;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SymbolItemDragAndDrop, SymbolItemEditorHighlights, SymbolItemNavigation, SymbolTreeInput, SymbolTreeModel } from '../references-view';\nimport { asResourceUrl, del, getPreviewChunks, tail } from '../utils';\n\nexport class ReferencesTreeInput implements SymbolTreeInput<FileItem | ReferenceItem> {\n\n\treadonly contextValue: string;\n\n\tconstructor(\n\t\treadonly title: string,\n\t\treadonly location: vscode.Location,\n\t\tprivate readonly _command: string,\n\t\tprivate readonly _result?: vscode.Location[] | vscode.LocationLink[]\n\t) {\n\t\tthis.contextValue = _command;\n\t}\n\n\tasync resolve(): Promise<SymbolTreeModel<FileItem | ReferenceItem> | undefined> {\n\n\t\tlet model: ReferencesModel;\n\t\tif (this._result) {\n\t\t\tmodel = new ReferencesModel(this._result);\n\t\t} else {\n\t\t\tconst resut = await Promise.resolve(vscode.commands.executeCommand<vscode.Location[] | vscode.LocationLink[]>(this._command, this.location.uri, this.location.range.start));\n\t\t\tmodel = new ReferencesModel(resut ?? []);\n\t\t}\n\n\t\tif (model.items.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst provider = new ReferencesTreeDataProvider(model);\n\t\treturn {\n\t\t\tprovider,\n\t\t\tget message() { return model.message; },\n\t\t\tnavigation: model,\n\t\t\thighlights: model,\n\t\t\tdnd: model,\n\t\t\tdispose(): void {\n\t\t\t\tprovider.dispose();\n\t\t\t}\n\t\t};\n\t}\n\n\twith(location: vscode.Location): ReferencesTreeInput {\n\t\treturn new ReferencesTreeInput(this.title, location, this._command);\n\t}\n}\n\nexport class ReferencesModel implements SymbolItemNavigation<FileItem | ReferenceItem>, SymbolItemEditorHighlights<FileItem | ReferenceItem>, SymbolItemDragAndDrop<FileItem | ReferenceItem> {\n\n\tprivate _onDidChange = new vscode.EventEmitter<FileItem | ReferenceItem | undefined>();\n\treadonly onDidChangeTreeData = this._onDidChange.event;\n\n\treadonly items: FileItem[] = [];\n\n\tconstructor(locations: vscode.Location[] | vscode.LocationLink[]) {\n\t\tlet last: FileItem | undefined;\n\t\tfor (const item of locations.sort(ReferencesModel._compareLocations)) {\n\t\t\tconst loc = item instanceof vscode.Location\n\t\t\t\t? item\n\t\t\t\t: new vscode.Location(item.targetUri, item.targetRange);\n\n\t\t\tif (!last || ReferencesModel._compareUriIgnoreFragment(last.uri, loc.uri) !== 0) {\n\t\t\t\tlast = new FileItem(loc.uri.with({ fragment: '' }), [], this);\n\t\t\t\tthis.items.push(last);\n\t\t\t}\n\t\t\tlast.references.push(new ReferenceItem(loc, last));\n\t\t}\n\t}\n\n\tprivate static _compareUriIgnoreFragment(a: vscode.Uri, b: vscode.Uri): number {\n\t\tconst aStr = a.with({ fragment: '' }).toString();\n\t\tconst bStr = b.with({ fragment: '' }).toString();\n\t\tif (aStr < bStr) {\n\t\t\treturn -1;\n\t\t} else if (aStr > bStr) {\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tprivate static _compareLocations(a: vscode.Location | vscode.LocationLink, b: vscode.Location | vscode.LocationLink): number {\n\t\tconst aUri = a instanceof vscode.Location ? a.uri : a.targetUri;\n\t\tconst bUri = b instanceof vscode.Location ? b.uri : b.targetUri;\n\t\tif (aUri.toString() < bUri.toString()) {\n\t\t\treturn -1;\n\t\t} else if (aUri.toString() > bUri.toString()) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tconst aRange = a instanceof vscode.Location ? a.range : a.targetRange;\n\t\tconst bRange = b instanceof vscode.Location ? b.range : b.targetRange;\n\t\tif (aRange.start.isBefore(bRange.start)) {\n\t\t\treturn -1;\n\t\t} else if (aRange.start.isAfter(bRange.start)) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\t// --- adapter\n\n\tget message() {\n\t\tif (this.items.length === 0) {\n\t\t\treturn vscode.l10n.t('No results.');\n\t\t}\n\t\tconst total = this.items.reduce((prev, cur) => prev + cur.references.length, 0);\n\t\tconst files = this.items.length;\n\t\tif (total === 1 && files === 1) {\n\t\t\treturn vscode.l10n.t('{0} result in {1} file', total, files);\n\t\t} else if (total === 1) {\n\t\t\treturn vscode.l10n.t('{0} result in {1} files', total, files);\n\t\t} else if (files === 1) {\n\t\t\treturn vscode.l10n.t('{0} results in {1} file', total, files);\n\t\t} else {\n\t\t\treturn vscode.l10n.t('{0} results in {1} files', total, files);\n\t\t}\n\t}\n\n\tlocation(item: FileItem | ReferenceItem) {\n\t\treturn item instanceof ReferenceItem\n\t\t\t? item.location\n\t\t\t: new vscode.Location(item.uri, item.references[0]?.location.range ?? new vscode.Position(0, 0));\n\t}\n\n\tnearest(uri: vscode.Uri, position: vscode.Position): FileItem | ReferenceItem | undefined {\n\n\t\tif (this.items.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\t// NOTE: this.items is sorted by location (uri/range)\n\t\tfor (const item of this.items) {\n\t\t\tif (item.uri.toString() === uri.toString()) {\n\t\t\t\t// (1) pick the item at the request position\n\t\t\t\tfor (const ref of item.references) {\n\t\t\t\t\tif (ref.location.range.contains(position)) {\n\t\t\t\t\t\treturn ref;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// (2) pick the first item after or last before the request position\n\t\t\t\tlet lastBefore: ReferenceItem | undefined;\n\t\t\t\tfor (const ref of item.references) {\n\t\t\t\t\tif (ref.location.range.end.isAfter(position)) {\n\t\t\t\t\t\treturn ref;\n\t\t\t\t\t}\n\t\t\t\t\tlastBefore = ref;\n\t\t\t\t}\n\t\t\t\tif (lastBefore) {\n\t\t\t\t\treturn lastBefore;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// (3) pick the file with the longest common prefix\n\t\tlet best = 0;\n\t\tconst bestValue = ReferencesModel._prefixLen(this.items[best].toString(), uri.toString());\n\n\t\tfor (let i = 1; i < this.items.length; i++) {\n\t\t\tconst value = ReferencesModel._prefixLen(this.items[i].uri.toString(), uri.toString());\n\t\t\tif (value > bestValue) {\n\t\t\t\tbest = i;\n\t\t\t}\n\t\t}\n\n\t\treturn this.items[best].references[0];\n\t}\n\n\tprivate static _prefixLen(a: string, b: string): number {\n\t\tlet pos = 0;\n\t\twhile (pos < a.length && pos < b.length && a.charCodeAt(pos) === b.charCodeAt(pos)) {\n\t\t\tpos += 1;\n\t\t}\n\t\treturn pos;\n\t}\n\n\tnext(item: FileItem | ReferenceItem): FileItem | ReferenceItem {\n\t\treturn this._move(item, true) ?? item;\n\t}\n\n\tprevious(item: FileItem | ReferenceItem): FileItem | ReferenceItem {\n\t\treturn this._move(item, false) ?? item;\n\t}\n\n\tprivate _move(item: FileItem | ReferenceItem, fwd: boolean): ReferenceItem | void {\n\n\t\tconst delta = fwd ? +1 : -1;\n\n\t\tconst _move = (item: FileItem): FileItem => {\n\t\t\tconst idx = (this.items.indexOf(item) + delta + this.items.length) % this.items.length;\n\t\t\treturn this.items[idx];\n\t\t};\n\n\t\tif (item instanceof FileItem) {\n\t\t\tif (fwd) {\n\t\t\t\treturn _move(item).references[0];\n\t\t\t} else {\n\t\t\t\treturn tail(_move(item).references);\n\t\t\t}\n\t\t}\n\n\t\tif (item instanceof ReferenceItem) {\n\t\t\tconst idx = item.file.references.indexOf(item) + delta;\n\t\t\tif (idx < 0) {\n\t\t\t\treturn tail(_move(item.file).references);\n\t\t\t} else if (idx >= item.file.references.length) {\n\t\t\t\treturn _move(item.file).references[0];\n\t\t\t} else {\n\t\t\t\treturn item.file.references[idx];\n\t\t\t}\n\t\t}\n\t}\n\n\tgetEditorHighlights(_item: FileItem | ReferenceItem, uri: vscode.Uri): vscode.Range[] | undefined {\n\t\tconst file = this.items.find(file => file.uri.toString() === uri.toString());\n\t\treturn file?.references.map(ref => ref.location.range);\n\t}\n\n\tremove(item: FileItem | ReferenceItem) {\n\t\tif (item instanceof FileItem) {\n\t\t\tdel(this.items, item);\n\t\t\tthis._onDidChange.fire(undefined);\n\t\t} else {\n\t\t\tdel(item.file.references, item);\n\t\t\tif (item.file.references.length === 0) {\n\t\t\t\tdel(this.items, item.file);\n\t\t\t\tthis._onDidChange.fire(undefined);\n\t\t\t} else {\n\t\t\t\tthis._onDidChange.fire(item.file);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync asCopyText() {\n\t\tlet result = '';\n\t\tfor (const item of this.items) {\n\t\t\tresult += `${await item.asCopyText()}\\n`;\n\t\t}\n\t\treturn result;\n\t}\n\n\tgetDragUri(item: FileItem | ReferenceItem): vscode.Uri | undefined {\n\t\tif (item instanceof FileItem) {\n\t\t\treturn item.uri;\n\t\t} else {\n\t\t\treturn asResourceUrl(item.file.uri, item.location.range);\n\t\t}\n\t}\n}\n\nclass ReferencesTreeDataProvider implements vscode.TreeDataProvider<FileItem | ReferenceItem> {\n\n\tprivate readonly _listener: vscode.Disposable;\n\tprivate readonly _onDidChange = new vscode.EventEmitter<FileItem | ReferenceItem | undefined>();\n\n\treadonly onDidChangeTreeData = this._onDidChange.event;\n\n\tconstructor(private readonly _model: ReferencesModel) {\n\t\tthis._listener = _model.onDidChangeTreeData(() => this._onDidChange.fire(undefined));\n\t}\n\n\tdispose(): void {\n\t\tthis._onDidChange.dispose();\n\t\tthis._listener.dispose();\n\t}\n\n\tasync getTreeItem(element: FileItem | ReferenceItem) {\n\t\tif (element instanceof FileItem) {\n\t\t\t// files\n\t\t\tconst result = new vscode.TreeItem(element.uri);\n\t\t\tresult.contextValue = 'file-item';\n\t\t\tresult.description = true;\n\t\t\tresult.iconPath = vscode.ThemeIcon.File;\n\t\t\tresult.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed;\n\t\t\treturn result;\n\n\t\t} else {\n\t\t\t// references\n\t\t\tconst { range } = element.location;\n\t\t\tconst doc = await element.getDocument(true);\n\t\t\tconst { before, inside, after } = getPreviewChunks(doc, range);\n\n\t\t\tconst label: vscode.TreeItemLabel = {\n\t\t\t\tlabel: before + inside + after,\n\t\t\t\thighlights: [[before.length, before.length + inside.length]]\n\t\t\t};\n\n\t\t\tconst result = new vscode.TreeItem(label);\n\t\t\tresult.collapsibleState = vscode.TreeItemCollapsibleState.None;\n\t\t\tresult.contextValue = 'reference-item';\n\t\t\tresult.command = {\n\t\t\t\tcommand: 'vscode.open',\n\t\t\t\ttitle: vscode.l10n.t('Open Reference'),\n\t\t\t\targuments: [\n\t\t\t\t\telement.location.uri,\n\t\t\t\t\t{ selection: range.with({ end: range.start }) } satisfies vscode.TextDocumentShowOptions\n\t\t\t\t]\n\t\t\t};\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tasync getChildren(element?: FileItem | ReferenceItem) {\n\t\tif (!element) {\n\t\t\treturn this._model.items;\n\t\t}\n\t\tif (element instanceof FileItem) {\n\t\t\treturn element.references;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tgetParent(element: FileItem | ReferenceItem) {\n\t\treturn element instanceof ReferenceItem ? element.file : undefined;\n\t}\n}\n\nexport class FileItem {\n\n\tconstructor(\n\t\treadonly uri: vscode.Uri,\n\t\treadonly references: Array<ReferenceItem>,\n\t\treadonly model: ReferencesModel\n\t) { }\n\n\t// --- adapter\n\n\tremove(): void {\n\t\tthis.model.remove(this);\n\t}\n\n\tasync asCopyText() {\n\t\tlet result = `${vscode.workspace.asRelativePath(this.uri)}\\n`;\n\t\tfor (const ref of this.references) {\n\t\t\tresult += ` ${await ref.asCopyText()}\\n`;\n\t\t}\n\t\treturn result;\n\t}\n}\n\nexport class ReferenceItem {\n\n\tprivate _document: Thenable<vscode.TextDocument> | undefined;\n\n\tconstructor(\n\t\treadonly location: vscode.Location,\n\t\treadonly file: FileItem,\n\t) { }\n\n\tasync getDocument(warmUpNext?: boolean) {\n\t\tif (!this._document) {\n\t\t\tthis._document = vscode.workspace.openTextDocument(this.location.uri);\n\t\t}\n\t\tif (warmUpNext) {\n\t\t\t// load next document once this document has been loaded\n\t\t\tconst next = this.file.model.next(this.file);\n\t\t\tif (next instanceof FileItem && next !== this.file) {\n\t\t\t\tvscode.workspace.openTextDocument(next.uri);\n\t\t\t} else if (next instanceof ReferenceItem) {\n\t\t\t\tvscode.workspace.openTextDocument(next.location.uri);\n\t\t\t}\n\t\t}\n\t\treturn this._document;\n\t}\n\n\t// --- adapter\n\n\tremove(): void {\n\t\tthis.file.model.remove(this);\n\t}\n\n\tasync asCopyText() {\n\t\tconst doc = await this.getDocument();\n\t\tconst chunks = getPreviewChunks(doc, this.location.range, 21, false);\n\t\treturn `${this.location.range.start.line + 1}, ${this.location.range.start.character + 1}: ${chunks.before + chunks.inside + chunks.after}`;\n\t}\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(256);\n"],"names":["TypesTreeInput","constructor","location","direction","contextValue","this","title","vscode","l10n","t","resolve","items","Promise","commands","executeCommand","uri","range","start","model","TypesModel","provider","TypeItemDataProvider","roots","length","message","undefined","navigation","highlights","dnd","dispose","TypeItem","item","parent","remove","_onDidChange","EventEmitter","onDidChange","event","map","_resolveTypes","currentType","types","getTypeChildren","children","getDragUri","asResourceUrl","Location","nearest","_position","find","toString","next","from","_move","previous","fwd","tail","array","includes","idx","indexOf","getEditorHighlights","selectionRange","siblings","del","fire","_model","_emitter","onDidChangeTreeData","_modelListener","e","getTreeItem","element","TreeItem","name","description","detail","iconPath","getThemeIcon","kind","command","arguments","selection","with","end","collapsibleState","TreeItemCollapsibleState","Collapsed","getChildren","getParent","_view","_delegate","_decorationType","window","createTextEditorDecorationType","backgroundColor","ThemeColor","rangeBehavior","DecorationRangeBehavior","ClosedClosed","overviewRulerLane","OverviewRulerLane","Center","overviewRulerColor","disposables","_ignore","Set","push","workspace","onDidChangeTextDocument","add","document","onDidChangeActiveTextEditor","visible","update","onDidChangeVisibility","_show","_hide","onDidChangeSelection","Disposable","editor","visibleTextEditors","setDecorations","activeTextEditor","viewColumn","has","anchor","ranges","_disposables","_ctxCanNavigate","ContextKey","registerCommand","delegate","set","Boolean","_anchor","sel","active","_open","loc","preserveFocus","Selection","newItem","newLocation","reveal","select","focus","CallsTreeInput","CallsModel","CallItemDataProvider","CallItem","locations","_resolveCalls","call","calls","fromRanges","to","getCallChildren","filter","openArgs","tooltip","label","firstLoctionStart","isBefore","Range","tree","context","RichTypesDirection","workspaceState","setTypeHierarchyDirection","value","newInput","oldInput","getInput","setInput","subscriptions","input","removeTypeItem","_mem","_value","_ctxMode","raw","get","_key","SymbolsTree","references","register","splice","fragment","line","character","async","position","doc","openTextDocument","getWordRangeAtPosition","beforeLen","trim","previewStart","Math","max","wordRange","before","getText","inside","previewEnd","translate","after","replace","id","_themeIconIds","ThemeIcon","reset","_doc","_version","version","_word","_getAnchorWord","pos","guessedTrackedPosition","wordNow","startLine","checked","i","lineCount","ch","lineAt","text","Position","module","exports","require","findLocations","ReferencesTreeInput","showReferencesDisposable","args","removeReferenceItem","copyCommand","copyAllCommand","copyPathCommand","config","updateShowReferences","affectsConfiguration","getConfiguration","onDidChangeConfiguration","ReferenceItem","file","FileItem","val","ReferencesModel","asCopyText","env","clipboard","writeText","scheme","fsPath","RichCallsDirection","setCallsDirection","removeCallItem","viewId","_ctxIsActive","_ctxHasResult","_ctxInputSource","_history","TreeInputHistory","_provider","TreeDataProviderDelegate","_dnd","TreeDndDelegate","_tree","createTreeView","treeDataProvider","showCollapseAll","dragAndDropController","_navigation","Navigation","_sessionDisposable","_input","isValidRequestPosition","clearInput","newInputKind","Object","getPrototypeOf","modelPromise","then","expand","EditorHighlights","size","_sessionDispoables","catch","err","console","error","_assertProvider","Error","dropMimeTypes","dragMimeTypes","handleDrag","source","data","urls","DataTransferItem","join","handleDrop","HistoryItem","key","word","asRelativePath","toLocaleLowerCase","_onDidChangeTreeData","_ctxHasHistory","_inputs","Map","clear","_reRunHistoryItem","Array","values","pop","picks","pick","showQuickPick","placeHolder","delete","newPosition","isEqual","WordAnchor","JSON","stringify","result","None","all","reverse","_command","_result","resut","ReferencesTreeDataProvider","last","sort","_compareLocations","targetUri","targetRange","_compareUriIgnoreFragment","a","b","aStr","bStr","aUri","bUri","aRange","bRange","isAfter","total","reduce","prev","cur","files","ref","contains","lastBefore","best","bestValue","_prefixLen","charCodeAt","delta","_item","_listener","File","getDocument","getPreviewChunks","warmUpNext","_document","chunks","__webpack_module_cache__","__webpack_exports__","__webpack_require__","moduleId","cachedModule","__webpack_modules__"],"sourceRoot":""}
|