1
0
mirror of https://github.com/salexdv/bsl_console.git synced 2024-11-28 08:48:48 +02:00

Исправление выделения параметра метода #184

This commit is contained in:
salexdv 2022-08-03 09:03:03 +03:00
parent 25117a57f1
commit 03dce0c7d2

View File

@ -2024,7 +2024,7 @@ define(n[581],i([0,1,6,52,50,53,4,2,71,117,165,461,18,51,20,14,540,5,318]),(func
this._register(this.editor.onDidLayoutChange((function(t){return e.updateMaxHeight()}))),this.updateMaxHeight()},t.prototype.show=function(){var e=this;this.visible||(this.domNodes||this.createParamaterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout((function(){e.domNodes&&n.addClass(e.domNodes.element,"visible")}),100),this.editor.layoutContentWidget(this))},t.prototype.hide=function(){this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes&&n.removeClass(this.domNodes.element,"visible"),this.editor.layoutContentWidget(this))},t.prototype.getPosition=function(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null},t.prototype.render=function(e){if(this.domNodes){var t=e.signatures.length>1;n.toggleClass(this.domNodes.element,"multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerHTML="",this.domNodes.docs.innerHTML="";var i=e.signatures[e.activeSignature];if(i){
var r=n.append(this.domNodes.signature,b(".code")),s=i.parameters.length>0,a=this.editor.getOption(34);if(r.style.fontSize=a.fontSize+"px",r.style.fontFamily=a.fontFamily,s)this.renderParameters(r,i,e.activeParameter);else n.append(r,b("span")).textContent=i.label;this.renderDisposeables.clear();var l=i.parameters[e.activeParameter];if(l&&l.documentation){var u=b("span.documentation");if("string"==typeof l.documentation)u.textContent=l.documentation;else{var d=this.markdownRenderer.render(l.documentation);n.addClass(d.element,"markdown-docs"),this.renderDisposeables.add(d),u.appendChild(d.element)}n.append(this.domNodes.docs,b("p",{},u))}if(void 0===i.documentation);else if("string"==typeof i.documentation)n.append(this.domNodes.docs,b("p",{},i.documentation));else{d=this.markdownRenderer.render(i.documentation);n.addClass(d.element,"markdown-docs"),this.renderDisposeables.add(d),n.append(this.domNodes.docs,d.element)}var c=this.hasDocs(i,l);if(n.toggleClass(this.domNodes.signature,"has-docs",c),
n.toggleClass(this.domNodes.docs,"empty",!c),this.domNodes.overloads.textContent=C.pad(e.activeSignature+1,e.signatures.length.toString().length)+"/"+e.signatures.length,l){var h=this.getParameterLabel(i,e.activeParameter);this.announcedLabel!==h&&(o.alert(p.localize(0,null,h)),this.announcedLabel=h)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}}},t.prototype.hasDocs=function(e,t){return!!(t&&"string"==typeof t.documentation&&t.documentation.length>0)||(!!(t&&"object"==typeof t.documentation&&t.documentation.value.length>0)||("string"==typeof e.documentation&&e.documentation.length>0||"object"==typeof e.documentation&&e.documentation.value.length>0))},t.prototype.renderParameters=function(e,t,i){var o=this.getParameterLabelOffsets(t,i),r=o[0],s=o[1],a=document.createElement("span");a.textContent=t.label.substring(0,r);var l=document.createElement("span");l.textContent=t.label.substring(r,s),l.className="parameter active";var u=document.createElement("span")
;u.textContent=t.label.substring(s),n.append(e,a,l,u)},t.prototype.getParameterLabel=function(e,t){var n=e.parameters[t];return"string"==typeof n.label?n.label:e.label.substring(n.label[0],n.label[1])},t.prototype.getParameterLabelOffsets=function(e,t){var n=e.parameters[t];if(n){if(Array.isArray(n.label))return n.label;if(n.label.length){const I=new RegExp(`(\\W|^)${C.escapeRegExpCharacters(n.label)}(?=\\W|$)`,"g");I.test(e.label);const T=I.lastIndex-n.label.length;return T>=0?[T,I.lastIndex]:[0,0]}else return[0,0]}else return[0,0]},t.prototype.next=function(){this.editor.focus(),this.model.next()},t.prototype.previous=function(){this.editor.focus(),this.model.previous()},t.prototype.cancel=function(){this.model.cancel()},t.prototype.getDomNode=function(){return this.domNodes||this.createParamaterHintDOMNodes(),this.domNodes.element},t.prototype.getId=function(){return t.ID},t.prototype.trigger=function(e){this.model.trigger(e,0)},t.prototype.updateMaxHeight=function(){if(this.domNodes){var e=Math.max(this.editor.getLayoutInfo().height/4,250)+"px";this.domNodes.element.style.maxHeight=e
;u.textContent=t.label.substring(s),n.append(e,a,l,u)},t.prototype.getParameterLabel=function(e,t){var n=e.parameters[t];return"string"==typeof n.label?n.label:e.label.substring(n.label[0],n.label[1])},t.prototype.getParameterLabelOffsets=function(e,t){var n=e.parameters[t];if(n){if(Array.isArray(n.label))return n.label;if(n.label.length){const I=new RegExp(`([^\\p{L}\\p{N}_]|^)${C.escapeRegExpCharacters(n.label)}(?=[^\\p{L}\\p{N}_]|$)`,"gu");I.test(e.label);const T=I.lastIndex-n.label.length;return T>=0?[T,I.lastIndex]:[0,0]}else return[0,0]}else return[0,0]},t.prototype.next=function(){this.editor.focus(),this.model.next()},t.prototype.previous=function(){this.editor.focus(),this.model.previous()},t.prototype.cancel=function(){this.model.cancel()},t.prototype.getDomNode=function(){return this.domNodes||this.createParamaterHintDOMNodes(),this.domNodes.element},t.prototype.getId=function(){return t.ID},t.prototype.trigger=function(e){this.model.trigger(e,0)},t.prototype.updateMaxHeight=function(){if(this.domNodes){var e=Math.max(this.editor.getLayoutInfo().height/4,250)+"px";this.domNodes.element.style.maxHeight=e
;var t=this.domNodes.element.getElementsByClassName("wrapper");t.length&&(t[0].style.maxHeight=e)}},t.ID="editor.widget.parameterHintsWidget",t=h([g(1,f.IContextKeyService),g(2,m.IOpenerService),g(3,u.IModeService)],t)}(l.Disposable);t.ParameterHintsWidget=S,_.registerThemingParticipant((function(e,t){var n=e.getColor(v.editorHoverBorder);if(n){var i=e.type===_.HIGH_CONTRAST?2:1;t.addRule(".monaco-editor .parameter-hints-widget { border: "+i+"px solid "+n+"; }"),t.addRule(".monaco-editor .parameter-hints-widget.multiple .body { border-left: 1px solid "+n.transparent(.5)+"; }"),t.addRule(".monaco-editor .parameter-hints-widget .signature.has-docs { border-bottom: 1px solid "+n.transparent(.5)+"; }")}var o=e.getColor(v.editorHoverBackground);o&&t.addRule(".monaco-editor .parameter-hints-widget { background-color: "+o+"; }");var r=e.getColor(v.textLinkForeground);r&&t.addRule(".monaco-editor .parameter-hints-widget a { color: "+r+"; }");var s=e.getColor(v.editorHoverForeground)
;s&&t.addRule(".monaco-editor .parameter-hints-widget { color: "+s+"; }");var a=e.getColor(v.textCodeBlockBackground);a&&t.addRule(".monaco-editor .parameter-hints-widget code { background-color: "+a+"; }")}))})),define(n[582],i([0,1,460,2,11,23,18,12,581,165,17]),(function(e,t,n,i,o,s,a,l,u,d,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var p=function(e){function t(t,n){var i=e.call(this)||this;return i.editor=t,i.widget=i._register(n.createInstance(u.ParameterHintsWidget,i.editor)),i}return r(t,e),t.get=function(e){return e.getContribution(t.ID)},t.prototype.cancel=function(){this.widget.cancel()},t.prototype.previous=function(){this.widget.previous()},t.prototype.next=function(){this.widget.next()},t.prototype.trigger=function(e){this.widget.trigger(e)},t.ID="editor.controller.parameterHints",t=h([g(1,o.IInstantiationService)],t)}(i.Disposable),f=function(e){function t(){return e.call(this,{id:"editor.action.triggerParameterHints",label:n.localize(0,null),
alias:"Trigger Parameter Hints",precondition:s.EditorContextKeys.hasSignatureHelpProvider,kbOpts:{kbExpr:s.EditorContextKeys.editorTextFocus,primary:3082,weight:100}})||this}return r(t,e),t.prototype.run=function(e,t){var n=p.get(t);n&&n.trigger({triggerKind:c.SignatureHelpTriggerKind.Invoke})},t}(l.EditorAction);t.TriggerParameterHintsAction=f,l.registerEditorContribution(p.ID,p),l.registerEditorAction(f);var m=l.EditorCommand.bindToContribution(p.get);l.registerEditorCommand(new m({id:"closeParameterHints",precondition:d.Context.Visible,handler:function(e){return e.cancel()},kbOpts:{weight:175,kbExpr:s.EditorContextKeys.focus,primary:9,secondary:[1033]}})),l.registerEditorCommand(new m({id:"showPrevParameterHint",precondition:a.ContextKeyExpr.and(d.Context.Visible,d.Context.MultipleSignatures),handler:function(e){return e.previous()},kbOpts:{weight:175,kbExpr:s.EditorContextKeys.focus,primary:16,secondary:[2064],mac:{primary:16,secondary:[528,302]}}})),l.registerEditorCommand(new m({