Socket
Socket
Sign inDemoInstall

coc-metals

Package Overview
Dependencies
184
Maintainers
4
Versions
47
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.7 to 1.0.8

12

lib/index.js
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"eojW":[function(require,module,exports) {
"use strict";var o;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Commands=void 0,function(o){o.RELOAD_WINDOW="workbench.action.reloadWindow",o.OPEN_COC_CONFIG="CocConfig",o.RESTART_COC="CocRestart",o.OPEN_PREVIEW="coc#util#preview_info",o.HAS_PREVIEW="coc#util#has_preview",o.OPEN_LOGS="CocCommand workspace.showOutput"}(o=exports.Commands||(exports.Commands={}));
"use strict";var o;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Commands=void 0,function(o){o.RELOAD_WINDOW="workbench.action.reloadWindow",o.OPEN_COC_CONFIG="CocConfig",o.RESTART_COC="CocRestart",o.OPEN_PREVIEW="coc#util#preview_info",o.HAS_PREVIEW="coc#list#has_preview",o.OPEN_LOGS="CocCommand workspace.showOutput",o.MOVE_TO="coc#cursor#move_to"}(o=exports.Commands||(exports.Commands={}));
},{}],"p29A":[function(require,module,exports) {

@@ -14,6 +14,6 @@ "use strict";var e=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))(function(r,i){function a(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(a,c)}s((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const t=require("coc.nvim");class o{constructor(e){this.currentDecorations=[],this.decorationNameSpace=t.workspace.createNameSpace("worksheetDecorations"),this.floatFactory=e}setDecorations(o){return e(this,void 0,void 0,function*(){const e=t.workspace.getDocument(o.uri),{buffer:n}=e;n.clearNamespace(this.decorationNameSpace),this.currentDecorations=[],o.options.forEach(e=>{var t,o,r,i;this.currentDecorations.push(e),n.setVirtualText(this.decorationNameSpace,e.range.end.line,[[null!==(i=null===(r=null===(o=null===(t=e.renderOptions)||void 0===t?void 0:t.after)||void 0===o?void 0:o.contentText)||void 0===r?void 0:r.replace("//","‣"))&&void 0!==i?i:"","Comment"]])})})}showHover(){return e(this,void 0,void 0,function*(){const{position:e}=yield t.workspace.getCurrentState(),o=this.currentDecorations.find(t=>t.range.end.line===e.line);o&&"string"!=typeof o.hoverMessage&&o.hoverMessage&&(yield this.floatFactory.create([{content:o.hoverMessage.value,filetype:o.hoverMessage.kind}],!0,0))})}clearDecorations(e){const o=t.workspace.getDocument(e),{buffer:n}=o;n.clearNamespace(this.decorationNameSpace),this.currentDecorations=[]}}exports.default=o;

},{"./utils":"Iw8s"}],"dDyQ":[function(require,module,exports) {
"use strict";var e=this&&this.__awaiter||function(e,i,t,o){return new(t||(t=Promise))(function(n,d){function s(e){try{l(o.next(e))}catch(i){d(i)}}function r(e){try{l(o.throw(e))}catch(i){d(i)}}function l(e){var i;e.done?n(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(s,r)}l((o=o.apply(e,i||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.TreeView=void 0;const i=require("coc.nvim"),t=require("./utils");class o{constructor(e,i,t,o,n){this.nvim=e,this.config=i,this.buffer=t,this.model=o,this.logger=n,this.firstUpdate=!0,this.closed="▸",this.open="▾",this.eventQueue=Promise.resolve(1),this.highlightPlaceId=0}init(){return e(this,void 0,void 0,function*(){yield this.nvim.command(`silent file ${this.model.viewId}`);const e="nnoremap <buffer> <silent>";function i(e){return`:<C-u>CocCommand metals.tvp.view ${e} <CR>`}yield this.nvim.command(`${e} ${this.config.get("toggleNode")} ${i("ToggleNode")}`),yield this.nvim.command(`${e} ${this.config.get("forceChildrenReload")} ${i("ForceChildrenReload")}`),yield this.nvim.command(`${e} ${this.config.get("gotoParentNode")} ${i("ParentNode")}`),yield this.nvim.command(`${e} ${this.config.get("gotoFirstChild")} ${i("FirstSibling")}`),yield this.nvim.command(`${e} ${this.config.get("gotoLastChild")} ${i("LastSibling")}`),yield this.nvim.command(`${e} ${this.config.get("gotoPrevSibling")} ${i("PrevSibling")}`),yield this.nvim.command(`${e} ${this.config.get("gotoLastSibling")} ${i("NextSibling")}`),yield this.nvim.command(`${e} ${this.config.get("executeCommand")} ${i("ExecuteCommand")}`),yield this.nvim.command(`${e} ${this.config.get("executeCommandAndOpenSplit")} ${i("ExecuteCommandAndOpenSplit")}`),yield this.nvim.command(`${e} ${this.config.get("executeCommandAndOpenVSplit")} ${i("ExecuteCommandAndOpenVSplit")}`),yield this.nvim.command(`${e} ${this.config.get("executeCommandAndOpenTab")} ${i("ExecuteCommandAndOpenTab")}`),yield this.nvim.command(`au BufWinLeave <buffer> CocCommand metals.tvp.view Hidden ${this.model.viewId}`),yield this.nvim.command("setlocal nonumber norelativenumber nobuflisted nowrap noswapfile winfixwidth winfixheight"),yield this.nvim.command("setlocal statusline=%f buftype=nofile bufhidden=hide"),this.model.updateEvents(e=>this.handleModelUpdates(e));const t=this.config.get("initialViews");yield this.model.rootNode.expand();const o=null==t?void 0:t.find(e=>e.name===this.model.viewId);void 0!==o&&(yield Promise.all(o.expanded.map(e=>this.model.revealByParents(e.concat("")))),yield this.nvim.call("coc#util#jumpTo",[0,1]))})}get bufferId(){return this.buffer.id}restoreCursor(i,t,o){return e(this,void 0,void 0,function*(){yield i.setCursor([t,1]),yield i.setCursor([o,1])})}handleModelUpdates(o){let n;n=void 0===o.root.underlying.nodeUri?{root:o.newNodes[1],oldNodes:o.oldNodes.slice(1),newNodes:o.newNodes.slice(1),focusEvent:o.focusEvent}:o,this.eventQueue=this.eventQueue.then(o=>e(this,void 0,void 0,function*(){const o=void 0!==n.root?yield this.model.findNodeOffset(n.root):1;if(void 0===o)return;const d=o-1,s=yield this.nvim.tabpage,r=yield this.nvim.windows,l=yield s.windows,c=yield this.nvim.call("win_findbuf",this.bufferId),a=r.filter(e=>-1!=c.indexOf(e.id));if(n.focusEvent)void 0!==n.root&&this.logger.debug(`Focus event. Root: ${n.root.underlying.nodeUri}, offset: ${d}.`),yield t.sequence(a,i=>e(this,void 0,void 0,function*(){void 0!==l.find(e=>e.id===i.id)&&(yield this.nvim.call("win_gotoid",[i.id]),yield this.restoreCursor(i,1,d+1),yield this.nvim.command("redraw"))}));else{const o=n.newNodes.map(e=>e.underlying.nodeUri).join(",");void 0!==n.root&&this.logger.debug(`Update event. Root: ${n.root.underlying.nodeUri}, length: ${n.oldNodes.length}, payload: ${o}.`),yield this.modifyBuffer(()=>e(this,void 0,void 0,function*(){const o=yield t.sequence(a,t=>e(this,void 0,void 0,function*(){const e=yield t.cursor;if(i.workspace.isVim&&void 0!==l.find(e=>e.id===t.id)){const e=(yield this.nvim.call("win_execute",[t.id,'echo line(".").":".line("w0")'])).split(":").map(e=>parseInt(e,10));return{window:t,curLine:e[0],topLine:e[1]}}return{window:t,curLine:e[0],topLine:void 0}}));yield this.removeRows(d,n.oldNodes),yield this.insertRows(d,n.newNodes),yield t.sequence(o,({window:i,curLine:t,topLine:o})=>e(this,void 0,void 0,function*(){void 0!==o?(yield this.restoreCursor(i,o,t),yield this.nvim.call("win_execute",[i.id,"redraw"])):yield i.setCursor([t,1])})),this.firstUpdate&&(this.firstUpdate=!1,yield this.buffer.remove(n.newNodes.length,n.newNodes.length+1))}))}}))}removeRows(i,t){return e(this,void 0,void 0,function*(){yield this.buffer.remove(i,i+t.length)})}insertRows(i,t){return e(this,void 0,void 0,function*(){yield this.buffer.insert(this.makeRows(t),i),yield Promise.all(t.map((e,t)=>{let o;switch(e.underlying.icon){case"trait":o="TvpTrait";break;case"class":o="TvpClass";break;case"object":o="TvpObject";break;case"method":o="TvpMethod";break;case"val":o="TvpVal";break;case"command":case"sync":case"connect":case"cascade":case"cancel":case"clean":case"debug-stop":o="TvpCommand";break;default:o="TvpTopLevel"}const n=this.highlightPlaceId++,d=i+t;return this.logger.debug(`signplace id=${n} schema=${o} num=${d} uri=${e.underlying.nodeUri}`),this.buffer.addHighlight({hlGroup:o,line:d})}))})}toggleTreeViewNode(){return e(this,void 0,void 0,function*(){const e=yield this.nodeUnderCursor();void 0!==e&&e.expandable()&&(yield e.isExpanded()?e.collapse():e.expand())})}forceChildrenReload(){return e(this,void 0,void 0,function*(){const e=yield this.nodeUnderCursor();void 0!==e&&e.expandable()&&(e.isExpanded()||(yield e.expand()),e.refreshSubtree(void 0))})}gotoParentNode(){return e(this,void 0,void 0,function*(){const e=yield this.nodeUnderCursor();if(void 0===e)return;const i=yield this.model.findParentNode(e);if(void 0===i)return;const t=yield this.model.findNodeOffset(i.makeView());void 0!==t&&(yield this.nvim.call("coc#util#jumpTo",[t-1,1]))})}gotoEdgeNode(i){return e(this,void 0,void 0,function*(){const e=yield this.nodeUnderCursor();if(void 0===e)return;const t=yield this.model.findParentNode(e);if(void 0===t)return;const o=yield t.getChildren();if(o.length>0){const e=i?o[0]:o[o.length-1],t=yield this.model.findNodeOffset(e.makeView());if(void 0===t)return;yield this.nvim.call("coc#util#jumpTo",[t-1,1])}})}gotoNeighboringSibling(i){return e(this,void 0,void 0,function*(){const e=yield this.nodeUnderCursor();if(void 0===e)return;const t=yield this.model.findParentNode(e);if(void 0===t)return;const o=yield t.getChildren(),n=o.findIndex(i=>i.viewNode.nodeUri===e.viewNode.nodeUri);let d;if(void 0===(d=i&&n>0?o[n-1]:!i&&n+1<o.length?o[n+1]:void 0))return;const s=yield this.model.findNodeOffset(d.makeView());void 0!==s&&(yield this.nvim.call("coc#util#jumpTo",[s-1,1]))})}executeCommand(){return e(this,void 0,void 0,function*(){const e=yield this.nodeUnderCursor();if(void 0===e)return;const t=e.viewNode.command;return void 0!==t?void 0!==t.arguments?i.commands.executeCommand(t.command,...t.arguments):i.commands.executeCommand(t.command):void 0})}revealDocInTreeView(i,t){return e(this,void 0,void 0,function*(){return this.model.revealDocument(i,t)})}makeRows(e){return e.map(e=>{let i;return i=e.expandable?(e.expanded?this.open:this.closed)+" ":" "," ".repeat(e.level-1)+i+e.underlying.label})}nodeUnderCursor(){return e(this,void 0,void 0,function*(){const e=(yield this.nvim.eval("coc#util#cursor()"))[0];return this.model.findNodeWithOffset(e+1)})}modifyBuffer(i){return e(this,void 0,void 0,function*(){try{return yield this.buffer.setOption("readonly",!1),yield this.buffer.setOption("modifiable",!0),yield i()}finally{yield this.buffer.setOption("modifiable",!1),yield this.buffer.setOption("readonly",!0)}})}dispose(){this.nvim.command(`bd ${this.bufferId}`,!0)}}exports.TreeView=o;
},{"./utils":"Iw8s"}],"GgEX":[function(require,module,exports) {
"use strict";var e=this&&this.__awaiter||function(e,i,t,n){return new(t||(t=Promise))(function(o,r){function s(e){try{l(n.next(e))}catch(i){r(i)}}function d(e){try{l(n.throw(e))}catch(i){r(i)}}function l(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(s,d)}l((n=n.apply(e,i||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.TreeViewsManager=exports.WindowProp=void 0;const i=require("coc.nvim"),t=require("./treeview"),n=require("./utils");var o;!function(e){e[e.Default=0]="Default",e[e.HSplit=1]="HSplit",e[e.VSplit=2]="VSplit",e[e.Tab=3]="Tab"}(o=exports.WindowProp||(exports.WindowProp={}));class r{constructor(e,t){this.nvim=e,this.logger=t,this.view2treemodel=new Map,this.view2treeview=new Map,this.lastWindowProp=[o.Default,0],this.config=i.workspace.configurations.getConfiguration("metals.treeviews"),this.nvim.command("highlight default link TvpClass Constant",!0),this.nvim.command("highlight default link TvpObject PreProc",!0),this.nvim.command("highlight default link TvpTrait Statement",!0),this.nvim.command("highlight default link TvpMethod Identifier",!0),this.nvim.command("highlight default link TvpVal Type",!0),this.nvim.command("highlight default link TvpTopLevel MsgArea",!0),this.nvim.command("highlight default link TvpCommand Directory",!0),this.nvim.command("sign define TvpClass linehl=TvpClass",!0),this.nvim.command("sign define TvpObject linehl=TvpObject",!0),this.nvim.command("sign define TvpTrait linehl=TvpTrait",!0),this.nvim.command("sign define TvpMethod linehl=TvpMethod",!0),this.nvim.command("sign define TvpVal linehl=TvpVal",!0),this.nvim.command("sign define TvpVal linehl=TvpTopLevel",!0),this.nvim.command("sign define TvpVal linehl=TvpCommand",!0)}addTreeModel(e){this.view2treemodel.set(e.viewId,e)}disposeTreeModel(e){this.view2treemodel.delete(e)}allTreeViews(){return[...this.view2treemodel.keys()]}toggleAllTrees(){var i;return e(this,void 0,void 0,function*(){const t=this.allTreeViews();if(!this.checkTreeViewAvailability(t))return;const[o,r]=yield this.getOpenWindows(t);if(r.length>0)yield Promise.all(r.map(({window:e})=>e.close(!0))),t.forEach(e=>o.setVar(e,0,!1));else{const r=null!==(i=this.config.get("initialViews"))&&void 0!==i?i:[],s=yield n.sequence(t.filter(e=>void 0!==r.find(i=>i.name===e)).sort(this.viewsComparator(r)),(i,t)=>e(this,void 0,void 0,function*(){0==t?yield this.makeTreeViewPanel(i):yield this.nvim.command(`new ${i}`);const e=yield this.assignOrCreateTreeView(o,i);return{name:i,window:e}}));yield this.alignWindows(s,r)}})}toggleTreeView(i){var t;return e(this,void 0,void 0,function*(){const e=this.allTreeViews();if(!this.checkTreeViewAvailability(e))return;if(!this.checkTreeViewExistence(e,i))return;const[n,o]=yield this.toggleTreeViewInternal(e,i,!1),r=null!==(t=this.config.get("initialViews"))&&void 0!==t?t:[];return n?this.alignWindows(o,r):void 0})}toggleTreeViewInternal(i,t,n){return e(this,void 0,void 0,function*(){const[e,o]=yield this.getOpenWindows(i),r=o.find(({name:e})=>e==t);if(void 0!==r)return n||(yield r.window.close(!0),yield e.setVar(t,0,!1)),[!1,[]];if(0!=o.length){const i=o[0].window;yield this.nvim.call("win_gotoid",i.id),yield this.nvim.command(`new ${t}`);const n=yield this.assignOrCreateTreeView(e,t);return[!0,o.concat({name:t,window:n})]}{yield this.makeTreeViewPanel(t);const i=yield this.assignOrCreateTreeView(e,t);return[!0,o.concat({name:t,window:i})]}})}revealDocInTreeView(i,t,n){var o;return e(this,void 0,void 0,function*(){const e=this.allTreeViews();if(!this.checkTreeViewAvailability(e))return;if(!this.checkTreeViewExistence(e,i))return;const[r,s]=yield this.toggleTreeViewInternal(e,i,!0),d=null!==(o=this.config.get("initialViews"))&&void 0!==o?o:[];r&&(yield this.alignWindows(s,d));const l=this.view2treeview.get(i);return null==l?void 0:l.revealDocInTreeView(t,n).then(()=>void 0)})}makeTreeViewPanel(e){const i=this.config.get("initialWidth"),t="right"==this.config.get("alignment")?"botright":"topleft";return this.nvim.command(`silent ${t} vertical ${i} new ${e}`)}getOpenWindows(i){return e(this,void 0,void 0,function*(){const t=yield this.nvim.tabpage,n=yield this.nvim.windows,o=yield Promise.all(i.map(i=>e(this,void 0,void 0,function*(){const e=yield t.getVar(i);return{name:i,window:n.find(i=>i.id==e)}}))).then(e=>e.filter(e=>void 0!==e.window));return[t,o]})}assignOrCreateTreeView(i,n){return e(this,void 0,void 0,function*(){const e=this.view2treeview.get(n),o=this.view2treemodel.get(n);if(null==o||o.show(),void 0!==e)yield this.nvim.call("coc#util#jumpTo",[0,1]);else if(void 0!==o){const e=yield this.nvim.buffer,i=new t.TreeView(this.nvim,this.config,e,o,this.logger);yield i.init(),this.view2treeview.set(n,i)}const r=yield this.nvim.window;yield i.setVar(n,r.id,!1);const s=yield i.getVar("alltreeviews");return null===s?yield i.setVar("alltreeviews",n,!1):-1==s.indexOf(n)&&(yield i.setVar("alltreeviews",`${s},${n}`,!1)),r})}checkTreeViewAvailability(e){return void 0!==e&&0!=e.length||(i.workspace.showMessage("Information about Tree Views is not yet loaded. Please try a bit later.","warning"),!1)}checkTreeViewExistence(e,t){return-1!=e.indexOf(t)||(i.workspace.showMessage(`Unknown view name ${t}. Available values: ${e.join(", ")}`,"error"),!1)}alignWindows(i,t){return e(this,void 0,void 0,function*(){const e=(yield Promise.all(i.map(({window:e})=>e.height))).reduce((e,i)=>e+i,0),n=i.map(({name:e,window:i})=>{const n=t.find(i=>i.name===e);let o;return[i,o=void 0===n?0!=t.length?t.reduce((e,i)=>Math.min(e,i.size),Number.MAX_VALUE):10:n.size]}),o=n.map(([e,i])=>i).reduce((e,i)=>e+i);yield Promise.all(n.map(([i,t])=>i.setHeight(Math.floor(t*e/o))))})}toggleTreeViewNode(){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(e=>e.toggleTreeViewNode())})}forceChildrenReload(){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(e=>e.forceChildrenReload())})}gotoParentNode(){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(e=>e.gotoParentNode())})}gotoFirstNode(){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(e=>e.gotoEdgeNode(!0))})}gotoLastNode(){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(e=>e.gotoEdgeNode(!1))})}gotoPrevSibling(){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(e=>e.gotoNeighboringSibling(!0))})}gotoNextSibling(){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(e=>e.gotoNeighboringSibling(!1))})}executeCommand(i){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(t=>e(this,void 0,void 0,function*(){this.lastWindowProp=[i,Date.now()],yield t.executeCommand()}))})}doOnActiveTree(i){return e(this,void 0,void 0,function*(){const e=yield this.nvim.eval('bufnr("%")'),t=[...this.view2treeview.values()].find(i=>i.bufferId==e);return void 0===t?this.nvim.command("echo 'no active tree view'"):i(t)})}viewsComparator(e){return(i,t)=>{const n=e.findIndex(e=>e.name===i),o=e.findIndex(e=>e.name===t);return-1==n&&-1==o?0:-1==n?1:-1==o?-1:o-n}}prepareWindowForGoto(){return e(this,void 0,void 0,function*(){const e=Date.now()-this.lastWindowProp[1]<1e3?this.lastWindowProp[0]:o.Default;if(e===o.Tab)yield this.nvim.command("tabnew");else{const i=yield this.nvim.tabpage,t=(yield i.getVar("alltreeviews"))||"",n=yield Promise.all(t.split(",").map(e=>i.getVar(e))),r=yield i.windows,s=r.map(e=>e.id).sort().find(e=>void 0===n.find(i=>e===i));if(void 0===s){const e=this.config.get("initialWidth"),i="right"==this.config.get("alignment")?"topleft":"botright";if(r.length>0){const t=yield r[0].width;yield this.nvim.command(`silent ${i} vertical new`),yield this.nvim.command(`silent vertical resize ${t-e}`)}else yield this.nvim.command(`silent ${i} vertical new`)}else yield this.nvim.call("win_gotoid",s),e===o.HSplit?yield this.nvim.command("split"):e===o.VSplit&&(yield this.nvim.command("vsplit"))}})}viewHidden(e){const i=this.view2treemodel.get(e);void 0!==i&&i.hide()}dispose(){this.view2treeview.forEach(e=>e.dispose())}}exports.TreeViewsManager=r;
},{"./treeview":"dDyQ","./utils":"Iw8s"}],"bAI2":[function(require,module,exports) {
"use strict";var e=this&&this.__awaiter||function(e,i,n,t){return new(n||(n=Promise))(function(o,d){function s(e){try{l(t.next(e))}catch(i){d(i)}}function r(e){try{l(t.throw(e))}catch(i){d(i)}}function l(e){var i;e.done?o(e.value):(i=e.value,i instanceof n?i:new n(function(e){e(i)})).then(s,r)}l((t=t.apply(e,i||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.TreeView=void 0;const i=require("coc.nvim"),n=require("./utils"),t=require("../commands");class o{constructor(e,i,n,t,o){this.nvim=e,this.config=i,this.buffer=n,this.model=t,this.logger=o,this.firstUpdate=!0,this.closed="▸",this.open="▾",this.eventQueue=Promise.resolve(1),this.highlightPlaceId=0}init(){return e(this,void 0,void 0,function*(){yield this.nvim.command(`silent file ${this.model.viewId}`);const e="nnoremap <buffer> <silent>";function i(e){return`:<C-u>CocCommand metals.tvp.view ${e} <CR>`}yield this.nvim.command(`${e} ${this.config.get("toggleNode")} ${i("ToggleNode")}`),yield this.nvim.command(`${e} ${this.config.get("forceChildrenReload")} ${i("ForceChildrenReload")}`),yield this.nvim.command(`${e} ${this.config.get("gotoParentNode")} ${i("ParentNode")}`),yield this.nvim.command(`${e} ${this.config.get("gotoFirstChild")} ${i("FirstSibling")}`),yield this.nvim.command(`${e} ${this.config.get("gotoLastChild")} ${i("LastSibling")}`),yield this.nvim.command(`${e} ${this.config.get("gotoPrevSibling")} ${i("PrevSibling")}`),yield this.nvim.command(`${e} ${this.config.get("gotoLastSibling")} ${i("NextSibling")}`),yield this.nvim.command(`${e} ${this.config.get("executeCommand")} ${i("ExecuteCommand")}`),yield this.nvim.command(`${e} ${this.config.get("executeCommandAndOpenSplit")} ${i("ExecuteCommandAndOpenSplit")}`),yield this.nvim.command(`${e} ${this.config.get("executeCommandAndOpenVSplit")} ${i("ExecuteCommandAndOpenVSplit")}`),yield this.nvim.command(`${e} ${this.config.get("executeCommandAndOpenTab")} ${i("ExecuteCommandAndOpenTab")}`),yield this.nvim.command(`au BufWinLeave <buffer> CocCommand metals.tvp.view Hidden ${this.model.viewId}`),yield this.nvim.command("setlocal nonumber norelativenumber nobuflisted nowrap noswapfile winfixwidth winfixheight"),yield this.nvim.command("setlocal statusline=%f buftype=nofile bufhidden=hide"),this.model.updateEvents(e=>this.handleModelUpdates(e));const n=this.config.get("initialViews");yield this.model.rootNode.expand();const o=null==n?void 0:n.find(e=>e.name===this.model.viewId);void 0!==o&&(yield Promise.all(o.expanded.map(e=>this.model.revealByParents(e.concat("")))),yield this.nvim.call(t.Commands.MOVE_TO,[0,1]))})}get bufferId(){return this.buffer.id}restoreCursor(i,n,t){return e(this,void 0,void 0,function*(){yield i.setCursor([n,1]),yield i.setCursor([t,1])})}handleModelUpdates(t){let o;o=void 0===t.root.underlying.nodeUri?{root:t.newNodes[1],oldNodes:t.oldNodes.slice(1),newNodes:t.newNodes.slice(1),focusEvent:t.focusEvent}:t,this.eventQueue=this.eventQueue.then(t=>e(this,void 0,void 0,function*(){const t=void 0!==o.root?yield this.model.findNodeOffset(o.root):1;if(void 0===t)return;const d=t-1,s=yield this.nvim.tabpage,r=yield this.nvim.windows,l=yield s.windows,c=yield this.nvim.call("win_findbuf",this.bufferId),a=r.filter(e=>-1!=c.indexOf(e.id));if(o.focusEvent)void 0!==o.root&&this.logger.debug(`Focus event. Root: ${o.root.underlying.nodeUri}, offset: ${d}.`),yield n.sequence(a,i=>e(this,void 0,void 0,function*(){void 0!==l.find(e=>e.id===i.id)&&(yield this.nvim.call("win_gotoid",[i.id]),yield this.restoreCursor(i,1,d+1),yield this.nvim.command("redraw"))}));else{const t=o.newNodes.map(e=>e.underlying.nodeUri).join(",");void 0!==o.root&&this.logger.debug(`Update event. Root: ${o.root.underlying.nodeUri}, length: ${o.oldNodes.length}, payload: ${t}.`),yield this.modifyBuffer(()=>e(this,void 0,void 0,function*(){const t=yield n.sequence(a,n=>e(this,void 0,void 0,function*(){const e=yield n.cursor;if(i.workspace.isVim&&void 0!==l.find(e=>e.id===n.id)){const e=(yield this.nvim.call("win_execute",[n.id,'echo line(".").":".line("w0")'])).split(":").map(e=>parseInt(e,10));return{window:n,curLine:e[0],topLine:e[1]}}return{window:n,curLine:e[0],topLine:void 0}}));yield this.removeRows(d,o.oldNodes),yield this.insertRows(d,o.newNodes),yield n.sequence(t,({window:i,curLine:n,topLine:t})=>e(this,void 0,void 0,function*(){void 0!==t?(yield this.restoreCursor(i,t,n),yield this.nvim.call("win_execute",[i.id,"redraw"])):yield i.setCursor([n,1])})),this.firstUpdate&&(this.firstUpdate=!1,yield this.buffer.remove(o.newNodes.length,o.newNodes.length+1))}))}}))}removeRows(i,n){return e(this,void 0,void 0,function*(){yield this.buffer.remove(i,i+n.length)})}insertRows(i,n){return e(this,void 0,void 0,function*(){yield this.buffer.insert(this.makeRows(n),i),yield Promise.all(n.map((e,n)=>{let t;switch(e.underlying.icon){case"trait":t="TvpTrait";break;case"class":t="TvpClass";break;case"object":t="TvpObject";break;case"method":t="TvpMethod";break;case"val":t="TvpVal";break;case"command":case"sync":case"connect":case"cascade":case"cancel":case"clean":case"debug-stop":t="TvpCommand";break;default:t="TvpTopLevel"}const o=this.highlightPlaceId++,d=i+n;return this.logger.debug(`signplace id=${o} schema=${t} num=${d} uri=${e.underlying.nodeUri}`),this.buffer.addHighlight({hlGroup:t,line:d})}))})}toggleTreeViewNode(){return e(this,void 0,void 0,function*(){const e=yield this.nodeUnderCursor();void 0!==e&&e.expandable()&&(yield e.isExpanded()?e.collapse():e.expand())})}forceChildrenReload(){return e(this,void 0,void 0,function*(){const e=yield this.nodeUnderCursor();void 0!==e&&e.expandable()&&(e.isExpanded()||(yield e.expand()),e.refreshSubtree(void 0))})}gotoParentNode(){return e(this,void 0,void 0,function*(){const e=yield this.nodeUnderCursor();if(void 0===e)return;const i=yield this.model.findParentNode(e);if(void 0===i)return;const n=yield this.model.findNodeOffset(i.makeView());void 0!==n&&(yield this.nvim.call(t.Commands.MOVE_TO,[n-1,1]))})}gotoEdgeNode(i){return e(this,void 0,void 0,function*(){const e=yield this.nodeUnderCursor();if(void 0===e)return;const n=yield this.model.findParentNode(e);if(void 0===n)return;const o=yield n.getChildren();if(o.length>0){const e=i?o[0]:o[o.length-1],n=yield this.model.findNodeOffset(e.makeView());if(void 0===n)return;yield this.nvim.call(t.Commands.MOVE_TO,[n-1,1])}})}gotoNeighboringSibling(i){return e(this,void 0,void 0,function*(){const e=yield this.nodeUnderCursor();if(void 0===e)return;const n=yield this.model.findParentNode(e);if(void 0===n)return;const o=yield n.getChildren(),d=o.findIndex(i=>i.viewNode.nodeUri===e.viewNode.nodeUri);let s;if(void 0===(s=i&&d>0?o[d-1]:!i&&d+1<o.length?o[d+1]:void 0))return;const r=yield this.model.findNodeOffset(s.makeView());void 0!==r&&(yield this.nvim.call(t.Commands.MOVE_TO,[r-1,1]))})}executeCommand(){return e(this,void 0,void 0,function*(){const e=yield this.nodeUnderCursor();if(void 0===e)return;const n=e.viewNode.command;return void 0!==n?void 0!==n.arguments?i.commands.executeCommand(n.command,...n.arguments):i.commands.executeCommand(n.command):void 0})}revealDocInTreeView(i,n){return e(this,void 0,void 0,function*(){return this.model.revealDocument(i,n)})}makeRows(e){return e.map(e=>{let i;return i=e.expandable?(e.expanded?this.open:this.closed)+" ":" "," ".repeat(e.level-1)+i+e.underlying.label})}nodeUnderCursor(){return e(this,void 0,void 0,function*(){const e=(yield this.nvim.eval("coc#util#cursor()"))[0];return this.model.findNodeWithOffset(e+1)})}modifyBuffer(i){return e(this,void 0,void 0,function*(){try{return yield this.buffer.setOption("readonly",!1),yield this.buffer.setOption("modifiable",!0),yield i()}finally{yield this.buffer.setOption("modifiable",!1),yield this.buffer.setOption("readonly",!0)}})}dispose(){this.nvim.command(`bd ${this.bufferId}`,!0)}}exports.TreeView=o;
},{"./utils":"Iw8s","../commands":"eojW"}],"GgEX":[function(require,module,exports) {
"use strict";var e=this&&this.__awaiter||function(e,i,t,n){return new(t||(t=Promise))(function(o,r){function s(e){try{l(n.next(e))}catch(i){r(i)}}function d(e){try{l(n.throw(e))}catch(i){r(i)}}function l(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(s,d)}l((n=n.apply(e,i||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.TreeViewsManager=exports.WindowProp=void 0;const i=require("coc.nvim"),t=require("./treeview"),n=require("./utils"),o=require("../commands");var r;!function(e){e[e.Default=0]="Default",e[e.HSplit=1]="HSplit",e[e.VSplit=2]="VSplit",e[e.Tab=3]="Tab"}(r=exports.WindowProp||(exports.WindowProp={}));class s{constructor(e,t){this.nvim=e,this.logger=t,this.view2treemodel=new Map,this.view2treeview=new Map,this.lastWindowProp=[r.Default,0],this.config=i.workspace.configurations.getConfiguration("metals.treeviews"),this.nvim.command("highlight default link TvpClass Constant",!0),this.nvim.command("highlight default link TvpObject PreProc",!0),this.nvim.command("highlight default link TvpTrait Statement",!0),this.nvim.command("highlight default link TvpMethod Identifier",!0),this.nvim.command("highlight default link TvpVal Type",!0),this.nvim.command("highlight default link TvpTopLevel MsgArea",!0),this.nvim.command("highlight default link TvpCommand Directory",!0),this.nvim.command("sign define TvpClass linehl=TvpClass",!0),this.nvim.command("sign define TvpObject linehl=TvpObject",!0),this.nvim.command("sign define TvpTrait linehl=TvpTrait",!0),this.nvim.command("sign define TvpMethod linehl=TvpMethod",!0),this.nvim.command("sign define TvpVal linehl=TvpVal",!0),this.nvim.command("sign define TvpVal linehl=TvpTopLevel",!0),this.nvim.command("sign define TvpVal linehl=TvpCommand",!0)}addTreeModel(e){this.view2treemodel.set(e.viewId,e)}disposeTreeModel(e){this.view2treemodel.delete(e)}allTreeViews(){return[...this.view2treemodel.keys()]}toggleAllTrees(){var i;return e(this,void 0,void 0,function*(){const t=this.allTreeViews();if(!this.checkTreeViewAvailability(t))return;const[o,r]=yield this.getOpenWindows(t);if(r.length>0)yield Promise.all(r.map(({window:e})=>e.close(!0))),t.forEach(e=>o.setVar(e,0,!1));else{const r=null!==(i=this.config.get("initialViews"))&&void 0!==i?i:[],s=yield n.sequence(t.filter(e=>void 0!==r.find(i=>i.name===e)).sort(this.viewsComparator(r)),(i,t)=>e(this,void 0,void 0,function*(){0==t?yield this.makeTreeViewPanel(i):yield this.nvim.command(`new ${i}`);const e=yield this.assignOrCreateTreeView(o,i);return{name:i,window:e}}));yield this.alignWindows(s,r)}})}toggleTreeView(i){var t;return e(this,void 0,void 0,function*(){const e=this.allTreeViews();if(!this.checkTreeViewAvailability(e))return;if(!this.checkTreeViewExistence(e,i))return;const[n,o]=yield this.toggleTreeViewInternal(e,i,!1),r=null!==(t=this.config.get("initialViews"))&&void 0!==t?t:[];return n?this.alignWindows(o,r):void 0})}toggleTreeViewInternal(i,t,n){return e(this,void 0,void 0,function*(){const[e,o]=yield this.getOpenWindows(i),r=o.find(({name:e})=>e==t);if(void 0!==r)return n||(yield r.window.close(!0),yield e.setVar(t,0,!1)),[!1,[]];if(0!=o.length){const i=o[0].window;yield this.nvim.call("win_gotoid",i.id),yield this.nvim.command(`new ${t}`);const n=yield this.assignOrCreateTreeView(e,t);return[!0,o.concat({name:t,window:n})]}{yield this.makeTreeViewPanel(t);const i=yield this.assignOrCreateTreeView(e,t);return[!0,o.concat({name:t,window:i})]}})}revealDocInTreeView(i,t,n){var o;return e(this,void 0,void 0,function*(){const e=this.allTreeViews();if(!this.checkTreeViewAvailability(e))return;if(!this.checkTreeViewExistence(e,i))return;const[r,s]=yield this.toggleTreeViewInternal(e,i,!0),d=null!==(o=this.config.get("initialViews"))&&void 0!==o?o:[];r&&(yield this.alignWindows(s,d));const l=this.view2treeview.get(i);return null==l?void 0:l.revealDocInTreeView(t,n).then(()=>void 0)})}makeTreeViewPanel(e){const i=this.config.get("initialWidth"),t="right"==this.config.get("alignment")?"botright":"topleft";return this.nvim.command(`silent ${t} vertical ${i} new ${e}`)}getOpenWindows(i){return e(this,void 0,void 0,function*(){const t=yield this.nvim.tabpage,n=yield this.nvim.windows,o=yield Promise.all(i.map(i=>e(this,void 0,void 0,function*(){const e=yield t.getVar(i);return{name:i,window:n.find(i=>i.id==e)}}))).then(e=>e.filter(e=>void 0!==e.window));return[t,o]})}assignOrCreateTreeView(i,n){return e(this,void 0,void 0,function*(){const e=this.view2treeview.get(n),r=this.view2treemodel.get(n);if(null==r||r.show(),void 0!==e)yield this.nvim.call(o.Commands.MOVE_TO,[0,1]);else if(void 0!==r){const e=yield this.nvim.buffer,i=new t.TreeView(this.nvim,this.config,e,r,this.logger);yield i.init(),this.view2treeview.set(n,i)}const s=yield this.nvim.window;yield i.setVar(n,s.id,!1);const d=yield i.getVar("alltreeviews");return null===d?yield i.setVar("alltreeviews",n,!1):-1==d.indexOf(n)&&(yield i.setVar("alltreeviews",`${d},${n}`,!1)),s})}checkTreeViewAvailability(e){return void 0!==e&&0!=e.length||(i.workspace.showMessage("Information about Tree Views is not yet loaded. Please try a bit later.","warning"),!1)}checkTreeViewExistence(e,t){return-1!=e.indexOf(t)||(i.workspace.showMessage(`Unknown view name ${t}. Available values: ${e.join(", ")}`,"error"),!1)}alignWindows(i,t){return e(this,void 0,void 0,function*(){const e=(yield Promise.all(i.map(({window:e})=>e.height))).reduce((e,i)=>e+i,0),n=i.map(({name:e,window:i})=>{const n=t.find(i=>i.name===e);let o;return[i,o=void 0===n?0!=t.length?t.reduce((e,i)=>Math.min(e,i.size),Number.MAX_VALUE):10:n.size]}),o=n.map(([e,i])=>i).reduce((e,i)=>e+i);yield Promise.all(n.map(([i,t])=>i.setHeight(Math.floor(t*e/o))))})}toggleTreeViewNode(){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(e=>e.toggleTreeViewNode())})}forceChildrenReload(){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(e=>e.forceChildrenReload())})}gotoParentNode(){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(e=>e.gotoParentNode())})}gotoFirstNode(){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(e=>e.gotoEdgeNode(!0))})}gotoLastNode(){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(e=>e.gotoEdgeNode(!1))})}gotoPrevSibling(){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(e=>e.gotoNeighboringSibling(!0))})}gotoNextSibling(){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(e=>e.gotoNeighboringSibling(!1))})}executeCommand(i){return e(this,void 0,void 0,function*(){return this.doOnActiveTree(t=>e(this,void 0,void 0,function*(){this.lastWindowProp=[i,Date.now()],yield t.executeCommand()}))})}doOnActiveTree(i){return e(this,void 0,void 0,function*(){const e=yield this.nvim.eval('bufnr("%")'),t=[...this.view2treeview.values()].find(i=>i.bufferId==e);return void 0===t?this.nvim.command("echo 'no active tree view'"):i(t)})}viewsComparator(e){return(i,t)=>{const n=e.findIndex(e=>e.name===i),o=e.findIndex(e=>e.name===t);return-1==n&&-1==o?0:-1==n?1:-1==o?-1:o-n}}prepareWindowForGoto(){return e(this,void 0,void 0,function*(){const e=Date.now()-this.lastWindowProp[1]<1e3?this.lastWindowProp[0]:r.Default;if(e===r.Tab)yield this.nvim.command("tabnew");else{const i=yield this.nvim.tabpage,t=(yield i.getVar("alltreeviews"))||"",n=yield Promise.all(t.split(",").map(e=>i.getVar(e))),o=yield i.windows,s=o.map(e=>e.id).sort().find(e=>void 0===n.find(i=>e===i));if(void 0===s){const e=this.config.get("initialWidth"),i="right"==this.config.get("alignment")?"topleft":"botright";if(o.length>0){const t=yield o[0].width;yield this.nvim.command(`silent ${i} vertical new`),yield this.nvim.command(`silent vertical resize ${t-e}`)}else yield this.nvim.command(`silent ${i} vertical new`)}else yield this.nvim.call("win_gotoid",s),e===r.HSplit?yield this.nvim.command("split"):e===r.VSplit&&(yield this.nvim.command("vsplit"))}})}viewHidden(e){const i=this.view2treemodel.get(e);void 0!==i&&i.hide()}dispose(){this.view2treeview.forEach(e=>e.dispose())}}exports.TreeViewsManager=s;
},{"./treeview":"dDyQ","./utils":"Iw8s","../commands":"eojW"}],"bAI2":[function(require,module,exports) {
"use strict";var e=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{d(o.next(e))}catch(t){r(t)}}function a(e){try{d(o.throw(e))}catch(t){r(t)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}d((o=o.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.TreeViewController=void 0;const t=require("coc.nvim"),n=require("./model"),o=require("./treeviews"),i=[{title:"Expand/Collapse tree node",action:"ToggleNode"},{title:"Force the reloading of the children of this node.",action:"ForceChildrenReload"},{title:"Go to parent node",action:"ParentNode"},{title:"Go to first child",action:"FirstSibling"},{title:"Go to last child",action:"LastSibling"},{title:"Go to prev sibling",action:"PrevSibling"},{title:"Go to next sibling",action:"NextSibling"},{title:"Execute command for node",action:"ExecuteCommand"},{title:"Execute command and open node under cursor in horizontal split",action:"ExecuteCommandAndOpenSplit"},{title:"Execute command and open node under cursor in vertical split",action:"ExecuteCommandAndOpenVSplit"},{title:"Execute command and open node under cursor in tab",action:"ExecuteCommandAndOpenTab"}];class r{constructor(r,s){this.treeViewsManager=s,this.treeModels=new Map,this.listeners=[],this.listeners.push(r.providerEvents()(e=>{const t=new n.TreeModel(e,!0);this.treeModels.set(e.viewId,t),s.addTreeModel(t)})),this.listeners.push(t.commands.registerCommand("metals.tvp",e=>{void 0===e?s.toggleAllTrees():s.toggleTreeView(e)}));const a=(e,n)=>{switch(e){case"ToggleNode":return s.toggleTreeViewNode();case"ForceChildrenReload":return s.forceChildrenReload();case"ParentNode":return s.gotoParentNode();case"FirstSibling":return s.gotoFirstNode();case"LastSibling":return s.gotoLastNode();case"PrevSibling":return s.gotoPrevSibling();case"NextSibling":return s.gotoNextSibling();case"ExecuteCommand":return s.executeCommand(o.WindowProp.Default);case"ExecuteCommandAndOpenSplit":return s.executeCommand(o.WindowProp.HSplit);case"ExecuteCommandAndOpenVSplit":return s.executeCommand(o.WindowProp.VSplit);case"ExecuteCommandAndOpenTab":return s.executeCommand(o.WindowProp.Tab);case"Hidden":return n&&s.viewHidden(n);default:t.workspace.showQuickpick(i.map(e=>e.title)).then(e=>{-1!==e&&a(i[e].action,void 0)})}};this.listeners.push(t.commands.registerCommand("metals.tvp.view",a)),this.listeners.push(t.commands.registerCommand("metals.revealInTreeView",n=>e(this,void 0,void 0,function*(){const{document:e,position:o}=yield t.workspace.getCurrentState();return this.treeViewsManager.revealDocInTreeView(n,e,o)})))}dispose(){this.treeModels.forEach(e=>e.dispose()),this.treeModels.clear(),this.listeners.forEach(e=>e.dispose())}}exports.TreeViewController=r;

@@ -29,3 +29,3 @@ },{"./model":"Vq4m","./treeviews":"GgEX"}],"Y104":[function(require,module,exports) {

},{}],"QCba":[function(require,module,exports) {
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[o]}})}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(o){if(o&&o.__esModule)return o;var r={};if(null!=o)for(var n in o)"default"!==n&&Object.prototype.hasOwnProperty.call(o,n)&&e(r,o,n);return t(r,o),r},r=this&&this.__awaiter||function(e,t,o,r){return new(o||(o=Promise))(function(n,a){function s(e){try{c(r.next(e))}catch(t){a(t)}}function i(e){try{c(r.throw(e))}catch(t){a(t)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(s,i)}c((r=r.apply(e,t||[])).next())})},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.activate=void 0;const a=require("coc.nvim"),s=require("metals-languageclient"),i=o(require("path")),c=require("vscode-languageserver-protocol"),u=require("./commands"),m=n(require("./decoration")),d=require("./embeddedDoctor"),l=require("./metalsProtocol"),p=require("./tvp/controller"),v=require("./tvp/feature"),g=require("./tvp/treeviews"),h=require("./utils"),w=require("./DebuggingFeature"),C=n(require("./WannaBeStatusBarItem"));function f(e){return r(this,void 0,void 0,function*(){const t=a.workspace.getConfiguration("metals");t.get("enable")&&(h.detectLaunchConfigurationChanges(),h.checkServerVersion(t),s.getJavaHome(t.get("javaHome")).then(o=>k(t,e,o),()=>{a.workspace.showQuickpick(["Open Settings","Ignore for now"],"Unable to find a Java 8 or Java 11 installation on this computer. To fix this problem, update the 'Java Home' setting to point to a Java 8 or Java 11 home directory").then(e=>{0===e&&a.workspace.nvim.command(u.Commands.OPEN_COC_CONFIG,!0)})}))})}function k(e,t,o){var r,n;const i=s.checkDottyIde(null===(r=a.workspace.workspaceFolder)||void 0===r?void 0:r.uri);if(i.enabled)return void a.workspace.showMessage("Metals will not start since Dotty is enabled for this workspace. "+`To enable Metals, remove the file ${i.path} and run ':CocCommand metals.restartServer'`,"warning");const c=e.get("serverVersion"),m=e.inspect("serverVersion").defaultValue,d=c||m,l=e.get("serverProperties"),p=e.get("customRepositories"),v=s.getJavaConfig({workspaceRoot:null===(n=a.workspace.workspaceFolder)||void 0===n?void 0:n.uri,javaHome:o,customRepositories:p,extensionPath:t.extensionPath}),g=s.fetchMetals({serverVersion:d,serverProperties:l,javaConfig:v}),w=e.get("statusBarEnabled"),f=w?a.workspace.createStatusBarItem(0,{progress:!0}):new C.default(0,!0,"Preparing Metals"),k=`Downloading Metals v${d}`;h.trackDownloadProgress(k,g,f).then(e=>{y(t,e,l,v,f,w)},()=>{const e=(()=>{const e="See https://scalameta.org/metals/docs/build-tools/proxy.html for instructions if you are using an HTTP proxy.";return d===m?"Failed to download Metals, make sure you have an internet connection and "+`the Java Home '${o}' is valid. You can configure the Java Home in the settings.`+e:"Failed to download Metals, make sure you have an internet connection, "+`the Metals version '${d}' is correct and the Java Home '${o}' is valid. `+"You can configure the Metals version and Java Home in the settings."+e})();a.workspace.showPrompt(`${e}\n Open Settings?`).then(e=>{e&&a.workspace.nvim.command(u.Commands.OPEN_COC_CONFIG,!0)})})}function y(e,t,o,n,u,C){return r(this,void 0,void 0,function*(){const f=s.getServerOptions({metalsClasspath:t,serverProperties:o,javaConfig:n}),k={compilerOptions:{completionCommand:"editor.action.triggerSuggest",overrideDefFormat:"unicode",parameterHintsCommand:"editor.action.triggerParameterHints"},debuggingProvider:a.workspace.isNvim&&1===(yield a.workspace.nvim.getVar("loaded_vimpector")),decorationProvider:a.workspace.isNvim,didFocusProvider:!0,doctorProvider:"json",executeClientCommandProvider:!0,inputBoxProvider:!0,quickPickProvider:!0,slowTaskProvider:!0,statusBarProvider:C?"on":"show-message",treeViewProvider:!0},y={documentSelector:[{scheme:"file",language:"scala"}],synchronize:{configurationSection:"metals"},revealOutputChannelOn:a.RevealOutputChannelOn.Never,initializationOptions:k},S=new a.LanguageClient("metals","Metals",f,y),b=new v.TreeViewFeature(S);if(S.registerFeature(b),y.initializationOptions.debuggingProvider){const e=new w.DebuggingFeature(a.workspace.nvim,S);S.registerFeature(e)}const P=new a.FloatFactory(a.workspace.nvim,a.workspace.env,!1,100,100,!0),q=new m.default(P),M=new g.TreeViewsManager(a.workspace.nvim,e.logger),R=new p.TreeViewController(b,M);function x(t,o){e.subscriptions.push(a.commands.registerCommand(t,o))}e.subscriptions.push(b,M,R),x("metals.restartServer",s.restartServer(S,a.workspace)),e.subscriptions.push(S.start()),S.onReady().then(t=>{if(u.isProgress=!1,u.text="Metals is Ready!",u.show(),[s.ServerCommands.AmmoniteStart,s.ServerCommands.AmmoniteStop,s.ServerCommands.BspSwitch,s.ServerCommands.BuildConnect,s.ServerCommands.BuildDisconnect,s.ServerCommands.BuildImport,s.ServerCommands.BuildRestart,s.ServerCommands.CancelCompilation,s.ServerCommands.CascadeCompile,s.ServerCommands.CleanCompile,s.ServerCommands.DoctorRun,s.ServerCommands.GenerateBspConfig,s.ServerCommands.NewScalaProject,s.ServerCommands.ResetChoice,s.ServerCommands.SourcesScan].forEach(e=>{x("metals."+e,()=>r(this,void 0,void 0,function*(){S.sendRequest(c.ExecuteCommandRequest.type,{command:e})}))}),x(`metals.${s.ServerCommands.AnalyzeStacktrace}`,()=>r(this,void 0,void 0,function*(){if(a.workspace.isVim)a.workspace.showMessage("Analyze stacktrace functionality isn't support in Vim. Please use Nvim if you'd like to use this.","warning");else{const e=yield a.workspace.nvim.call("getreg","*");e.trim().length<1?a.workspace.showMessage("No text found in your register. Copy your stacktrace to your register and retry.","warning"):S.sendRequest(c.ExecuteCommandRequest.type,{command:s.ServerCommands.AnalyzeStacktrace,arguments:[e]})}})),x("metals.logs-toggle",()=>{h.toggleLogs()}),a.workspace.isNvim&&e.subscriptions.push(a.workspace.registerKeymap(["n"],"metals-expand-decoration",()=>{q.showHover()},{sync:!1})),x(`metals.${s.ServerCommands.NewScalaFile}`,()=>r(this,void 0,void 0,function*(){const e=(yield a.workspace.document).uri,t=i.dirname(e);S.sendRequest(c.ExecuteCommandRequest.type,{command:s.ServerCommands.NewScalaFile,arguments:[t]})})),x("metals.quick-worksheet",()=>r(this,void 0,void 0,function*(){const e=(yield a.workspace.document).uri,t=i.dirname(e),o=i.basename(t);S.sendRequest(c.ExecuteCommandRequest.type,{command:s.ServerCommands.NewScalaFile,arguments:[t,o,"worksheet"]})})),x(`metals.${s.ServerCommands.CopyWorksheetOutput}`,()=>r(this,void 0,void 0,function*(){const e=(yield a.workspace.document).uri,t=yield S.sendRequest(c.ExecuteCommandRequest.type,{command:s.ServerCommands.CopyWorksheetOutput,arguments:[e]});t.value&&(a.workspace.nvim.call("setreg",["+",t.value]),a.workspace.showMessage("Copied worksheet to to your +register"))})),x(`metals.${s.ServerCommands.GotoSuperMethod}`,()=>r(this,void 0,void 0,function*(){const e=yield a.workspace.document,t=yield a.workspace.getCursorPosition();S.sendRequest(c.ExecuteCommandRequest.type,{command:s.ServerCommands.GotoSuperMethod,arguments:[{document:e.uri,position:t}]})})),x(`metals.${s.ServerCommands.SuperMethodHierarchy}`,()=>r(this,void 0,void 0,function*(){const e=yield a.workspace.document,t=yield a.workspace.getCursorPosition();S.sendRequest(c.ExecuteCommandRequest.type,{command:s.ServerCommands.SuperMethodHierarchy,arguments:[{document:e.uri,position:t}]})})),S.onNotification(s.ExecuteClientCommand.type,e=>r(this,void 0,void 0,function*(){switch(e.command){case s.ClientCommands.GotoLocation:const t=e.arguments&&e.arguments[0];t&&(yield M.prepareWindowForGoto(),yield h.wait(10),yield a.workspace.jumpTo(t.uri,t.range.start));break;case s.ClientCommands.RunDoctor:const o=e.arguments&&e.arguments[0];d.makeVimDoctor(JSON.parse(o));break;case s.ClientCommands.ReloadDoctor:a.workspace.nvim.call("coc#util#has_preview").then(t=>{if(t>0){const t=e.arguments&&e.arguments[0];d.makeVimDoctor(JSON.parse(t))}});break;case s.ClientCommands.FocusDiagnostics:a.workspace.nvim.command("CocList diagnostics");break;case s.ClientCommands.ToggleLogs:h.toggleLogs();break;case s.ClientCommands.RefreshModel:a.events.fire("BufEnter",[a.workspace.bufnr]);break;default:a.workspace.showMessage(`Recieved unknown command: ${e.command}`)}})),a.events.on("BufWinEnter",e=>{const t=a.workspace.documents.find(t=>t.bufnr===e);t&&"scala"===t.filetype&&S.sendNotification(s.MetalsDidFocus.type,t.uri)}),S.onRequest(s.MetalsInputBox.type,e=>a.workspace.callAsync("input",[`${e.prompt}: `,e.value?e.value:""]).then(s.MetalsInputBox.handleInput)),S.onRequest(s.MetalsQuickPick.type,(e,t)=>a.workspace.showQuickpick(e.items.map(e=>e.label),e.placeHolder).then(t=>-1===t?{cancelled:!0}:{itemId:e.items[t].id})),C){const e=a.workspace.createStatusBarItem(0);S.onNotification(s.MetalsStatus.type,t=>{t.show?e.text=t.text:t.hide&&(e.text="Metals"),e.show()})}a.workspace.isNvim&&(S.onNotification(l.DecorationsRangesDidChange.type,e=>{a.workspace.uri&&a.workspace.uri===e.uri&&q.setDecorations(e)}),a.events.on("BufWinLeave",e=>{const t=a.workspace.documents.find(t=>t.bufnr===e);t&&t.uri.endsWith(".worksheet.sc")&&q.clearDecorations(e)}))})})}exports.activate=f;
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[o]}})}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(o){if(o&&o.__esModule)return o;var r={};if(null!=o)for(var n in o)"default"!==n&&Object.prototype.hasOwnProperty.call(o,n)&&e(r,o,n);return t(r,o),r},r=this&&this.__awaiter||function(e,t,o,r){return new(o||(o=Promise))(function(n,a){function s(e){try{c(r.next(e))}catch(t){a(t)}}function i(e){try{c(r.throw(e))}catch(t){a(t)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(s,i)}c((r=r.apply(e,t||[])).next())})},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.activate=void 0;const a=require("coc.nvim"),s=require("metals-languageclient"),i=o(require("path")),c=require("vscode-languageserver-protocol"),m=require("./commands"),u=n(require("./decoration")),d=require("./embeddedDoctor"),l=require("./metalsProtocol"),p=require("./tvp/controller"),v=require("./tvp/feature"),g=require("./tvp/treeviews"),h=require("./utils"),w=require("./DebuggingFeature"),C=n(require("./WannaBeStatusBarItem"));function f(e){return r(this,void 0,void 0,function*(){const t=a.workspace.getConfiguration("metals");t.get("enable")&&(h.detectLaunchConfigurationChanges(),h.checkServerVersion(t),s.getJavaHome(t.get("javaHome")).then(o=>k(t,e,o),()=>{a.workspace.showQuickpick(["Open Settings","Ignore for now"],"Unable to find a Java 8 or Java 11 installation on this computer. To fix this problem, update the 'metals.javaHome' setting to point to a Java 8 or Java 11 home directory").then(e=>{0===e&&a.workspace.nvim.command(m.Commands.OPEN_COC_CONFIG,!0)})}))})}function k(e,t,o){var r,n;const i=s.checkDottyIde(null===(r=a.workspace.workspaceFolder)||void 0===r?void 0:r.uri);if(i.enabled)return void a.workspace.showMessage("Metals will not start since Dotty is enabled for this workspace. "+`To enable Metals, remove the file ${i.path} and run ':CocCommand metals.restartServer'`,"warning");const c=e.get("serverVersion"),u=e.inspect("serverVersion").defaultValue,d=c||u,l=e.get("serverProperties"),p=e.get("customRepositories"),v=s.getJavaConfig({workspaceRoot:null===(n=a.workspace.workspaceFolder)||void 0===n?void 0:n.uri,javaHome:o,customRepositories:p,extensionPath:t.extensionPath}),g=s.fetchMetals({serverVersion:d,serverProperties:l,javaConfig:v}),w=e.get("statusBarEnabled"),f=w?a.workspace.createStatusBarItem(0,{progress:!0}):new C.default(0,!0,"Preparing Metals"),k=`Downloading Metals v${d}`;h.trackDownloadProgress(k,g,f).then(e=>{y(t,e,l,v,f,w)},()=>{const e=(()=>{const e="See https://scalameta.org/metals/docs/build-tools/proxy.html for instructions if you are using an HTTP proxy.";return d===u?"Failed to download Metals, make sure you have an internet connection and "+`the Java Home '${o}' is valid. You can configure the Java Home in the settings.`+e:"Failed to download Metals, make sure you have an internet connection, "+`the Metals version '${d}' is correct and the Java Home '${o}' is valid. `+"You can configure the Metals version and Java Home in the settings."+e})();a.workspace.showPrompt(`${e}\n Open Settings?`).then(e=>{e&&a.workspace.nvim.command(m.Commands.OPEN_COC_CONFIG,!0)})})}function y(e,t,o,n,C,f){return r(this,void 0,void 0,function*(){const k=s.getServerOptions({metalsClasspath:t,serverProperties:o,javaConfig:n}),y={compilerOptions:{completionCommand:"editor.action.triggerSuggest",overrideDefFormat:"unicode",parameterHintsCommand:"editor.action.triggerParameterHints"},debuggingProvider:a.workspace.isNvim&&1===(yield a.workspace.nvim.getVar("loaded_vimpector")),decorationProvider:a.workspace.isNvim,didFocusProvider:!0,doctorProvider:"json",executeClientCommandProvider:!0,inputBoxProvider:!0,quickPickProvider:!0,slowTaskProvider:!0,statusBarProvider:f?"on":"show-message",treeViewProvider:!0},S={documentSelector:[{scheme:"file",language:"scala"}],synchronize:{configurationSection:"metals"},revealOutputChannelOn:a.RevealOutputChannelOn.Never,initializationOptions:y},P=new a.LanguageClient("metals","Metals",k,S),b=new v.TreeViewFeature(P);if(P.registerFeature(b),S.initializationOptions.debuggingProvider){const e=new w.DebuggingFeature(a.workspace.nvim,P);P.registerFeature(e)}const q=new a.FloatFactory(a.workspace.nvim,a.workspace.env,!1,100,100,!0),M=new u.default(q),R=new g.TreeViewsManager(a.workspace.nvim,e.logger),x=new p.TreeViewController(b,R);function O(t,o){e.subscriptions.push(a.commands.registerCommand(t,o))}e.subscriptions.push(b,R,x),O("metals.restartServer",s.restartServer(P,a.workspace)),e.subscriptions.push(P.start()),P.onReady().then(t=>{if(C.isProgress=!1,C.text="Metals is Ready!",C.show(),[s.ServerCommands.AmmoniteStart,s.ServerCommands.AmmoniteStop,s.ServerCommands.BspSwitch,s.ServerCommands.BuildConnect,s.ServerCommands.BuildDisconnect,s.ServerCommands.BuildImport,s.ServerCommands.BuildRestart,s.ServerCommands.CancelCompilation,s.ServerCommands.CascadeCompile,s.ServerCommands.CleanCompile,s.ServerCommands.DoctorRun,s.ServerCommands.GenerateBspConfig,s.ServerCommands.NewScalaProject,s.ServerCommands.ResetChoice,s.ServerCommands.SourcesScan].forEach(e=>{O("metals."+e,()=>r(this,void 0,void 0,function*(){P.sendRequest(c.ExecuteCommandRequest.type,{command:e})}))}),O(`metals.${s.ServerCommands.AnalyzeStacktrace}`,()=>r(this,void 0,void 0,function*(){if(a.workspace.isVim)a.workspace.showMessage("Analyze stacktrace functionality isn't support in Vim. Please use Nvim if you'd like to use this.","warning");else{const e=yield a.workspace.nvim.call("getreg","*");e.trim().length<1?a.workspace.showMessage("No text found in your register. Copy your stacktrace to your register and retry.","warning"):P.sendRequest(c.ExecuteCommandRequest.type,{command:s.ServerCommands.AnalyzeStacktrace,arguments:[e]})}})),O("metals.logs-toggle",()=>{h.toggleLogs()}),a.workspace.isNvim&&e.subscriptions.push(a.workspace.registerKeymap(["n"],"metals-expand-decoration",()=>{M.showHover()},{sync:!1})),O(`metals.${s.ServerCommands.NewScalaFile}`,()=>r(this,void 0,void 0,function*(){const e=(yield a.workspace.document).uri,t=i.dirname(e);P.sendRequest(c.ExecuteCommandRequest.type,{command:s.ServerCommands.NewScalaFile,arguments:[t]})})),O("metals.quick-worksheet",()=>r(this,void 0,void 0,function*(){const e=(yield a.workspace.document).uri,t=i.dirname(e),o=i.basename(t);P.sendRequest(c.ExecuteCommandRequest.type,{command:s.ServerCommands.NewScalaFile,arguments:[t,o,"worksheet"]})})),O(`metals.${s.ServerCommands.CopyWorksheetOutput}`,()=>r(this,void 0,void 0,function*(){const e=(yield a.workspace.document).uri,t=yield P.sendRequest(c.ExecuteCommandRequest.type,{command:s.ServerCommands.CopyWorksheetOutput,arguments:[e]});t.value&&(a.workspace.nvim.call("setreg",["+",t.value]),a.workspace.showMessage("Copied worksheet to to your +register"))})),O(`metals.${s.ServerCommands.GotoSuperMethod}`,()=>r(this,void 0,void 0,function*(){const e=yield a.workspace.document,t=yield a.workspace.getCursorPosition();P.sendRequest(c.ExecuteCommandRequest.type,{command:s.ServerCommands.GotoSuperMethod,arguments:[{document:e.uri,position:t}]})})),O(`metals.${s.ServerCommands.SuperMethodHierarchy}`,()=>r(this,void 0,void 0,function*(){const e=yield a.workspace.document,t=yield a.workspace.getCursorPosition();P.sendRequest(c.ExecuteCommandRequest.type,{command:s.ServerCommands.SuperMethodHierarchy,arguments:[{document:e.uri,position:t}]})})),P.onNotification(s.ExecuteClientCommand.type,e=>r(this,void 0,void 0,function*(){switch(e.command){case s.ClientCommands.GotoLocation:const t=e.arguments&&e.arguments[0];t&&(yield R.prepareWindowForGoto(),yield h.wait(10),yield a.workspace.jumpTo(t.uri,t.range.start));break;case s.ClientCommands.RunDoctor:const o=e.arguments&&e.arguments[0];d.makeVimDoctor(JSON.parse(o));break;case s.ClientCommands.ReloadDoctor:a.workspace.nvim.call(m.Commands.HAS_PREVIEW).then(t=>{if(t>0){const t=e.arguments&&e.arguments[0];d.makeVimDoctor(JSON.parse(t))}});break;case s.ClientCommands.FocusDiagnostics:a.workspace.nvim.command("CocList diagnostics");break;case s.ClientCommands.ToggleLogs:h.toggleLogs();break;case s.ClientCommands.RefreshModel:a.events.fire("BufEnter",[a.workspace.bufnr]);break;default:a.workspace.showMessage(`Recieved unknown command: ${e.command}`)}})),a.events.on("BufWinEnter",e=>{const t=a.workspace.documents.find(t=>t.bufnr===e);t&&"scala"===t.filetype&&P.sendNotification(s.MetalsDidFocus.type,t.uri)}),P.onRequest(s.MetalsInputBox.type,e=>a.workspace.callAsync("input",[`${e.prompt}: `,e.value?e.value:""]).then(s.MetalsInputBox.handleInput)),P.onRequest(s.MetalsQuickPick.type,(e,t)=>a.workspace.showQuickpick(e.items.map(e=>e.label),e.placeHolder).then(t=>-1===t?{cancelled:!0}:{itemId:e.items[t].id})),f){const e=a.workspace.createStatusBarItem(0);P.onNotification(s.MetalsStatus.type,t=>{t.show?e.text=t.text:t.hide&&(e.text="Metals"),e.show()})}a.workspace.isNvim&&(P.onNotification(l.DecorationsRangesDidChange.type,e=>{a.workspace.uri&&a.workspace.uri===e.uri&&M.setDecorations(e)}),a.events.on("BufWinLeave",e=>{const t=a.workspace.documents.find(t=>t.bufnr===e);t&&t.uri.endsWith(".worksheet.sc")&&M.clearDecorations(e)}))})})}exports.activate=f;
},{"./commands":"eojW","./decoration":"p29A","./embeddedDoctor":"BTOZ","./metalsProtocol":"z7J4","./tvp/controller":"bAI2","./tvp/feature":"Y104","./tvp/treeviews":"GgEX","./utils":"UnXq","./DebuggingFeature":"OSfr","./WannaBeStatusBarItem":"n7Rg"}]},{},["QCba"], null)
{
"name": "coc-metals",
"version": "1.0.7",
"version": "1.0.8",
"description": "coc.nvim extension for Metals, the Scala language server",

@@ -24,2 +24,6 @@ "keywords": [

"url": "https://github.com/gabro"
},
{
"name": "Jesse Atkinson",
"url": "https://github.com/jsatk"
}

@@ -77,3 +81,3 @@ ],

"type": "string",
"default": "0.10.5",
"default": "0.10.6",
"markdownDescription": "The version of the Metals server artifact. Requires reloading the window.\n\n**Change only if you know what you're doing**"

@@ -80,0 +84,0 @@ },

@@ -24,3 +24,3 @@ /**

*/
export const HAS_PREVIEW = "coc#util#has_preview";
export const HAS_PREVIEW = "coc#list#has_preview";
/**

@@ -30,2 +30,6 @@ * Shows Coc Info and logs

export const OPEN_LOGS = "CocCommand workspace.showOutput";
/**
* Move the cursor to the specified position
*/
export const MOVE_TO = "coc#cursor#move_to";
}

@@ -68,3 +68,3 @@ import {

"Unable to find a Java 8 or Java 11 installation on this computer. " +
"To fix this problem, update the 'Java Home' setting to point to a Java 8 or Java 11 home directory";
"To fix this problem, update the 'metals.javaHome' setting to point to a Java 8 or Java 11 home directory";
const openSettings = "Open Settings";

@@ -412,3 +412,3 @@ const ignore = "Ignore for now";

case ClientCommands.ReloadDoctor:
workspace.nvim.call("coc#util#has_preview").then((preview) => {
workspace.nvim.call(Commands.HAS_PREVIEW).then((preview) => {
if (preview > 0) {

@@ -415,0 +415,0 @@ const doctorJson: string =

@@ -26,5 +26,6 @@ import {

RPCMessageType,
TextDocument,
TextDocumentPositionParams,
} from "vscode-languageserver-protocol";
import { TextDocument } from "vscode-languageserver-textdocument";
import { TreeViewProvider } from "./provider";

@@ -31,0 +32,0 @@

import { MetalsTreeViewNode } from "metals-languageclient";
import { Disposable, Emitter } from "vscode-jsonrpc";
import { Position, TextDocument } from "vscode-languageserver-types";
import { Position } from "vscode-languageserver-types";
import { TextDocument } from "vscode-languageserver-textdocument";
import { TreeViewProvider } from "./provider";

@@ -5,0 +6,0 @@ import { groupBy } from "./utils";

@@ -6,3 +6,4 @@ import {

import { Event } from "vscode-jsonrpc";
import { Position, TextDocument } from "vscode-languageserver-protocol";
import { Position } from "vscode-languageserver-protocol";
import { TextDocument } from "vscode-languageserver-textdocument";

@@ -9,0 +10,0 @@ export interface TreeViewProvider {

@@ -9,5 +9,7 @@ import { Buffer, Neovim, Window } from "@chemzqm/neovim";

import * as log4js from "log4js";
import { Position, TextDocument } from "vscode-languageserver-types";
import { Position } from "vscode-languageserver-types";
import { TextDocument } from "vscode-languageserver-textdocument";
import { Node, NodeView, TreeModel, TreeModelUpdate } from "./model";
import { sequence } from "./utils";
import { Commands } from "../commands";

@@ -125,3 +127,3 @@ export interface TreeViewDescription {

);
await this.nvim.call("coc#util#jumpTo", [0, 1]);
await this.nvim.call(Commands.MOVE_TO, [0, 1]);
}

@@ -308,3 +310,3 @@ }

if (offset === undefined) return;
await this.nvim.call("coc#util#jumpTo", [offset - 1, 1]);
await this.nvim.call(Commands.MOVE_TO, [offset - 1, 1]);
}

@@ -322,3 +324,3 @@

if (offset === undefined) return;
await this.nvim.call("coc#util#jumpTo", [offset - 1, 1]);
await this.nvim.call(Commands.MOVE_TO, [offset - 1, 1]);
}

@@ -347,3 +349,3 @@ }

if (offset === undefined) return;
await this.nvim.call("coc#util#jumpTo", [offset - 1, 1]);
await this.nvim.call(Commands.MOVE_TO, [offset - 1, 1]);
}

@@ -350,0 +352,0 @@

import { NeovimClient as Neovim, Tabpage, Window } from "@chemzqm/neovim";
import { Disposable, workspace, WorkspaceConfiguration } from "coc.nvim";
import * as log4js from "log4js";
import { Position, TextDocument } from "vscode-languageserver-types";
import { Position } from "vscode-languageserver-types";
import { TextDocument } from "vscode-languageserver-textdocument";
import { TreeModel } from "./model";
import { TreeView, TreeViewDescription } from "./treeview";
import { sequence } from "./utils";
import { Commands } from "../commands";

@@ -182,3 +184,3 @@ interface WindowWithTree {

if (mbTreeView !== undefined) {
await this.nvim.call("coc#util#jumpTo", [0, 1]);
await this.nvim.call(Commands.MOVE_TO, [0, 1]);
} else if (model !== undefined) {

@@ -185,0 +187,0 @@ const buffer = await this.nvim.buffer;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc