@opensumi/cli-engine 3.9.1-next-1747917815.0 → 3.9.1-next-1747982269.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.
@@ -31950,7 +31950,7 @@ ${c}`)}return this.keybindingsChanged.fire({affectsCommands:[E.command]}),{dispo
31950
31950
  `?h.DefaultEndOfLine.CRLF:h.DefaultEndOfLine.LF,{textBuffer:P,disposable:O}=(0,u.createTextBuffer)(T,R),x=n._computeEdits(this.monacoModel,P);this.monacoModel.pushEditOperations([],x,()=>[]),I&&(this.setPersist(this.monacoModel.getAlternativeVersionId()),this.baseContent=T,this.dirtyChanges=[]),O.dispose()}static _computeEdits(T,w){const I=T.getLineCount(),R=w.getLineCount(),P=this._commonPrefix(T,I,1,w,R,1);if(I===R&&P===I)return[];const O=this._commonSuffix(T,I-P,P,w,R-P,P);let x,k;return O>0?(x=new l.Range(P+1,1,I-O+1,1),k=new l.Range(P+1,1,R-O+1,1)):P>0?(x=new l.Range(P,T.getLineMaxColumn(P),I,T.getLineMaxColumn(I)),k=new l.Range(P,1+w.getLineLength(P),R,1+w.getLineLength(R))):(x=new l.Range(1,1,I,T.getLineMaxColumn(I)),k=new l.Range(1,1,R,1+w.getLineLength(R))),[g.EditOperation.replaceMove(x,w.getValueInRange(k,h.EndOfLinePreference.TextDefined))]}static _commonPrefix(T,w,I,R,P,O){const x=Math.min(w,P);let k=0;for(let F=0;F<x&&T.getLineContent(I+F)===R.getLineContent(O+F);F++)k++;return k}static _commonSuffix(T,w,I,R,P,O){const x=Math.min(w,P);let k=0;for(let F=0;F<x&&T.getLineContent(I+w-F)===R.getLineContent(O+P-F);F++)k++;return k}set baseContent(T){this._baseContent=T,this._baseContentMd5=null}get baseContent(){return this._baseContent}get baseContentMd5(){return this._baseContentMd5||(this._baseContentMd5=this.hashCalculateService.calculate(this._baseContent)),this._baseContentMd5}get tryAutoSaveAfterDelay(){return this._tryAutoSaveAfterDelay||(this._tryAutoSaveAfterDelay=(0,o.default)(()=>{this.save(void 0,d.SaveReason.AfterDelay)},this.editorPreferences["editor.autoSaveDelay"]||1e3),this.addDispose(this.editorPreferences.onPreferenceChanged(T=>{T.preferenceName==="editor.autoSaveDelay"&&(this._tryAutoSaveAfterDelay=(0,o.default)(()=>{this.save(void 0,d.SaveReason.AfterDelay)},this.editorPreferences["editor.autoSaveDelay"]||1e3))}))),this._tryAutoSaveAfterDelay}getBaseContentMd5(){return this._baseContentMd5||(this._baseContentMd5=this.hashCalculateService.calculate(this._baseContent)),this._baseContentMd5}notifyChangeEvent(T=[],w,I){!this.closeAutoSave&&this.savable&&this.editorPreferences["editor.autoSave"]===E.AUTO_SAVE_MODE.AFTER_DELAY&&this.tryAutoSaveAfterDelay(),this.eventBus.fire(new A.EditorDocumentModelContentChangedEvent({uri:this.uri,dirty:this.dirty,readonly:this.readonly,changes:T,eol:this.eol,isRedoing:w,isUndoing:I,versionId:this.monacoModel.getVersionId()}));const R=this;this.cacheProvider.persistCache(this.uri,{get dirty(){return R.dirty},get startMD5(){return R.getBaseContentMd5()},get content(){return R.getText()},get changeMatrix(){return R.dirtyChanges.map(({changes:P})=>P)},encoding:this.encoding})}async formatOnSave(T){if(this.editorPreferences["editor.formatOnSave"]&&T!==d.SaveReason.AfterDelay){const I=this.editorPreferences["editor.formatOnSaveTimeout"]||3e3,R=this.reporter.time(p.REPORT_NAME.FORMAT_ON_SAVE);try{await Promise.race([new Promise((P,O)=>{setTimeout(()=>{const x=new Error((0,p.formatLocalize)("preference.editor.formatOnSaveTimeoutError",I));x.name="FormatOnSaveTimeoutError",O(x)},I)}),this.commandService.executeCommand(p.EDITOR_COMMANDS.FORMAT_DOCUMENT.id)])}catch(P){P.name==="FormatOnSaveTimeoutError"&&this.reporter.point(p.REPORT_NAME.FORMAT_ON_SAVE_TIMEOUT_ERROR,this.uri.toString()),this.logger.warn(`${y.EditorDocumentError.FORMAT_ERROR} ${P&&P.message}`)}finally{R.timeEnd(this.uri.path.ext)}}}};t.EditorDocumentModel=S,r.__decorate([(0,a.Autowired)(A.IEditorDocumentModelContentRegistry),r.__metadata("design:type",Object)],S.prototype,"contentRegistry",void 0),r.__decorate([(0,a.Autowired)(A.IEditorDocumentModelService),r.__metadata("design:type",Object)],S.prototype,"service",void 0),r.__decorate([(0,a.Autowired)(c.ICompareService),r.__metadata("design:type",Object)],S.prototype,"compareService",void 0),r.__decorate([(0,a.Autowired)(d.IDocPersistentCacheProvider),r.__metadata("design:type",Object)],S.prototype,"cacheProvider",void 0),r.__decorate([(0,a.Autowired)(s.IMessageService),r.__metadata("design:type",Object)],S.prototype,"messageService",void 0),r.__decorate([(0,a.Autowired)(p.IEventBus),r.__metadata("design:type",Object)],S.prototype,"eventBus",void 0),r.__decorate([(0,a.Autowired)(p.ILogger),r.__metadata("design:type",Object)],S.prototype,"logger",void 0),r.__decorate([(0,a.Autowired)(p.CommandService),r.__metadata("design:type",Object)],S.prototype,"commandService",void 0),r.__decorate([(0,a.Autowired)(p.IReporterService),r.__metadata("design:type",Object)],S.prototype,"reporter",void 0),r.__decorate([(0,a.Autowired)(p.PreferenceService),r.__metadata("design:type",Object)],S.prototype,"preferences",void 0),r.__decorate([(0,a.Autowired)(v.IHashCalculateService),r.__metadata("design:type",Object)],S.prototype,"hashCalculateService",void 0),t.EditorDocumentModel=S=n=r.__decorate([(0,a.Injectable)({multiple:!0}),r.__metadata("design:paramtypes",[p.URI,String,Object])],S)},78157:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorDocumentModelContentRegistryImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(96689);let p=class{constructor(){this.providers=[],this._onOriginalDocChanged=new o.Emitter,this.cachedProviders=new o.LRUMap(1e3,500),this.originalProvider={handlesScheme:m=>m===a.ORIGINAL_DOC_SCHEME,provideEditorDocumentModelContent:async m=>{const{target:_}=m.getParsedQuery(),s=new o.URI(_);return await this.getContentForUri(s)||""},isReadonly:()=>!0,onDidChangeContent:this._onOriginalDocChanged.event},this.registerEditorDocumentModelContentProvider(this.originalProvider)}registerEditorDocumentModelContentProvider(m){this.providers.push(m),this.cachedProviders.clear();const _=m.onDidChangeContent(s=>{this.eventBus.fire(new a.EditorDocumentModelOptionExternalUpdatedEvent(s))});return m!==this.originalProvider&&m.onDidChangeContent&&m.onDidChangeContent(s=>{this._onOriginalDocChanged.fire(o.URI.from({scheme:a.ORIGINAL_DOC_SCHEME,query:o.URI.stringifyQuery({target:s.toString()})}))}),{dispose:()=>{_.dispose();const s=this.providers.indexOf(m);s&&(this.providers.splice(s,1),this.cachedProviders.clear())}}}getProvider(m){const _=m.toString();return this.cachedProviders.has(_)||this.cachedProviders.set(_,this.calculateProvider(m)),this.cachedProviders.get(_)}async calculateProvider(m){let _={provider:void 0,weight:-1,index:1};for(const s of this.providers){let g=-1;const l=this.providers.indexOf(s);s.handlesUri?g=await s.handlesUri(m):s.handlesScheme&&(g=await s.handlesScheme(m.scheme)?10:-1),g>=0&&(g>_.weight||g===_.weight&&l>_.index)&&(_={index:l,weight:g,provider:s})}return _.provider}async getContentForUri(m,_){const s=await this.getProvider(m);if(!s)throw new Error;return s.provideEditorDocumentModelContent(m,_)}};t.EditorDocumentModelContentRegistryImpl=p,n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],p.prototype,"eventBus",void 0),t.EditorDocumentModelContentRegistryImpl=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},37275:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(9519),t),n.__exportStar(e(91249),t),n.__exportStar(e(78157),t),n.__exportStar(e(98469),t)},89618:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MonacoTextModelService=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(96689);let p=class{canHandleResource(m){return!0}hasTextModelContentProvider(m){throw new Error("Method not implemented.")}async createModelReference(m){const _=await this.documentModelManager.createModelReference(new o.URI(m.toString()),"monaco");if(_){const s=_.instance.getMonacoModel();return Promise.resolve({object:{textEditorModel:s},dispose:()=>{_.dispose()}})}}registerTextModelContentProvider(m,_){return{dispose(){}}}};t.MonacoTextModelService=p,n.__decorate([(0,r.Autowired)(a.IEditorDocumentModelService),n.__metadata("design:type",Object)],p.prototype,"documentModelManager",void 0),t.MonacoTextModelService=p=n.__decorate([(0,r.Injectable)()],p)},98469:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SaveTask=void 0;const n=e(41869);class r extends n.Disposable{constructor(a,p,v,m,_){super(),this.uri=a,this.versionId=p,this.alternativeVersionId=v,this.content=m,this.ignoreDiff=_,this.deferred=new n.Deferred,this.finished=this.deferred.promise,this.started=!1,this.disposables.push(this.cancelToken=new n.CancellationTokenSource)}async run(a,p,v,m,_){this.started=!0;try{const s=await a.saveEditorDocumentModel(this.uri,this.content,p,v,m,this.ignoreDiff,_,this.cancelToken.token);return this.deferred.resolve(s),s}catch(s){const g={errorMessage:s.message,state:n.SaveTaskResponseState.ERROR};return this.deferred.resolve(g),g}}cancel(){this.cancelToken.cancel();const a={errorMessage:"cancel",state:n.SaveTaskResponseState.ERROR};this.deferred.resolve(a)}}t.SaveTask=r},66537:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SaveParticipantsContribution=t.TrimFinalNewLinesParticipant=t.CodeActionOnSaveParticipant=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(68969),p=n.__importStar(e(20868)),v=e(29046),m=e(52902),_=e(79865),s=e(2261),g=e(44781),l=n.__importStar(e(40540)),h=e(84866),u=e(93152),d=e(82196),E=e(96689);function f(A,S){let D=null;if(A.isAttachedToEditor()){for(const T of S.listCodeEditors())if(T.hasModel()&&T.getModel()===A){if(T.hasTextFocus())return T;D=T}}return D}let c=class extends o.WithEventBus{get bulkEditService(){return this.overrideServiceRegistry.getRegisteredService(o.ServiceNames.BULK_EDIT_SERVICE)}activate(){}async onEditorDocumentModelWillSave(S){if(S.payload.reason!==d.SaveReason.Manual)return;const D=this.preferenceService.get("editor.codeActionsOnSave",void 0,S.payload.uri.toString(),S.payload.language);if(!D)return;const T=this.preferenceService.get("editor.codeActionsOnSaveNotification",!0,S.payload.uri.toString(),S.payload.language),w=I=>{const P=(Array.isArray(D)?D:Object.keys(D)).map(B=>new v.CodeActionKind(B));if(Array.isArray(D)||P.sort((B,U)=>v.CodeActionKind.SourceFixAll.contains(B)?v.CodeActionKind.SourceFixAll.contains(U)?0:-1:v.CodeActionKind.SourceFixAll.contains(U)?1:0),P.length===0)return;const O=this.docService.getModelReference(S.payload.uri,"codeActionOnSave");if(!O)return;const x=O.instance.getMonacoModel(),k=new p.CancellationTokenSource,F=this.preferenceService.get("editor.codeActionsOnSaveTimeout",void 0,S.payload.uri.toString(),S.payload.language),L=Array.isArray(D)?[]:Object.keys(D).filter(B=>D[B]===!1).map(B=>new v.CodeActionKind(B));return Promise.race([new Promise((B,U)=>setTimeout(()=>{k.cancel(),U("codeActionsOnSave timeout")},F)),this.applyOnSaveActions(x,P,L,I,k.token)]).finally(()=>{k.cancel(),O.dispose()})};return T?this.progressService.withProgress({title:(0,o.formatLocalize)("editor.saveCodeActions.saving",S.payload.uri.displayName),location:o.ProgressLocation.Notification,cancellable:!0},async I=>w(I)):w(null)}async applyOnSaveActions(S,D,T,w,I){const R=new class{constructor(){this._names=new Set}_report(){w&&w.report({message:(0,o.formatLocalize)("editor.saveCodeActions.getting",[...this._names].map(P=>`'${P}'`).join(", "))})}report(P){P.displayName&&!this._names.has(P.displayName)&&(this._names.add(P.displayName),this._report())}};for(const P of D)try{const O=await this.getActionsToRun(S,P,T,R,I);await this.applyCodeActions(O.validActions)}catch(O){this.logger.error(O)}}async applyCodeActions(S){var D;for(const T of S)T.action.edit&&await((D=this.bulkEditService)===null||D===void 0?void 0:D.apply(m.ResourceEdit.convert(T.action.edit))),T.action.command&&await this.commandService.executeCommand(T.action.command.id,...T.action.command.arguments||[])}async getActionsToRun(S,D,T,w,I){return(0,h.getCodeActions)(_.languageFeaturesService.codeActionProvider,S,S.getFullModelRange(),{type:l.CodeActionTriggerType.Auto,filter:{include:D,excludes:T,includeSourceActions:!0},triggerAction:v.CodeActionTriggerSource.OnSave},w,I)}};t.CodeActionOnSaveParticipant=c,n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],c.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.MonacoOverrideServiceRegistry),n.__metadata("design:type",o.MonacoOverrideServiceRegistry)],c.prototype,"overrideServiceRegistry",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],c.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(E.IEditorDocumentModelService),n.__metadata("design:type",Object)],c.prototype,"docService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],c.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(a.IProgressService),n.__metadata("design:type",Object)],c.prototype,"progressService",void 0),n.__decorate([(0,o.OnEvent)(E.EditorDocumentModelWillSaveEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[E.EditorDocumentModelWillSaveEvent]),n.__metadata("design:returntype",Promise)],c.prototype,"onEditorDocumentModelWillSave",null),t.CodeActionOnSaveParticipant=c=n.__decorate([(0,r.Injectable)()],c);let y=class extends o.WithEventBus{activate(){}async onEditorDocumentModelWillSave(S){if(this.preferenceService.get("files.trimFinalNewlines")){const T=this.docService.getModelReference(S.payload.uri,"trimFinalNewlines");if(!T)return;const w=T.instance.getMonacoModel();this.doTrimFinalNewLines(w,S.payload.reason!==d.SaveReason.Manual),T.dispose()}}findLastNonEmptyLine(S){for(let D=S.getLineCount();D>=1;D--)if(S.getLineContent(D).length>0)return D;return 0}doTrimFinalNewLines(S,D){const T=S.getLineCount();if(T===1)return;let w=[],I=0;const R=this.injector.get(u.MonacoCodeService),P=f(S,R);if(P&&(w=P.getSelections(),D))for(let F=0,L=w.length;F<L;F++){const B=w[F].positionLineNumber;B>I&&(I=B)}const O=this.findLastNonEmptyLine(S),x=Math.max(O+1,I+1),k=S.validateRange(new g.Range(x,1,T,S.getLineMaxColumn(T)));k.isEmpty()||(S.pushEditOperations(w,[s.EditOperation.delete(k)],()=>w),P?.setSelections(w))}};t.TrimFinalNewLinesParticipant=y,n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],y.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(E.IEditorDocumentModelService),n.__metadata("design:type",Object)],y.prototype,"docService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],y.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],y.prototype,"injector",void 0),n.__decorate([(0,o.OnEvent)(E.EditorDocumentModelWillSaveEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[E.EditorDocumentModelWillSaveEvent]),n.__metadata("design:returntype",Promise)],y.prototype,"onEditorDocumentModelWillSave",null),t.TrimFinalNewLinesParticipant=y=n.__decorate([(0,r.Injectable)()],y);let b=class{onStart(){this.codeActionOnSaveParticipant.activate(),this.trimFinalNewLinesParticipant.activate()}};t.SaveParticipantsContribution=b,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",c)],b.prototype,"codeActionOnSaveParticipant",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",y)],b.prototype,"trimFinalNewLinesParticipant",void 0),t.SaveParticipantsContribution=b=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],b)},96689:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ORIGINAL_DOC_SCHEME=t.EditorDocumentModelWillSaveEvent=t.EditorDocumentModelSavedEvent=t.EditorDocumentModelRemovalEvent=t.EditorDocumentModelCreationEvent=t.EditorDocumentModelOptionExternalUpdatedEvent=t.EditorDocumentModelOptionChangedEvent=t.EditorDocumentModelContentChangedEvent=t.IEditorDocumentModelContentRegistry=t.IEditorDocumentModelService=void 0;const n=e(41869);t.IEditorDocumentModelService=Symbol("IEditorDocumentModelService"),t.IEditorDocumentModelContentRegistry=Symbol("IEditorDocumentModelContentRegistry");class r extends n.BasicEvent{}t.EditorDocumentModelContentChangedEvent=r;class o extends n.BasicEvent{}t.EditorDocumentModelOptionChangedEvent=o;class a extends n.BasicEvent{}t.EditorDocumentModelOptionExternalUpdatedEvent=a;class p extends n.BasicEvent{}t.EditorDocumentModelCreationEvent=p;class v extends n.BasicEvent{}t.EditorDocumentModelRemovalEvent=v;class m extends n.BasicEvent{}t.EditorDocumentModelSavedEvent=m;class _ extends n.BasicEvent{}t.EditorDocumentModelWillSaveEvent=_,t.ORIGINAL_DOC_SCHEME="original_doc"},71624:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserDiffEditor=t.BrowserCodeEditor=t.EditorCollectionServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(66e3),p=e(22689),v=e(43718),m=e(99721),_=e(23418),s=e(55113),g=e(30526),l=e(96689),h=e(59879),u=e(39266),d=e(6043),E=e(82196);let f=class extends v.WithEventBus{get currentEditor(){return this._currentEditor}constructor(){super(),this._editors=new Set,this._diffEditors=new Set,this._multiDiffEditors=new Set,this._onCodeEditorCreate=new v.Emitter,this._onDiffEditorCreate=new v.Emitter,this._onMultiDiffEditorCreate=new v.Emitter,this._onCodeEditorChange=new v.Emitter,this._onDiffEditorChange=new v.Emitter,this._onMultiDiffEditorChange=new v.Emitter,this.onCodeEditorCreate=this._onCodeEditorCreate.event,this.onDiffEditorCreate=this._onDiffEditorCreate.event,this.onMultiDiffEditorCreate=this._onMultiDiffEditorCreate.event,this.onCodeEditorChange=this._onCodeEditorChange.event,this.onDiffEditorChange=this._onDiffEditorChange.event,this.onMultiDiffEditorChange=this._onMultiDiffEditorChange.event,this.addDispose(this.editorFeatureRegistry.onDidRegisterFeature(D=>{this._editors.forEach(T=>{this.editorFeatureRegistry.runOneContribution(T,D)})}))}createCodeEditor(D,T,w){const I={...(0,d.getConvertedMonacoOptions)(this.configurationService).editorOptions,...T},R=this.monacoService.createCodeEditor(D,I,w),P=this.injector.get(c,[R,T]);return this._onCodeEditorCreate.fire(P),P}listEditors(){return Array.from(this._editors.values())}getEditorByUri(D){var T;for(const w of this._editors.values())if(!((T=w.currentUri)===null||T===void 0)&&T.isEqual(D))return w}addEditors(D){const T=this._editors.size;D.forEach(w=>{this._editors.has(w)||(this._editors.add(w),this.editorFeatureRegistry.runContributions(w),w.monacoEditor.onDidFocusEditorWidget(()=>{this._currentEditor=w}),w.monacoEditor.onContextMenu(()=>{this._currentEditor=w}))}),this._editors.size!==T&&this._onCodeEditorChange.fire()}removeEditors(D){const T=this._editors.size;D.forEach(w=>{this._editors.delete(w),this._currentEditor===w&&(this._currentEditor=void 0)}),this._editors.size!==T&&this._onCodeEditorChange.fire()}createDiffEditor(D,T,w){const I=(0,d.getConvertedMonacoOptions)(this.configurationService),R={...I.editorOptions,...I.diffOptions,...T},P=this.monacoService.createDiffEditor(D,R,w),O=this.injector.get(y,[P,T]);return this._onDiffEditorCreate.fire(O),O}createMultiDiffEditor(D,T,w){const I=(0,d.getConvertedMonacoOptions)(this.configurationService),R=this.monacoService.createMultiDiffEditorWidget(D,w),P={...I.diffOptions,...T};return this.injector.get(u.BrowserMultiDiffEditor,[R,P,this])}createMergeEditor(D,T,w){const I=(0,d.getConvertedMonacoOptions)(this.configurationService),R={...I.editorOptions,...I.diffOptions,...T,wordWrap:"off"};return this.monacoService.createMergeEditor(D,R,w)}listDiffEditors(){return Array.from(this._diffEditors.values())}addDiffEditors(D){const T=this._diffEditors.size;D.forEach(w=>{this._diffEditors.has(w)||this._diffEditors.add(w)}),this._diffEditors.size!==T&&this._onDiffEditorChange.fire()}removeDiffEditors(D){const T=this._diffEditors.size;D.forEach(w=>{this._diffEditors.delete(w)}),this._diffEditors.size!==T&&this._onDiffEditorChange.fire()}listMultiDiffEditors(){return Array.from(this._multiDiffEditors.values())}addMultiDiffEditors(D){const T=this._multiDiffEditors.size;D.forEach(w=>{this._multiDiffEditors.has(w)||this._multiDiffEditors.add(w)}),this._multiDiffEditors.size!==T&&this._onMultiDiffEditorChange.fire()}removeMultiDiffEditors(D){const T=this._multiDiffEditors.size;D.forEach(w=>{this._multiDiffEditors.delete(w)}),this._multiDiffEditors.size!==T&&this._onMultiDiffEditorChange.fire()}onDocModelContentChangedEvent(D){this.eventBus.fire(new _.ResourceDecorationNeedChangeEvent({uri:D.payload.uri,decoration:{dirty:!!D.payload.dirty,readOnly:!!D.payload.readonly}}))}};t.EditorCollectionServiceImpl=f,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",p.MonacoService)],f.prototype,"monacoService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],f.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(m.IConfigurationService),n.__metadata("design:type",Object)],f.prototype,"configurationService",void 0),n.__decorate([(0,r.Autowired)(E.IEditorFeatureRegistry),n.__metadata("design:type",h.EditorFeatureRegistryImpl)],f.prototype,"editorFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(l.IEditorDocumentModelService),n.__metadata("design:type",Object)],f.prototype,"documentModelService",void 0),n.__decorate([(0,v.OnEvent)(l.EditorDocumentModelContentChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[l.EditorDocumentModelContentChangedEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onDocModelContentChangedEvent",null),t.EditorCollectionServiceImpl=f=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],f);let c=class extends g.BaseMonacoEditorWrapper{get currentDocumentModel(){return this._currentDocumentModelRef&&!this._currentDocumentModelRef.disposed?this._currentDocumentModelRef.instance:null}getType(){return _.EditorType.CODE}constructor(D,T={}){super(D,_.EditorType.CODE),this.monacoEditor=D,this.editorState=new Map,this._onCursorPositionChanged=new v.Emitter,this.onCursorPositionChanged=this._onCursorPositionChanged.event,this._onRefOpen=new v.Emitter,this.onRefOpen=this._onRefOpen.event,this._specialEditorOptions=T,this.collectionService.addEditors([this]);const w=D.onDidChangeModel(()=>{b(this.monacoEditor.getDomNode()),w.dispose()});this.addDispose(D.onDidChangeCursorPosition(()=>{if(!this.currentDocumentModel)return;const I=D.getSelection();this._onCursorPositionChanged.fire({position:D.getPosition(),selectionLength:I?this.currentDocumentModel.getMonacoModel().getValueInRange(I).length:0})})),this.addDispose(this.monacoEditor)}layout(D,T=!1){this.monacoEditor.layout(D,T)}focus(){this.monacoEditor.focus()}dispose(){super.dispose(),this.saveCurrentState(),this.collectionService.removeEditors([this])}saveCurrentState(){if(this.currentUri){const D=this.monacoEditor.saveViewState();D&&this.editorState.set(this.currentUri.toString(),D)}}restoreState(){if(this.currentUri){const D=this.editorState.get(this.currentUri.toString());(0,s.isTextEditorViewState)(D)&&this.monacoEditor.restoreViewState(D)}}open(D){this.saveCurrentState(),this._currentDocumentModelRef=D;const T=this.currentDocumentModel.getMonacoModel();this.disableSelectionEmitter(),this.monacoEditor.setModel(T),this.enableSelectionEmitter(),this.restoreState(),this._onRefOpen.fire(D),this._onCursorPositionChanged.fire({position:this.monacoEditor.getPosition(),selectionLength:0});const{instance:w}=D;this.updateOptions(),this.eventBus.fire(new _.ResourceDecorationNeedChangeEvent({uri:w.uri,decoration:{readOnly:w.readonly}}))}};t.BrowserCodeEditor=c,n.__decorate([(0,r.Autowired)(_.EditorCollectionService),n.__metadata("design:type",f)],c.prototype,"collectionService",void 0),n.__decorate([(0,r.Autowired)(E.IEditorFeatureRegistry),n.__metadata("design:type",Object)],c.prototype,"editorFeatureRegistry",void 0),t.BrowserCodeEditor=c=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object])],c);class y extends v.WithEventBus{get originalDocModel(){return this.originalDocModelRef&&!this.originalDocModelRef.disposed?this.originalDocModelRef.instance:null}get modifiedDocModel(){return this.modifiedDocModelRef&&!this.modifiedDocModelRef.disposed?this.modifiedDocModelRef.instance:null}saveCurrentState(){if(this.currentUri){const D=this.monacoDiffEditor.saveViewState();D&&this.editorState.set(this.currentUri.toString(),D)}}restoreState(D){if(this.currentUri){const T=this.editorState.get(this.currentUri.toString());(0,s.isTextEditorViewState)(T)&&((D.range||D.originalRange)&&(T.modified.cursorState=[]),this.monacoDiffEditor.restoreViewState(T))}}constructor(D,T={}){super(),this.monacoDiffEditor=D,this.specialOptions=T,this.editorState=new Map,this._onRefOpen=new v.Emitter,this.onRefOpen=this._onRefOpen.event,this.wrapEditors(),this.addDispose(this.configurationService.onDidChangeConfiguration(w=>{Array.from(w.affectedKeys.values()).filter(R=>(0,d.isDiffEditorOption)(R)).length>0&&this.updateDiffOptions()}))}async compare(D,T,w={},I){if(this.saveCurrentState(),this.originalDocModelRef=D,this.modifiedDocModelRef=T,!this.originalDocModel||!this.modifiedDocModel)return;const R=this.originalDocModel.getMonacoModel(),P=this.modifiedDocModel.getMonacoModel(),O=this.monacoDiffEditor.createViewModel({original:R,modified:P});if(this.monacoDiffEditor.setModel(O),I?this.currentUri=I:this.currentUri=v.URI.from({scheme:_.DIFF_SCHEME,query:v.URI.stringifyQuery({name,original:this.originalDocModel.uri.toString(),modified:this.modifiedDocModel.uri.toString()})}),await O?.waitForDiff(),this.restoreState(w),w.range||w.originalRange){const k=w.range||w.originalRange,F=w.range?this.modifiedEditor.monacoEditor:this.originalEditor.monacoEditor;setTimeout(()=>{F.revealRangeInCenter(k),F.setSelection(k)}),v.Event.once(this.monacoDiffEditor.onDidUpdateDiff)(()=>{F.setSelection(k),setTimeout(()=>{F.revealRangeInCenter(k)})})}this._onRefOpen.fire(D),this._onRefOpen.fire(T);const x=this.preferenceService.get("diffEditor.hideUnchangedRegions.enabled");if(w.revealFirstDiff&&!x){const k=this.monacoDiffEditor.getLineChanges();if(k&&k.length>0)this.showFirstDiff(O);else{const F=this.monacoDiffEditor.onDidUpdateDiff(()=>{this.showFirstDiff(O),F.dispose()})}}await this.updateOptionsOnModelChange(),this.diffResourceKeys.forEach(k=>k.set(this.currentUri))}async showFirstDiff(D){await D?.waitForDiff(),this.monacoDiffEditor.revealFirstDiff()}async updateOptionsOnModelChange(){await this.doUpdateDiffOptions()}isReadonly(){var D;return!!(!((D=this.modifiedDocModel)===null||D===void 0)&&D.readonly)}async doUpdateDiffOptions(){const D=this.modifiedEditor.currentUri?this.modifiedEditor.currentUri.toString():void 0,T=this.modifiedEditor.currentDocumentModel?this.modifiedEditor.currentDocumentModel.languageId:void 0,w=(0,d.getConvertedMonacoOptions)(this.configurationService,D,T),I=this.isReadonly();this.monacoDiffEditor.updateOptions({...w.diffOptions,...this.specialOptions,readOnly:I,renderMarginRevertIcon:!I}),this.currentUri&&this.eventBus.fire(new _.ResourceDecorationNeedChangeEvent({uri:this.currentUri,decoration:{readOnly:this.isReadonly()}}))}updateDiffOptions(){this.doUpdateDiffOptions()}getLineChanges(){const D=this.monacoDiffEditor.getLineChanges();return D?D.map(T=>{var w;return[T.originalStartLineNumber,T.originalEndLineNumber,T.modifiedStartLineNumber,T.modifiedEndLineNumber,(w=T.charChanges)===null||w===void 0?void 0:w.map(I=>[I.originalStartLineNumber,I.originalStartColumn,I.originalEndLineNumber,I.originalEndColumn,I.modifiedStartLineNumber,I.modifiedStartColumn,I.modifiedEndLineNumber,I.modifiedEndColumn])]}):null}wrapEditors(){const D=this;this.originalEditor=this.injector.get(g.DiffEditorPart,[D.monacoDiffEditor.getOriginalEditor(),()=>D.originalDocModel,_.EditorType.ORIGINAL_DIFF]),this.modifiedEditor=this.injector.get(g.DiffEditorPart,[D.monacoDiffEditor.getModifiedEditor(),()=>D.modifiedDocModel,_.EditorType.MODIFIED_DIFF]),this.collectionService.addEditors([this.originalEditor,this.modifiedEditor]),this.collectionService.addDiffEditors([this]);const T=this.contextKeyService.createScoped(this.modifiedEditor.monacoEditor._contextKeyService),w=this.contextKeyService.createScoped(this.originalEditor.monacoEditor._contextKeyService);this.diffResourceKeys=[new a.ResourceContextKey(T,void 0,"diffResource"),new a.ResourceContextKey(w,void 0,"diffResource")]}layout(){return this.monacoDiffEditor.layout()}focus(){this.monacoDiffEditor.focus()}dispose(){super.dispose(),this.collectionService.removeEditors([this.originalEditor,this.modifiedEditor]),this.collectionService.removeDiffEditors([this]),this.monacoDiffEditor.dispose(),this._disposed=!0}}t.BrowserDiffEditor=y,n.__decorate([(0,r.Autowired)(_.EditorCollectionService),n.__metadata("design:type",f)],y.prototype,"collectionService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],y.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(m.IConfigurationService),n.__metadata("design:type",Object)],y.prototype,"configurationService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],y.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],y.prototype,"contextKeyService",void 0);function b(S){S.addEventListener("mousewheel",A)}function A(S){S.preventDefault(),S.stopPropagation(),(this.offsetWidth+this.scrollLeft+S.deltaX>this.scrollWidth||this.scrollLeft+S.deltaX<0)&&(S.preventDefault(),S.stopPropagation())}},17315:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorElectronContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(37406),v=e(23418),m=e(96689),_=e(82196),s=e(51553);let g=class extends a.WithEventBus{onResourceDecorationChangeEvent(){const h=this.workbenchEditorService.hasDirty();this.electronMainUIService.setDocumentEdited(o.electronEnv.currentWindowId,!!h)}async onWillStop(){return!!(await this.workbenchEditorService.closeAllOnlyConfirmOnce()||!this.cacheProvider.isFlushed())}registerKeybindings(h){h.registerKeybinding({command:o.EDITOR_COMMANDS.NEXT.id,keybinding:"ctrl+tab"}),h.registerKeybinding({command:o.EDITOR_COMMANDS.PREVIOUS.id,keybinding:"ctrl+shift+tab"}),a.isOSX&&(h.registerKeybinding({command:o.EDITOR_COMMANDS.NEXT.id,keybinding:"ctrlcmd+shift+]"}),h.registerKeybinding({command:o.EDITOR_COMMANDS.PREVIOUS.id,keybinding:"ctrlcmd+shift+["}))}};t.EditorElectronContribution=g,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],g.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",s.WorkbenchEditorServiceImpl)],g.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(v.IDocPersistentCacheProvider),n.__metadata("design:type",Object)],g.prototype,"cacheProvider",void 0),n.__decorate([(0,r.Autowired)(m.IEditorDocumentModelContentRegistry),n.__metadata("design:type",Object)],g.prototype,"contentRegistry",void 0),n.__decorate([(0,r.Autowired)(p.IElectronMainUIService),n.__metadata("design:type",Object)],g.prototype,"electronMainUIService",void 0),n.__decorate([(0,a.OnEvent)(_.ResourceDecorationChangeEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],g.prototype,"onResourceDecorationChangeEvent",null),t.EditorElectronContribution=g=n.__decorate([(0,o.Domain)(o.ClientAppContribution,o.KeybindingContribution)],g)},75522:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorOpener=void 0;const n=e(85608),r=e(76003),o=e(23418);let a=class{async open(v){let m;const _=/^L?(\d+)(?:,(\d+))?/.exec(v.fragment);if(_){const s=parseInt(_[1],10),g=_[2]?parseInt(_[2],10):1;m={startLineNumber:s,startColumn:g,endLineNumber:s,endColumn:g},v=v.withFragment("")}return await this.workbenchEditorService.open(v,{range:m}),!0}async handleURI(v){return this.resourceService.handlesUri(v)}handleScheme(){return!1}};t.EditorOpener=a,n.__decorate([(0,r.Autowired)(o.ResourceService),n.__metadata("design:type",o.ResourceService)],a.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(o.WorkbenchEditorService),n.__metadata("design:type",o.WorkbenchEditorService)],a.prototype,"workbenchEditorService",void 0),t.EditorOpener=a=n.__decorate([(0,r.Injectable)()],a)},19352:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scroll=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),a=n.__importDefault(e(62251));class p extends o.default.Component{constructor(){super(...arguments),this.position={top:0,left:0},this.dragging=!1,this.draggingStart=0,this.draggingStartPos=0,this.shouldHideThumb=!0,this.isAtTop=!0,this.onMouseMoveHorizontal=m=>{if(!this.dragging)return;const _=m.pageX-this.draggingStart;this.ref.scrollLeft=this.draggingStartPos+this.calculateXToLeft(_)},this.onMouseUpHorizontal=m=>{this.dragging=!1,document.removeEventListener("mousemove",this.onMouseMoveHorizontal),document.removeEventListener("mouseup",this.onMouseUpHorizontal),this.shouldHideThumb&&this.hideThumb()},this.onMouseMoveVertical=m=>{if(!this.dragging)return;const _=m.pageY-this.draggingStart;this.ref.scrollTop=this.draggingStartPos+this.calculateYToTop(_)},this.onMouseUpVertical=m=>{this.dragging=!1,document.removeEventListener("mousemove",this.onMouseMoveVertical),document.removeEventListener("mouseup",this.onMouseUpVertical),this.shouldHideThumb&&this.hideThumb()},this.onMousewheel=m=>{this.ref.clientHeight>=this.ref.scrollHeight&&(m.deltaY!==0&&(this.ref.scrollLeft+=m.deltaY),m.deltaX!==0&&(this.ref.scrollLeft+=m.deltaX))},this.onMouseEnter=()=>{this.update()},this.handleWindowResize=()=>{this.update()},this.update=m=>{this.requestFrame&&window.cancelAnimationFrame(this.requestFrame),this.requestFrame=window.requestAnimationFrame(()=>{this._update(),m&&m()})}}onScroll(m){this.position={top:this.ref.scrollTop,left:this.ref.scrollLeft},this.props.onScroll&&this.props.onScroll(this.position),this.update(()=>{const _=this.ref.scrollWidth,s=this.ref.offsetWidth,g=this.ref.scrollHeight,l=this.ref.offsetHeight;this.thumbH.style.left=this.position.left*s/_+"px",this.thumbV.style.top=this.position.top*l/g+"px"}),!this.isAtTop&&this.ref.scrollTop===0?(this.isAtTop=!0,this.setCss()):this.isAtTop&&this.ref.scrollTop!==0&&(this.isAtTop=!1,this.setCss()),this.ref.scrollLeft>0?(this.decorationL.style.opacity=String(1),this.decorationR.style.opacity=String(1)):this.decorationL.style.opacity=String(0),(this.ref.scrollWidth===this.ref.offsetWidth||this.ref.scrollLeft===this.ref.scrollWidth-this.ref.offsetWidth)&&(this.decorationR.style.opacity=String(0))}scrollTo(m){this.ref.scrollLeft=m.left,this.ref.scrollTop=m.top}onMouseDownHorizontal(m){this.dragging=!0,m.target===this.trackH&&this.onMouseDownOnTrack(m),this.draggingStart=m.pageX,this.draggingStartPos=this.ref.scrollLeft,document.addEventListener("mousemove",this.onMouseMoveHorizontal),document.addEventListener("mouseup",this.onMouseUpHorizontal)}onMouseDownOnTrack(m){const _=m.target,s=m.clientX-_.getBoundingClientRect().left,g=this.ref.scrollWidth,l=this.ref.offsetWidth,h=s*g/l-.5*l;this.scrollTo({left:h,top:this.position.top})}calculateXToLeft(m){const _=this.ref.scrollWidth,s=this.ref.offsetWidth;return m*_/s}onMouseDownVertical(m){this.dragging=!0,m.target===this.trackV&&this.onMouseDownOnTrackVertical(m),this.draggingStart=m.pageY,this.draggingStartPos=this.ref.scrollTop,document.addEventListener("mousemove",this.onMouseMoveVertical),document.addEventListener("mouseup",this.onMouseUpVertical)}onMouseDownOnTrackVertical(m){const _=m.target,s=m.clientY-_.getBoundingClientRect().top,g=this.ref.scrollHeight,l=this.ref.offsetHeight,h=s*g/l-.5*l;this.scrollTo({left:this.position.left,top:h})}calculateYToTop(m){const _=this.ref.scrollHeight,s=this.ref.offsetHeight;return m*_/s}componentDidUpdate(){this.update(),this.props.delegate&&this.props.delegate({scrollTo:this.scrollTo.bind(this)})}componentDidMount(){this.update(),window.addEventListener("resize",this.handleWindowResize),this.props.delegate&&this.props.delegate({scrollTo:this.scrollTo.bind(this)}),this.ref&&(this.ref.addEventListener("mouseenter",this.onMouseEnter),this.ref.addEventListener("wheel",this.onMousewheel))}componentWillUnmount(){this.ref&&(this.ref.removeEventListener("mouseenter",this.onMouseEnter),this.ref.removeEventListener("wheel",this.onMousewheel)),window.removeEventListener("resize",this.handleWindowResize),this.requestFrame&&window.cancelAnimationFrame(this.requestFrame)}sizeEqual(m,_){return m&&_&&m.offsetHeight===_.offsetHeight&&m.scrollHeight===_.scrollHeight&&m.offsetWidth===_.offsetWidth&&m.scrollWidth===_.scrollWidth}_update(){this.ref&&(this.sizeEqual(this.size,this.ref)||(this.size={offsetHeight:this.ref.offsetHeight,offsetWidth:this.ref.offsetWidth,scrollWidth:this.ref.scrollWidth,scrollHeight:this.ref.scrollHeight},this.updateScrollBar()))}updateScrollBar(){const m=this.ref.scrollWidth,_=this.ref.offsetWidth;if(_<m){const l=_*_/m;this.thumbH.style.width=l+"px",this.trackH.parentElement.style.display="block"}else this.trackH.parentElement.style.display="none";const s=this.ref.scrollHeight,g=this.ref.offsetHeight;g<s?(this.thumbV.style.height=g*g/s+"px",this.trackV.parentElement.style.display="block"):this.trackV.parentElement.style.display="none"}hideThumb(){this.shouldHideThumb=!0,this.dragging||this.setCss()}showThumb(){this.shouldHideThumb=!1,this.setCss()}setCss(){this.container.className=(0,r.default)({[a.default.scroll]:!0,[a.default["hide-thumb"]]:this.shouldHideThumb&&!this.dragging});const m={};this.props.atTopClassName&&(m[this.props.atTopClassName]=this.isAtTop),this.props.className&&(m[this.props.className]=!0),this.ref.className=(0,r.default)(m)}render(){return o.default.createElement("div",{className:(0,r.default)(a.default.scroll,a.default["hide-thumb"]),ref:m=>{m&&(this.container=m,this.props.forwardedRef(m))},onMouseMove:()=>this.showThumb(),onMouseLeave:()=>this.hideThumb(),style:this.props.containerStyle},o.default.createElement("div",{style:this.props.style,className:(0,r.default)(this.props.className),onScroll:this.onScroll.bind(this),ref:m=>m&&(this.ref=m),onMouseDown:()=>this.update(),onMouseUp:()=>this.update()},this.props.children),o.default.createElement("div",{className:a.default["scrollbar-decoration-vertical-l"],ref:m=>m&&(this.decorationL=m)}),o.default.createElement("div",{className:a.default["scrollbar-decoration-vertical-r"],ref:m=>m&&(this.decorationR=m)}),o.default.createElement("div",{className:a.default["scroll-horizontal"]},o.default.createElement("div",{className:a.default["track-horizontal"],ref:m=>m&&(this.trackH=m),onMouseDown:this.onMouseDownHorizontal.bind(this)}),o.default.createElement("div",{className:"kt-editor-scrollbar-thumb-horizontal",onMouseDown:this.onMouseDownHorizontal.bind(this),ref:m=>m&&(this.thumbH=m)})),o.default.createElement("div",{className:a.default["scroll-vertical"]},o.default.createElement("div",{className:a.default["track-vertical"],ref:m=>m&&(this.trackV=m),onMouseDown:this.onMouseDownVertical.bind(this)}),o.default.createElement("div",{className:"kt-editor-scrollbar-thumb-vertical",onMouseDown:this.onMouseDownVertical.bind(this),ref:m=>m&&(this.thumbV=m)})))}}t.Scroll=p},93669:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorContext=t.defaultEditorContext=void 0;const r=e(85608).__importDefault(e(14041));t.defaultEditorContext={minimapWidth:108},t.EditorContext=r.default.createContext(t.defaultEditorContext)},60362:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorAutoSaveEditorContribution=t.EditorContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(68456),p=e(93899),v=e(1237),m=e(77661),_=e(75524),s=e(43718),g=e(96177),l=e(62660),h=n.__importStar(e(84555)),u=e(94170),d=e(23268),E=e(96640),f=e(23418),c=e(55113),y=e(64335),b=e(89618),A=e(96689),S=e(75522),D=e(93152),T=e(8287),w=e(14385),I=e(57719),R=e(85857),P=e(95338),O=e(94617),x=e(86997),k=e(93532),F=e(53135),L=e(50236),B=e(82196),U=e(6670),W=e(67903),j=e(51553);let Q=class extends o.Disposable{registerComponent($){$.register("@opensumi/ide-editor",{id:"ide-editor",component:w.EditorView}),$.register("breadcrumb-menu",{id:"breadcrumb-menu",component:k.NavigationMenuContainer})}registerOverrideService($){const V=this.injector.get(D.MonacoCodeService),K=this.injector.get(o.IContextKeyService).createScoped();this.workbenchEditorService.setEditorContextKeyService(K),$.registerOverrideService(o.ServiceNames.CONTEXT_KEY_SERVICE,K.contextKeyService),$.registerOverrideService(o.ServiceNames.CODE_EDITOR_SERVICE,V),$.registerOverrideService(o.ServiceNames.CONTEXT_VIEW_SERVICE,new D.MonacoContextViewService(V)),$.registerOverrideService(o.ServiceNames.TEXT_MODEL_SERVICE,this.injector.get(b.MonacoTextModelService))}registerMonacoDefaultFormattingSelector($){const V=this.injector.get(R.FormattingSelector);this.addDispose($(V.selectFormatter.bind(V)))}registerEditorExtensionContribution($){$(O.EditorContextMenuController.ID,new E.SyncDescriptor(O.EditorContextMenuController,[this.contextMenuService,this.globalContextKeyService,this.contextMenuRenderer]))}getMimeForMode($){for(const V of this.textmateService.getLanguages())if(V.id===$&&V.mimetypes)return V.mimetypes[0]}registerPlatformLanguageAssociations($){const V=this.corePreferences["files.associations"];if(!V)return;const H=Object.keys(V).map(K=>({id:V[K],filepattern:K,mime:this.getMimeForMode(V[K])||`text/x-${V.id}`}));$(H)}async interceptOpen($){try{return await this.openerService.open($),!0}catch(V){return this.logger.error(V),!1}}onWillStop($){if(!this.appConfig.isElectronRenderer)return this.workbenchEditorService.hasDirty()||!this.cacheProvider.isFlushed()}extractGroupAndUriFromArgs($,V){let H,K;if($ instanceof o.URI)H=V||this.workbenchEditorService.currentEditorGroup,K=$||H&&H.currentResource&&H.currentResource.uri;else{const Y=$||{};H=Y.group||this.workbenchEditorService.currentEditorGroup,K=Y.uri||H&&H.currentResource&&H.currentResource.uri}return{group:H,uri:K}}isElectronRenderer(){return this.appConfig.isElectronRenderer}registerKeybindings($){$.registerKeybinding({command:o.EDITOR_COMMANDS.SAVE_CURRENT.id,keybinding:"ctrlcmd+s"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.FOCUS_IF_NOT_ACTIVATE_ELEMENT.id,keybinding:"ctrlcmd+f",when:"!editorFocus"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.CLOSE.id,keybinding:this.isElectronRenderer()?"ctrlcmd+w":"alt+shift+w"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.PREVIOUS.id,keybinding:this.isElectronRenderer()?"alt+cmd+left":"ctrlcmd+ctrl+left"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.NEXT.id,keybinding:this.isElectronRenderer()?"alt+cmd+right":"ctrlcmd+ctrl+right"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.PREVIOUS.id,keybinding:this.isElectronRenderer()?"ctrlcmd+pageup":"alt+pageup"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.NEXT.id,keybinding:this.isElectronRenderer()?"ctrlcmd+pagedown":"alt+pagedown"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.GO_FORWARD.id,keybinding:s.isWindows?"alt+right":"ctrl+shift+-"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.GO_BACK.id,keybinding:s.isWindows?"alt+left":"ctrl+-"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.CHANGE_LANGUAGE.id,keybinding:"ctrlcmd+k m"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.SPLIT_TO_RIGHT.id,keybinding:"ctrlcmd+\\"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.NAVIGATE_NEXT.id,keybinding:"ctrlcmd+k ctrlcmd+right"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.NAVIGATE_PREVIOUS.id,keybinding:"ctrlcmd+k ctrlcmd+left"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.SAVE_ALL.id,keybinding:"alt+ctrlcmd+s"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.CLOSE_ALL_IN_GROUP.id,keybinding:"ctrlcmd+k w"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.CLOSE_ALL.id,keybinding:"ctrlcmd+k ctrlcmd+w"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.CLOSE_SAVED.id,keybinding:"ctrlcmd+k u"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.PIN_CURRENT.id,keybinding:"ctrlcmd+k enter"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.COPY_CURRENT_PATH.id,keybinding:"ctrlcmd+k p"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.REOPEN_CLOSED.id,keybinding:this.isElectronRenderer()?"ctrlcmd+shift+t":"alt+shift+t"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.NEW_UNTITLED_FILE.id,keybinding:this.isElectronRenderer()?"ctrlcmd+n":"alt+n"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.SEARCH_WORKSPACE_SYMBOL.id,keybinding:this.isElectronRenderer()?"ctrlcmd+t":"ctrlcmd+o"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.SEARCH_WORKSPACE_SYMBOL_CLASS.id,keybinding:this.isElectronRenderer()?"ctrlcmd+alt+t":"ctrlcmd+alt+o"});for(let V=1;V<10;V++)$.registerKeybinding({command:o.EDITOR_COMMANDS.GO_TO_GROUP.id,keybinding:"ctrlcmd+"+V,args:[V]});["left","up","down","right"].forEach(V=>{$.registerKeybinding({command:o.EDITOR_COMMANDS.MOVE_GROUP.id,keybinding:"ctrlcmd+k "+V,args:[V]})}),$.registerKeybinding({command:o.EDITOR_COMMANDS.COMPONENT_UNDO.id,keybinding:"ctrlcmd+z",when:"inEditorComponent && !inputFocus"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.COMPONENT_REDO.id,keybinding:"shift+ctrlcmd+z",when:"inEditorComponent && !inputFocus"}),$.registerKeybinding({command:o.EDITOR_COMMANDS.TOGGLE_WORD_WRAP.id,keybinding:"alt+z",when:"editorFocus"})}initialize(){this.editorStatusBarService.setListener(),this.historyService.init()}registerCommands($){$.registerCommand(o.EDITOR_COMMANDS.GO_FORWARD,{execute:()=>{this.historyService.forward()}}),$.registerCommand(o.EDITOR_COMMANDS.FOCUS_IF_NOT_ACTIVATE_ELEMENT,{execute:()=>{var V,H;if(!document.activeElement||document.activeElement===document.body){const K=this.workbenchEditorService.currentEditorGroup;K?.focus(),(H=(V=K?.currentCodeEditor)===null||V===void 0?void 0:V.monacoEditor)===null||H===void 0||H.trigger("api","actions.find",null)}}}),$.registerCommand(o.EDITOR_COMMANDS.GO_BACK,{execute:()=>{this.historyService.back()}}),$.registerCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE,{execute:async(V,H)=>{const K=await this.workbenchEditorService.open(V,H);if(K)return{groupId:K?.group.name}}}),$.registerCommand(o.EDITOR_COMMANDS.OPEN_RESOURCES,{execute:({uris:V})=>{this.workbenchEditorService.openUris(V)}}),$.registerCommand(o.EDITOR_COMMANDS.COMPARE,{execute:({original:V,modified:H,name:K},Y={})=>(K=K||`${V.displayName} <=> ${H.displayName}`,this.workbenchEditorService.open(o.URI.from({scheme:f.DIFF_SCHEME,query:o.URI.stringifyQuery({name:K,original:V,modified:H})}),Y))}),$.registerCommand(o.EDITOR_COMMANDS.OPEN_MERGEEDITOR_DEV,{execute:async()=>{try{const V=await this.quickInputService.open({value:""});if(!V)return;const H=JSON.parse(V);this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_MERGEEDITOR.id,H)}catch{}}}),$.registerCommand(o.EDITOR_COMMANDS.OPEN_MERGEEDITOR,{execute:V=>{const H=_.IRelaxedOpenMergeEditorArgs.validate(V);this.workbenchEditorService.open(o.URI.from({scheme:"mergeEditor",query:o.URI.stringifyQuery({name:(0,o.formatLocalize)("mergeEditor.workbench.tab.name",H.output.displayName),openMetadata:_.IRelaxedOpenMergeEditorArgs.toString(H)})}))}}),$.registerCommand(o.EDITOR_COMMANDS.MERGEEDITOR_RESET,{execute:()=>{const V=this.mergeEditorService.getNutrition();if(!V)return;const{output:H}=V,{uri:K}=H;this.mergeEditorService.fireRestoreState(K),this.mergeEditorService.compare()}}),$.registerCommand(o.EDITOR_COMMANDS.SAVE_CURRENT,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;V&&V.currentResource&&(V.pin(V.currentResource.uri),V.saveCurrent())}}),$.registerCommand(o.EDITOR_COMMANDS.SAVE_URI,{execute:async V=>{for(const H of this.workbenchEditorService.editorGroups){const K=H.resources.find(Y=>Y.uri.isEqual(V));K&&H.saveResource(K)}}}),$.registerCommand(o.EDITOR_COMMANDS.CLOSE_ALL_IN_GROUP,{execute:async(V,H)=>{const{group:K}=this.extractGroupAndUriFromArgs(V,H);K&&await K.closeAll()}}),$.registerCommand(o.EDITOR_COMMANDS.CLOSE_SAVED,{execute:async V=>{V=V||{};const{group:H=this.workbenchEditorService.currentEditorGroup}=V;H&&await H.closeSaved()}}),$.registerCommand(o.EDITOR_COMMANDS.CLOSE_OTHER_IN_GROUP,{execute:async V=>{V=V||{};const{group:H=this.workbenchEditorService.currentEditorGroup,uri:K=H&&H.currentResource&&H.currentResource.uri}=V;H&&K&&await H.closeOthers(K)}}),$.registerCommand(o.EDITOR_COMMANDS.CLOSE,{execute:async V=>{V=V||{};const{group:H=this.workbenchEditorService.currentEditorGroup,uri:K=H&&H.currentResource&&H.currentResource.uri}=V;H&&K&&await H.close(K)}}),$.registerCommand(o.EDITOR_COMMANDS.CLOSE_TO_RIGHT,{execute:async V=>{V=V||{};const{group:H=this.workbenchEditorService.currentEditorGroup,uri:K=H&&H.currentResource&&H.currentResource.uri}=V;H&&K&&await H.closeToRight(K)}}),$.registerCommand(o.EDITOR_COMMANDS.GET_CURRENT,{execute:()=>this.workbenchEditorService.currentEditorGroup}),$.registerCommand(o.EDITOR_COMMANDS.GET_CURRENT_RESOURCE,{execute:()=>this.workbenchEditorService.currentResource}),$.registerCommand(o.EDITOR_COMMANDS.PIN_CURRENT,{execute:()=>{const V=this.workbenchEditorService.currentEditorGroup;V&&V.pinPreviewed()}}),$.registerCommand(o.EDITOR_COMMANDS.COPY_CURRENT_PATH,{execute:()=>{const V=this.workbenchEditorService.currentResource;V&&V.uri.scheme===o.Schemes.file&&this.clipboardService.writeText(V.uri.codeUri.fsPath)}}),$.registerCommand(o.EDITOR_COMMANDS.SPLIT_TO_LEFT,{execute:async V=>{V=V||{};const{group:H=this.workbenchEditorService.currentEditorGroup,uri:K=H&&H.currentResource&&H.currentResource.uri}=V;H&&K&&await H.split(f.EditorGroupSplitAction.Left,K,{focus:!0})}}),$.registerCommand(o.EDITOR_COMMANDS.SPLIT_TO_RIGHT,{execute:async(V,H)=>{const{group:K,uri:Y}=this.extractGroupAndUriFromArgs(V,H);K&&Y&&await K.split(f.EditorGroupSplitAction.Right,Y,{focus:!0})}}),$.registerCommand(o.EDITOR_COMMANDS.GO_TO_GROUP,{execute:async(V=1)=>{var H;const K=this.workbenchEditorService.sortedEditorGroups[V-1];if(K){K.focus();return}const Y=this.workbenchEditorService.sortedEditorGroups.length;if(Y===V-1){const X=this.workbenchEditorService.sortedEditorGroups[Y-1],oe=(H=X?.currentResource)===null||H===void 0?void 0:H.uri;X&&oe&&await X.split(f.EditorGroupSplitAction.Right,oe,{focus:!0})}}}),$.registerCommand(o.EDITOR_COMMANDS.MOVE_GROUP,{execute:async V=>{if(V){const H=this.workbenchEditorService.currentEditorGroup;H&&H.grid.move(V)}}}),$.registerCommand(o.EDITOR_COMMANDS.FOCUS_ACTIVE_EDITOR_GROUP,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;V&&V.focus()}}),$.registerCommand(o.EDITOR_COMMANDS.SPLIT_TO_TOP,{execute:async V=>{V=V||{};const{group:H=this.workbenchEditorService.currentEditorGroup,uri:K=H&&H.currentResource&&H.currentResource.uri}=V;H&&K&&await H.split(f.EditorGroupSplitAction.Top,K,{focus:!0})}}),$.registerCommand(o.EDITOR_COMMANDS.SPLIT_TO_BOTTOM,{execute:async V=>{V=V||{};const{group:H=this.workbenchEditorService.currentEditorGroup,uri:K=H&&H.currentResource&&H.currentResource.uri}=V;H&&K&&await H.split(f.EditorGroupSplitAction.Bottom,K,{focus:!0})}}),$.registerCommand(o.EDITOR_COMMANDS.CHANGE_LANGUAGE,{execute:async V=>{const K=this.languagesService.languages.map(X=>({label:X.name,value:X.id,description:`(${X.id})`})),Y=await this.quickPickService.show(K,{placeholder:(0,o.localize)("editor.changeLanguageId"),selectIndex:()=>K.findIndex(X=>{var oe,ie;return X.value===((ie=(oe=this.workbenchEditorService.currentCodeEditor)===null||oe===void 0?void 0:oe.currentDocumentModel)===null||ie===void 0?void 0:ie.languageId)})});if(Y&&V!==Y&&this.workbenchEditorService.currentEditor){const X=this.workbenchEditorService.currentEditor.currentDocumentModel;X&&this.editorDocumentModelService.changeModelOptions(X.uri,{languageId:Y})}}}),$.registerCommand(o.EDITOR_COMMANDS.GET_ENCODING,{execute:V=>{if(!V)return;const H=this.editorDocumentModelService.getModelDescription(V);if(H)return H.encoding}}),$.registerCommand(o.EDITOR_COMMANDS.CHANGE_ENCODING,{execute:async V=>{var H,K,Y,X;V=V??((H=this.workbenchEditorService.currentResource)===null||H===void 0?void 0:H.uri);const oe=(K=this.workbenchEditorService.currentEditor)===null||K===void 0?void 0:K.currentDocumentModel;if(!V)return;const ie=this.preferenceService.get("files.encoding","utf8",V.toString(),(0,o.getLanguageIdFromMonaco)(V)),he=await this.contentRegistry.getProvider(V),me=await((Y=he?.guessEncoding)===null||Y===void 0?void 0:Y.call(he,V)),q=this.editorDocumentModelService.getModelDescription(V),Ee=(X=oe?.encoding)!==null&&X!==void 0?X:q?.encoding;let ue;const te=Object.keys(o.SUPPORTED_ENCODINGS).sort((Me,Be)=>Me===ie?-1:Be===ie?1:o.SUPPORTED_ENCODINGS[Me].order-o.SUPPORTED_ENCODINGS[Be].order).filter(Me=>Me===me&&me!==ie?!1:!o.SUPPORTED_ENCODINGS[Me].encodeOnly).map((Me,Be)=>((Me===Ee||o.SUPPORTED_ENCODINGS[Me].alias===Ee)&&(ue=Be),{label:o.SUPPORTED_ENCODINGS[Me].labelLong,value:Me,description:Me}));me&&ie!==me&&o.SUPPORTED_ENCODINGS[me]&&(te[0]&&(te[0].showBorder=!0),te.unshift({label:o.SUPPORTED_ENCODINGS[me].labelLong,value:me,description:(0,o.localize)("editor.guessEncodingFromContent")}),typeof ue=="number"&&ue++);const fe=await this.quickPickService.show(te,{placeholder:(0,o.localize)("editor.chooseEncoding"),selectIndex(Me){return Me?-1:typeof ue=="number"?ue:-1}});if(!fe)return;const Ie=[];if(V.scheme===f.DIFF_SCHEME){const Me=await this.resourceService.getResource(V);Me.metadata&&(Ie.push(Me.metadata.original),Ie.push(Me.metadata.modified))}else Ie.push(V);Ie.forEach(Me=>{this.editorDocumentModelService.changeModelOptions(Me,{encoding:fe})})}}),$.registerCommand(o.EDITOR_COMMANDS.CHANGE_EOL,{execute:async()=>{const V=this.workbenchEditorService.currentResource,H=this.workbenchEditorService.currentCodeEditor;if(H&&H.currentDocumentModel&&V){const K=await this.quickPickService.show([{label:"LF",value:`
31951
31951
  `},{label:"CRLF",value:`\r
31952
31952
  `}],{placeholder:(0,o.localize)("editor.changeEol"),selectIndex:()=>H.currentDocumentModel.eol===`
31953
- `?0:1});K&&this.editorDocumentModelService.changeModelOptions(V.uri,{eol:K})}}}),$.registerCommand(o.EDITOR_COMMANDS.FOCUS,{execute:async()=>{this.workbenchEditorService.currentEditor&&this.workbenchEditorService.currentEditor.monacoEditor.focus()}}),$.registerCommand(o.EDITOR_COMMANDS.NAVIGATE_NEXT,{execute:async()=>{let V=this.workbenchEditorService.currentEditorGroup.index+1;return this.workbenchEditorService.editorGroups.length<=V&&(V=0),this.workbenchEditorService.sortedEditorGroups[V].focus()}}),$.registerCommand(o.EDITOR_COMMANDS.NAVIGATE_PREVIOUS,{execute:async()=>{let V=this.workbenchEditorService.currentEditorGroup.index-1;return V<0&&(V=this.workbenchEditorService.editorGroups.length-1),this.workbenchEditorService.sortedEditorGroups[V].focus()}}),$.registerCommand(o.EDITOR_COMMANDS.NAVIGATE_UP,{execute:async()=>{const H=this.workbenchEditorService.currentEditorGroup.grid.findGird(f.Direction.UP);if(H)return H.editorGroup.focus()}}),$.registerCommand(o.EDITOR_COMMANDS.NAVIGATE_DOWN,{execute:async()=>{const H=this.workbenchEditorService.currentEditorGroup.grid.findGird(f.Direction.DOWN);if(H)return H.editorGroup.focus()}}),$.registerCommand(o.EDITOR_COMMANDS.NAVIGATE_LEFT,{execute:async()=>{const H=this.workbenchEditorService.currentEditorGroup.grid.findGird(f.Direction.LEFT);if(H)return H.editorGroup.focus()}}),$.registerCommand(o.EDITOR_COMMANDS.NAVIGATE_RIGHT,{execute:async()=>{const H=this.workbenchEditorService.currentEditorGroup.grid.findGird(f.Direction.RIGHT);if(H)return H.editorGroup.focus()}}),$.registerCommand(o.EDITOR_COMMANDS.PREVIOUS_IN_GROUP,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;if(!V.currentResource)return;const H=V.resources.findIndex(K=>K.uri.isEqual(V.currentResource.uri))-1;return V.resources[H]?V.open(V.resources[H].uri,{focus:!0}):V.open(V.resources[0].uri,{focus:!0})}}),$.registerCommand(o.EDITOR_COMMANDS.NEXT_IN_GROUP,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;if(!V.currentResource)return;const H=V.resources.findIndex(K=>K.uri.isEqual(V.currentResource.uri))+1;return V.resources[H]?V.open(V.resources[H].uri,{focus:!0}):V.open(V.resources[V.resources.length-1].uri,{focus:!0})}}),$.registerCommand(o.EDITOR_COMMANDS.NEXT,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;if(!V.currentResource)return;const H=V.resources.findIndex(K=>K.uri.isEqual(V.currentResource.uri))+1;if(V.resources[H])return V.open(V.resources[H].uri,{focus:!0});{const K=V.index===this.workbenchEditorService.editorGroups.length-1?0:V.index+1,Y=this.workbenchEditorService.sortedEditorGroups[K];return Y.focus(),Y.open(Y.resources[0].uri,{focus:!0})}}}),$.registerCommand(o.EDITOR_COMMANDS.PREVIOUS,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;if(!V.currentResource)return;const H=V.resources.findIndex(K=>K.uri.isEqual(V.currentResource.uri))-1;if(V.resources[H])return V.open(V.resources[H].uri,{focus:!0});{const K=V.index===0?this.workbenchEditorService.editorGroups.length-1:V.index-1,Y=this.workbenchEditorService.sortedEditorGroups[K];return Y.focus(),Y.open(Y.resources[Y.resources.length-1].uri,{focus:!0})}}}),$.registerCommand(o.EDITOR_COMMANDS.LAST_IN_GROUP,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;if(V.resources.length>0)return V.open(V.resources[V.resources.length-1].uri,{focus:!0})}}),$.registerCommand(o.EDITOR_COMMANDS.EVEN_EDITOR_GROUPS,{execute:async()=>{this.injector.get(o.IEventBus).fire(new B.EditorGroupsResetSizeEvent)}}),$.registerCommand(o.EDITOR_COMMANDS.CLOSE_OTHER_GROUPS,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;this.workbenchEditorService.editorGroups.filter(K=>K!==V).forEach(K=>{K.dispose()})}}),$.registerCommand(o.EDITOR_COMMANDS.OPEN_EDITOR_AT_INDEX,{execute:async V=>{const H=this.workbenchEditorService.currentEditorGroup,K=H.resources[V];K&&await H.open(K.uri,{focus:!0})}}),$.registerCommand(o.EDITOR_COMMANDS.REVERT_DOCUMENT,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;if(V.isCodeEditorMode()){const H=V.codeEditor.currentDocumentModel;H&&await H.revert()}}}),$.registerCommand(o.EDITOR_COMMANDS.REVERT_AND_CLOSE,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;if(V.isCodeEditorMode()){const H=V.codeEditor.currentDocumentModel;H&&await H.revert(),V.close(V.currentResource.uri)}}}),$.registerCommand(o.EDITOR_COMMANDS.SAVE_ALL,{execute:async V=>{this.workbenchEditorService.saveAll(void 0,V)}}),$.registerCommand(o.EDITOR_COMMANDS.CLOSE_ALL,{execute:async V=>{this.workbenchEditorService.closeAll(V)}}),$.registerCommand(o.EDITOR_COMMANDS.REOPEN_CLOSED,{execute:async()=>{this.historyService.popClosed()}}),$.registerCommand(o.EDITOR_COMMANDS.NEW_UNTITLED_FILE,{execute:()=>{this.workbenchEditorService.createUntitledResource()}}),$.registerCommand(o.EDITOR_COMMANDS.COMPONENT_UNDO,{execute:()=>{this.workbenchEditorService.currentEditorGroup.componentUndo()}}),$.registerCommand(o.EDITOR_COMMANDS.COMPONENT_REDO,{execute:()=>{this.workbenchEditorService.currentEditorGroup.componentRedo()}}),$.registerCommand(o.EDITOR_COMMANDS.TEST_TOKENIZE,{execute:()=>{const V=this.workbenchEditorService.currentCodeEditor;if(V){const H=V.getSelections();if(H&&H.length>0&&V.currentDocumentModel){const{selectionStartLineNumber:K,selectionStartColumn:Y,positionLineNumber:X,positionColumn:oe}=H[0],ie=V.currentDocumentModel.getText(new h.Range(K,Y,X,oe));this.monacoService.testTokenize(ie,V.currentDocumentModel.languageId)}}}}),$.registerCommand(o.EDITOR_COMMANDS.SEARCH_WORKSPACE_SYMBOL,{execute:()=>this.prefixQuickOpenService.open("#")}),$.registerCommand(o.EDITOR_COMMANDS.SEARCH_WORKSPACE_SYMBOL_CLASS,{execute:()=>this.prefixQuickOpenService.open("##")}),$.registerCommand(o.EDITOR_COMMANDS.GO_TO_LINE,{execute:()=>this.prefixQuickOpenService.open(":")}),$.registerCommand(o.EDITOR_COMMANDS.TOGGLE_COLUMN_SELECTION,{execute:()=>{const V=this.preferenceService.get("editor.columnSelection");this.preferenceService.set("editor.columnSelection",!V,s.PreferenceScope.User)}}),$.registerCommand(o.EDITOR_COMMANDS.TOGGLE_WORD_WRAP,{execute:()=>{const V=this.preferenceService.get("editor.wordWrap");if(V){const H=["off","on"],K=H.indexOf(V)+1;K>-1&&this.preferenceService.set("editor.wordWrap",H[K%H.length],s.PreferenceScope.User)}}}),$.registerCommand(o.EDITOR_COMMANDS.FORMAT_DOCUMENT_WITH,{execute:async()=>{this.injector.get(I.DocumentFormatService).formatDocumentWith()}}),$.registerCommand(o.EDITOR_COMMANDS.FORMAT_SELECTION_WITH,{execute:async()=>{this.injector.get(I.DocumentFormatService).formatSelectionWith()}}),$.registerCommand({id:o.EDITOR_COMMANDS.VSCODE_OPEN_MULTI_DIFF_EDITOR_COMMAND_ID},{execute:async V=>{const H=[];for(const{originalUri:Y,modifiedUri:X}of V.resources)H.push(new y.MultiDiffEditorItem(Y?o.URI.from(Y):void 0,X?o.URI.from(X):void 0,X?o.URI.from(X):void 0));const K=o.URI.from(V.multiDiffSourceUri);this.multiDiffResolver.registerSources(K,H),await this.workbenchEditorService.open(K,{label:V.title})}})}registerMenus($){$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.COPY_PATH.id,group:"10_path",order:1}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.COPY_RELATIVE_PATH.id,group:"10_path",order:2}),$.registerMenuItem(p.MenuId.BreadcrumbsTitleContext,{command:o.EDITOR_COMMANDS.COPY_PATH.id,group:"0_path",order:1}),$.registerMenuItem(p.MenuId.BreadcrumbsTitleContext,{command:o.EDITOR_COMMANDS.COPY_RELATIVE_PATH.id,group:"0_path",order:2}),$.registerMenuItem(p.MenuId.BreadcrumbsTitleContext,{command:{id:o.FILE_COMMANDS.REVEAL_IN_EXPLORER.id,label:(0,o.localize)("file.revealInExplorer")},group:"1_file",order:3}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:{id:o.FILE_COMMANDS.REVEAL_IN_EXPLORER.id,label:(0,o.localize)("file.revealInExplorer")},group:"6_file",order:3}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.SPLIT_TO_LEFT.id,group:"9_split"}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.SPLIT_TO_RIGHT.id,group:"9_split"}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.SPLIT_TO_TOP.id,group:"9_split"}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.SPLIT_TO_BOTTOM.id,group:"9_split"}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:{id:o.EDITOR_COMMANDS.CLOSE.id,label:(0,o.localize)("editor.title.context.close")},group:"0_tab",order:1}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.CLOSE_ALL_IN_GROUP.id,group:"0_tab",order:2}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.CLOSE_SAVED.id,group:"0_tab",order:3}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.CLOSE_OTHER_IN_GROUP.id,group:"0_tab",order:4}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.CLOSE_TO_RIGHT.id,group:"0_tab",order:5}),$.registerMenuItem(p.MenuId.EditorTitle,{command:o.EDITOR_COMMANDS.CLOSE_ALL_IN_GROUP.id,group:"0_internal"}),$.registerMenuItem(p.MenuId.EditorTitle,{command:o.EDITOR_COMMANDS.SPLIT_TO_RIGHT.id,iconClass:(0,o.getIcon)("embed"),group:"navigation",when:"resource",order:5}),$.registerMenuItem(p.MenuId.EditorContext,{command:o.EDITOR_COMMANDS.FORMAT_DOCUMENT_WITH.id,group:"1_modification",order:1.3,when:d.ContextKeyExpr.and(u.EditorContextKeys.writable,u.EditorContextKeys.hasMultipleDocumentFormattingProvider)}),$.registerMenuItem(p.MenuId.EditorContext,{command:o.EDITOR_COMMANDS.FORMAT_SELECTION_WITH.id,when:d.ContextKeyExpr.and(u.EditorContextKeys.writable,u.EditorContextKeys.hasMultipleDocumentSelectionFormattingProvider,u.EditorContextKeys.hasNonEmptySelection),group:"1_modification",order:1.31})}registerOpener($){$.registerOpener(this.editorOpener)}registerQuickOpenHandlers($){$.registerHandler(this.workspaceSymbolQuickOpenHandler,{title:(0,o.localize)("quickopen.tab.symbol"),order:3,commandId:o.EDITOR_COMMANDS.SEARCH_WORKSPACE_SYMBOL.id,sub:{"#":{title:(0,o.localize)("quickopen.tab.class"),order:2,commandId:o.EDITOR_COMMANDS.SEARCH_WORKSPACE_SYMBOL_CLASS.id}}}),$.registerHandler(this.goToLineQuickOpenHandler,{title:(0,o.localize)("quickopen.tab.goToLine"),commandId:o.EDITOR_COMMANDS.GO_TO_LINE.id,order:5})}};t.EditorContribution=Q,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],Q.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],Q.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(f.WorkbenchEditorService),n.__metadata("design:type",j.WorkbenchEditorServiceImpl)],Q.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",T.EditorStatusBarService)],Q.prototype,"editorStatusBarService",void 0),n.__decorate([(0,r.Autowired)(o.QuickPickService),n.__metadata("design:type",Object)],Q.prototype,"quickPickService",void 0),n.__decorate([(0,r.Autowired)(f.ILanguageService),n.__metadata("design:type",Object)],Q.prototype,"languagesService",void 0),n.__decorate([(0,r.Autowired)(A.IEditorDocumentModelService),n.__metadata("design:type",Object)],Q.prototype,"editorDocumentModelService",void 0),n.__decorate([(0,r.Autowired)(f.IDocPersistentCacheProvider),n.__metadata("design:type",Object)],Q.prototype,"cacheProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",P.EditorHistoryService)],Q.prototype,"historyService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",o.MonacoService)],Q.prototype,"monacoService",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],Q.prototype,"openerService",void 0),n.__decorate([(0,r.Autowired)(s.ILogger),n.__metadata("design:type",Object)],Q.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",S.EditorOpener)],Q.prototype,"editorOpener",void 0),n.__decorate([(0,r.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],Q.prototype,"clipboardService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",L.WorkspaceSymbolQuickOpenHandler)],Q.prototype,"workspaceSymbolQuickOpenHandler",void 0),n.__decorate([(0,r.Autowired)(o.PrefixQuickOpenService),n.__metadata("design:type",Object)],Q.prototype,"prefixQuickOpenService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",F.GoToLineQuickOpenHandler)],Q.prototype,"goToLineQuickOpenHandler",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],Q.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(l.ITextmateTokenizer),n.__metadata("design:type",Object)],Q.prototype,"textmateService",void 0),n.__decorate([(0,r.Autowired)(o.CorePreferences),n.__metadata("design:type",Object)],Q.prototype,"corePreferences",void 0),n.__decorate([(0,r.Autowired)(g.MergeEditorService),n.__metadata("design:type",g.MergeEditorService)],Q.prototype,"mergeEditorService",void 0),n.__decorate([(0,r.Autowired)(A.IEditorDocumentModelContentRegistry),n.__metadata("design:type",Object)],Q.prototype,"contentRegistry",void 0),n.__decorate([(0,r.Autowired)(o.IQuickInputService),n.__metadata("design:type",Object)],Q.prototype,"quickInputService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],Q.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(f.ResourceService),n.__metadata("design:type",f.ResourceService)],Q.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(v.AbstractContextMenuService),n.__metadata("design:type",v.AbstractContextMenuService)],Q.prototype,"contextMenuService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],Q.prototype,"globalContextKeyService",void 0),n.__decorate([(0,r.Autowired)(m.ICtxMenuRenderer),n.__metadata("design:type",m.ICtxMenuRenderer)],Q.prototype,"contextMenuRenderer",void 0),n.__decorate([(0,r.Autowired)(x.MultiDiffResolver),n.__metadata("design:type",x.MultiDiffResolver)],Q.prototype,"multiDiffResolver",void 0),t.EditorContribution=Q=n.__decorate([(0,o.Domain)(o.CommandContribution,o.ClientAppContribution,o.KeybindingContribution,o.MonacoContribution,a.ComponentContribution,p.MenuContribution,o.OpenerContribution,o.QuickOpenContribution)],Q);let G=class{registerEditorFeature($){$.registerEditorFeatureContribution({contribute:V=>{const H=new o.Disposable;return H.addDispose(V.monacoEditor.onDidBlurEditorWidget(()=>{this.preferenceService.get("editor.autoSave")===c.AUTO_SAVE_MODE.EDITOR_FOCUS_CHANGE&&V.currentDocumentModel&&!V.currentDocumentModel.closeAutoSave&&V.currentDocumentModel.dirty&&V.currentDocumentModel.savable&&V.currentDocumentModel.save(void 0,f.SaveReason.FocusOut)})),H.addDispose(V.monacoEditor.onDidChangeModel(K=>{if(this.preferenceService.get("editor.autoSave")===c.AUTO_SAVE_MODE.EDITOR_FOCUS_CHANGE&&K.oldModelUrl){const Y=new o.URI(K.oldModelUrl.toString()),X=this.editorDocumentService.getModelReference(Y,"editor-focus-autosave");X&&!X.instance.closeAutoSave&&X.instance.dirty&&X.instance.savable&&X.instance.save(void 0,f.SaveReason.FocusOut),X?.dispose()}})),H}}),window.addEventListener("blur",()=>{this.preferenceService.get("editor.autoSave")===c.AUTO_SAVE_MODE.WINDOWS_LOST_FOCUS&&this.commandService.executeCommand(o.EDITOR_COMMANDS.SAVE_ALL.id,f.SaveReason.FocusOut)}),this.preferenceSettings.setEnumLabels("editor.autoSave",{[c.AUTO_SAVE_MODE.OFF]:(0,o.localize)("editor.autoSave.enum.off"),[c.AUTO_SAVE_MODE.AFTER_DELAY]:(0,o.localize)("editor.autoSave.enum.afterDelay"),[c.AUTO_SAVE_MODE.EDITOR_FOCUS_CHANGE]:(0,o.localize)("editor.autoSave.enum.editorFocusChange"),[c.AUTO_SAVE_MODE.WINDOWS_LOST_FOCUS]:(0,o.localize)("editor.autoSave.enum.windowLostFocus")}),$.registerEditorFeatureContribution(new W.EditorTopPaddingContribution),$.registerEditorFeatureContribution(this.injector.get(U.EditorSuggestWidgetContribution)),this.registerAutoSaveConfigurationChange()}registerAutoSaveConfigurationChange(){this.preferenceService.onSpecificPreferenceChange("editor.autoSave",$=>{const V=$.newValue;if(V!==c.AUTO_SAVE_MODE.OFF){let H=f.SaveReason.FocusOut;V===c.AUTO_SAVE_MODE.AFTER_DELAY&&(H=f.SaveReason.AfterDelay);for(const K of this.workbenchEditorService.editorGroups)for(const Y of K.resources)$.affects(Y?.uri.toString())&&K.saveResource(Y,H)}})}registerCommands($){$.registerCommand(o.EDITOR_COMMANDS.AUTO_SAVE,{execute:()=>{const V="editor.autoSave",H=this.preferenceSettings.getPreference(V,s.PreferenceScope.User).value||c.AUTO_SAVE_MODE.OFF,K=[c.AUTO_SAVE_MODE.AFTER_DELAY,c.AUTO_SAVE_MODE.EDITOR_FOCUS_CHANGE,c.AUTO_SAVE_MODE.WINDOWS_LOST_FOCUS].includes(H)?c.AUTO_SAVE_MODE.OFF:c.AUTO_SAVE_MODE.AFTER_DELAY;return this.preferenceSettings.setPreference(V,K,s.PreferenceScope.User)}}),$.registerCommand(o.EDITOR_COMMANDS.COPY_PATH,{execute:V=>{V&&this.commandService.executeCommand(o.FILE_COMMANDS.COPY_PATH.id,V.uri)}}),$.registerCommand(o.EDITOR_COMMANDS.COPY_RELATIVE_PATH,{execute:V=>{V&&this.commandService.executeCommand(o.FILE_COMMANDS.COPY_RELATIVE_PATH.id,V.uri)}})}};t.EditorAutoSaveEditorContribution=G,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],G.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],G.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(f.WorkbenchEditorService),n.__metadata("design:type",j.WorkbenchEditorServiceImpl)],G.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],G.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(A.IEditorDocumentModelService),n.__metadata("design:type",Object)],G.prototype,"editorDocumentService",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],G.prototype,"preferenceSettings",void 0),t.EditorAutoSaveEditorContribution=G=n.__decorate([(0,o.Domain)(B.BrowserEditorContribution,o.CommandContribution)],G)},2863:(M,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorDecorationCollectionService=void 0;const r=e(85608),o=e(76003),a=e(41869),p=e(52416),v=e(10045),m=e(82196);let _=n=class{constructor(){this.decorations=new Map,this.tempId=0,this.decorationProviders=new Map}getNextTempId(){return this.tempId++,"temp-decoration-"+this.tempId}createTextEditorDecorationType(g,l){l||(l=this.getNextTempId());const h=this.resolveDecoration(l,g),u={key:l,property:h,dispose:()=>{l&&this.decorations.has(l)&&(h.dispose(),this.decorations.delete(l),this.eventBus.fire(new m.EditorDecorationTypeRemovedEvent(l)))}};return this.decorations.set(l,u),u}getTextEditorDecorationType(g){return this.decorations.get(g)}resolveDecoration(g,l){const h=this.createThemeCSSStyleCollection(g,l);return{default:h.default,light:h.light,dark:h.dark,isWholeLine:l.isWholeLine||!1,overviewRulerLane:l.overviewRulerLane,dispose:()=>{h.dispose()}}}createThemeCSSStyleCollection(g,l){const h=new a.DisposableStore,d={default:this.addedThemeDecorationToCSSStyleSheet(g,l),light:null,dark:null,dispose:()=>{h.dispose()}};if(l.light){const E=this.addedThemeDecorationToCSSStyleSheet(g+"-light",l.light);d.light=E,h.add(E)}if(l.dark){const E=this.addedThemeDecorationToCSSStyleSheet(g+"-dark",l.dark);d.dark=E,h.add(E)}return d}addedThemeDecorationToCSSStyleSheet(g,l){const h=g,u=g+"-inline",d=new a.DisposableStore;let E,f,c;const y=this.createInlineBlockCSSStyleIfNeeded(),b=this.resolveCSSStyle(l),A=this.resolveInlineCSSStyle(l);if(d.add(this.cssManager.addClass(h,b)),d.add(this.cssManager.addClass(u,A)),l.after){const S=`${g}-after`,D=this.resolveContentCSSStyle(l.after);d.add(this.cssManager.addClass(S+"::after",D)),E=`${y} ${S}`}if(l.before){const S=`${g}-before`,D=this.resolveContentCSSStyle(l.before);d.add(this.cssManager.addClass(S+"::before",D)),f=`${y} ${S}`}if(l.gutterIconPath){const S=this.resolveCSSStyle({backgroundIconSize:l.gutterIconSize,backgroundIcon:l.gutterIconPath.toString()});c=g+"-glyphMargin",d.add(this.cssManager.addClass(c,S))}return{className:h,inlineClassName:u,afterContentClassName:E,beforeContentClassName:f,glyphMarginClassName:c,overviewRulerColor:l.overviewRulerColor,dispose(){return d.dispose()}}}resolveCSSStyle(g){var l;const h=!((l=g.backgroundIcon)===null||l===void 0)&&l.startsWith("data:")?this.iconService.encodeBase64Path(decodeURIComponent(g.backgroundIcon)):g.backgroundIcon;return{backgroundColor:this.themeService.getColorVar(g.backgroundColor),background:g.backgroundIcon?`url("${h}") center center no-repeat`:void 0,backgroundSize:g.backgroundIconSize?`${g.backgroundIconSize}`:void 0,outline:g.outline,outlineColor:g.outlineColor,outlineStyle:g.outlineStyle,outlineWidth:g.outlineWidth,border:g.border,borderColor:this.themeService.getColorVar(g.borderColor),borderRadius:g.borderRadius,borderSpacing:g.borderSpacing,borderStyle:g.borderStyle,borderWidth:g.borderWidth}}resolveInlineCSSStyle(g){return{fontStyle:g.fontStyle,fontWeight:g.fontWeight,textDecoration:g.textDecoration,textUnderlinePosition:g.textUnderlinePosition,cursor:g.cursor,color:this.themeService.getColorVar(g.color),opacity:g.opacity,letterSpacing:g.letterSpacing}}resolveContentCSSStyle(g){let l;return g.contentText?l=`"${g.contentText}"`:g.contentIconPath&&(l=`url('${a.URI.from(g.contentIconPath).toString(!0).replace(/'/g,"%27")}')`),{display:"block",content:l,border:g.border,borderColor:this.themeService.getColorVar(g.borderColor),fontStyle:g.fontStyle,fontWeight:g.fontWeight,textDecoration:g.textDecoration,color:this.themeService.getColorVar(g.color),backgroundColor:this.themeService.getColorVar(g.backgroundColor),margin:g.margin,width:g.width,height:g.height}}createInlineBlockCSSStyleIfNeeded(){return this.inlineBlockDecorationDisposer||(this.inlineBlockDecorationDisposer=this.cssManager.addClass(n.DISPLAY_INLINE_BLOCK_CLS,{display:"inline-block"})),n.DISPLAY_INLINE_BLOCK_CLS}registerDecorationProvider(g){this.decorationProviders.set(g.key,g),this.eventBus.fire(new m.EditorDecorationProviderRegistrationEvent(g));const l=g.onDidDecorationChange(h=>{this.eventBus.fire(new m.EditorDecorationChangeEvent({uri:h,key:g.key}))});return{dispose:()=>{this.decorationProviders.get(g.key)===g&&(this.decorationProviders.delete(g.key),this.eventBus.fire(new m.EditorDecorationTypeRemovedEvent(g.key))),l.dispose()}}}async getDecorationFromProvider(g,l){const h={};let u=[];return l?this.decorationProviders.has(l)&&u.push(this.decorationProviders.get(l)):u=Array.from(this.decorationProviders.values()),await Promise.all(u.map(async d=>{if(d.schemes&&d.schemes.indexOf(g.scheme)===-1)return;const E=await d.provideEditorDecoration(g);E&&(h[d.key]=E)})),h}};t.EditorDecorationCollectionService=_,_.DISPLAY_INLINE_BLOCK_CLS="display-inline-block-decoration",r.__decorate([(0,o.Autowired)(v.ICSSStyleService),r.__metadata("design:type",Object)],_.prototype,"cssManager",void 0),r.__decorate([(0,o.Autowired)(p.IThemeService),r.__metadata("design:type",Object)],_.prototype,"themeService",void 0),r.__decorate([(0,o.Autowired)(p.IIconService),r.__metadata("design:type",Object)],_.prototype,"iconService",void 0),r.__decorate([(0,o.Autowired)(a.IEventBus),r.__metadata("design:type",Object)],_.prototype,"eventBus",void 0),t.EditorDecorationCollectionService=_=n=r.__decorate([(0,o.Injectable)()],_)},93152:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MonacoContextViewService=t.MonacoCodeService=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=n.__importStar(e(20868)),v=e(76947),m=e(18099),_=e(79731),s=e(16781),g=e(7760),l=e(26917),h=e(23418),u=e(51553);let d=class extends m.AbstractCodeEditorService{constructor(){super(s.StandaloneServices.get(g.IStandaloneThemeService))}getActiveCodeEditor(){return this.workbenchEditorService.currentEditor?this.workbenchEditorService.currentEditor.monacoEditor:null}async openCodeEditor(c,y,b){var A,S,D,T,w,I;const R=c.resource;if(!this.preferenceService.get("editor.enablePreviewFromCodeNavigation")&&y&&!b&&(0,v.isEqual)((A=y.getModel())===null||A===void 0?void 0:A.uri,c.resource)){for(const B of this.workbenchEditorService.editorGroups)if(((S=B.currentOpenType)===null||S===void 0?void 0:S.type)===h.EditorOpenType.code){if(((D=B.currentEditor)===null||D===void 0?void 0:D.monacoEditor)===y){B.pinPreviewed((T=B.currentResource)===null||T===void 0?void 0:T.uri);break}}else if(((w=B.currentOpenType)===null||w===void 0?void 0:w.type)===h.EditorOpenType.diff&&(B.diffEditor.modifiedEditor.monacoEditor===y||B.diffEditor.originalEditor.monacoEditor===y)){B.pinPreviewed((I=B.currentResource)===null||I===void 0?void 0:I.uri);break}}let O=this.workbenchEditorService.currentEditorGroup,x;y&&(O=this.workbenchEditorService.editorGroups.find(B=>B.currentEditor&&B.currentEditor.monacoEditor===y)||O,x=O.resources.findIndex(B=>O.currentResource&&B.uri===O.currentResource.uri),x>=0&&x++);const k=c.options?c.options.selection:null;let F;k&&(typeof k.endLineNumber=="number"&&typeof k.endColumn=="number"?F=k:F=new p.Range(k.startLineNumber,k.startColumn,k.startLineNumber,k.startColumn));const L=a.URI.parse(R.toString());return await O.open(L,{index:x,range:F,focus:!0}),O.codeEditor.monacoEditor}};t.MonacoCodeService=d,n.__decorate([(0,r.Autowired)(h.WorkbenchEditorService),n.__metadata("design:type",u.WorkbenchEditorServiceImpl)],d.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],d.prototype,"preferenceService",void 0),t.MonacoCodeService=d=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],d);class E extends l.ContextViewService{constructor(c){super(new _.EditorScopedLayoutService(document.body,c))}setContainer(c){this.menuContainer||(this.menuContainer=document.createElement("div"),this.menuContainer.className=c.className,this.menuContainer.style.left="0",this.menuContainer.style.top="0",this.menuContainer.style.position="fixed",this.menuContainer.style.zIndex="10",document.body.append(this.menuContainer)),super.setContainer(this.menuContainer)}}t.MonacoContextViewService=E},8287:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorStatusBarService=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(26542),p=e(23418),v=e(96689);let m=class extends o.WithEventBus{setListener(){this.workbenchEditorService.onActiveResourceChange(()=>{this.updateLanguageStatus(this.workbenchEditorService.currentEditor)}),this.workbenchEditorService.onCursorChange(s=>{this.updateCursorStatus(s)}),this.eventBus.on(v.EditorDocumentModelOptionChangedEvent,s=>{const g=this.workbenchEditorService.currentEditor;g&&g.currentUri&&g.currentUri.isEqual(s.payload.uri)&&this.updateLanguageStatus(this.workbenchEditorService.currentEditor)})}updateCursorStatus(s){const{position:g,selectionLength:l}=s;if(!g){this.statusBar.removeElement("editor-status-cursor");return}this.statusBar.addElement("editor-status-cursor",{name:(0,o.localize)("status-bar.editor-selection"),text:`%status-bar.label.line%${g.lineNumber}\uFF0C%status-bar.label.column%${g.column}${l?`\uFF08%status-bar.label.selected%${l}\uFF09`:""}`,priority:4,alignment:a.StatusBarAlignment.RIGHT,command:o.EDITOR_COMMANDS.GO_TO_LINE.id,tooltip:(0,o.localize)("status.editor.goToLineCol")})}updateLanguageStatus(s){if(!s){this.statusBar.removeElement("editor-status-language"),this.statusBar.removeElement("editor-status-encoding"),this.statusBar.removeElement("editor-status-eol"),this.statusBar.removeElement("editor-status-space");return}let g="",l="",h="",u=!1,d=2;const E=s.currentDocumentModel;E&&(g=E.languageId,l=E.encoding,h=E.eol,u=E.getMonacoModel().getOptions().insertSpaces,d=E.getMonacoModel().getOptions().tabSize);const f=h===`
31953
+ `?0:1});K&&this.editorDocumentModelService.changeModelOptions(V.uri,{eol:K})}}}),$.registerCommand(o.EDITOR_COMMANDS.FOCUS,{execute:async()=>{this.workbenchEditorService.currentEditor&&this.workbenchEditorService.currentEditor.monacoEditor.focus()}}),$.registerCommand(o.EDITOR_COMMANDS.NAVIGATE_NEXT,{execute:async()=>{let V=this.workbenchEditorService.currentEditorGroup.index+1;return this.workbenchEditorService.editorGroups.length<=V&&(V=0),this.workbenchEditorService.sortedEditorGroups[V].focus()}}),$.registerCommand(o.EDITOR_COMMANDS.NAVIGATE_PREVIOUS,{execute:async()=>{let V=this.workbenchEditorService.currentEditorGroup.index-1;return V<0&&(V=this.workbenchEditorService.editorGroups.length-1),this.workbenchEditorService.sortedEditorGroups[V].focus()}}),$.registerCommand(o.EDITOR_COMMANDS.NAVIGATE_UP,{execute:async()=>{const H=this.workbenchEditorService.currentEditorGroup.grid.findGird(f.Direction.UP);if(H)return H.editorGroup.focus()}}),$.registerCommand(o.EDITOR_COMMANDS.NAVIGATE_DOWN,{execute:async()=>{const H=this.workbenchEditorService.currentEditorGroup.grid.findGird(f.Direction.DOWN);if(H)return H.editorGroup.focus()}}),$.registerCommand(o.EDITOR_COMMANDS.NAVIGATE_LEFT,{execute:async()=>{const H=this.workbenchEditorService.currentEditorGroup.grid.findGird(f.Direction.LEFT);if(H)return H.editorGroup.focus()}}),$.registerCommand(o.EDITOR_COMMANDS.NAVIGATE_RIGHT,{execute:async()=>{const H=this.workbenchEditorService.currentEditorGroup.grid.findGird(f.Direction.RIGHT);if(H)return H.editorGroup.focus()}}),$.registerCommand(o.EDITOR_COMMANDS.PREVIOUS_IN_GROUP,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;if(!V.currentResource)return;const H=V.resources.findIndex(K=>K.uri.isEqual(V.currentResource.uri))-1;return V.resources[H]?V.open(V.resources[H].uri,{focus:!0}):V.open(V.resources[0].uri,{focus:!0})}}),$.registerCommand(o.EDITOR_COMMANDS.NEXT_IN_GROUP,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;if(!V.currentResource)return;const H=V.resources.findIndex(K=>K.uri.isEqual(V.currentResource.uri))+1;return V.resources[H]?V.open(V.resources[H].uri,{focus:!0}):V.open(V.resources[V.resources.length-1].uri,{focus:!0})}}),$.registerCommand(o.EDITOR_COMMANDS.NEXT,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;if(!V.currentResource)return;const H=V.resources.findIndex(K=>K.uri.isEqual(V.currentResource.uri))+1;if(V.resources[H])return V.open(V.resources[H].uri,{focus:!0});{const K=V.index===this.workbenchEditorService.editorGroups.length-1?0:V.index+1,Y=this.workbenchEditorService.sortedEditorGroups[K];return Y.focus(),Y.open(Y.resources[0].uri,{focus:!0})}}}),$.registerCommand(o.EDITOR_COMMANDS.PREVIOUS,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;if(!V.currentResource)return;const H=V.resources.findIndex(K=>K.uri.isEqual(V.currentResource.uri))-1;if(V.resources[H])return V.open(V.resources[H].uri,{focus:!0});{const K=V.index===0?this.workbenchEditorService.editorGroups.length-1:V.index-1,Y=this.workbenchEditorService.sortedEditorGroups[K];return Y.focus(),Y.open(Y.resources[Y.resources.length-1].uri,{focus:!0})}}}),$.registerCommand(o.EDITOR_COMMANDS.LAST_IN_GROUP,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;if(V.resources.length>0)return V.open(V.resources[V.resources.length-1].uri,{focus:!0})}}),$.registerCommand(o.EDITOR_COMMANDS.EVEN_EDITOR_GROUPS,{execute:async()=>{this.injector.get(o.IEventBus).fire(new B.EditorGroupsResetSizeEvent)}}),$.registerCommand(o.EDITOR_COMMANDS.CLOSE_OTHER_GROUPS,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;this.workbenchEditorService.editorGroups.filter(K=>K!==V).forEach(K=>{K.dispose()})}}),$.registerCommand(o.EDITOR_COMMANDS.OPEN_EDITOR_AT_INDEX,{execute:async V=>{const H=this.workbenchEditorService.currentEditorGroup,K=H.resources[V];K&&await H.open(K.uri,{focus:!0})}}),$.registerCommand(o.EDITOR_COMMANDS.REVERT_DOCUMENT,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;if(V.isCodeEditorMode()){const H=V.codeEditor.currentDocumentModel;H&&await H.revert()}}}),$.registerCommand(o.EDITOR_COMMANDS.REVERT_AND_CLOSE,{execute:async()=>{const V=this.workbenchEditorService.currentEditorGroup;if(V.isCodeEditorMode()){const H=V.codeEditor.currentDocumentModel;H&&await H.revert(),V.close(V.currentResource.uri)}}}),$.registerCommand(o.EDITOR_COMMANDS.SAVE_ALL,{execute:async V=>{this.workbenchEditorService.saveAll(void 0,V)}}),$.registerCommand(o.EDITOR_COMMANDS.CLOSE_ALL,{execute:async V=>{this.workbenchEditorService.closeAll(V)}}),$.registerCommand(o.EDITOR_COMMANDS.REOPEN_CLOSED,{execute:async()=>{this.historyService.popClosed()}}),$.registerCommand(o.EDITOR_COMMANDS.NEW_UNTITLED_FILE,{execute:()=>{this.workbenchEditorService.createUntitledResource()}}),$.registerCommand(o.EDITOR_COMMANDS.COMPONENT_UNDO,{execute:()=>{this.workbenchEditorService.currentEditorGroup.componentUndo()}}),$.registerCommand(o.EDITOR_COMMANDS.COMPONENT_REDO,{execute:()=>{this.workbenchEditorService.currentEditorGroup.componentRedo()}}),$.registerCommand(o.EDITOR_COMMANDS.TEST_TOKENIZE,{execute:()=>{const V=this.workbenchEditorService.currentCodeEditor;if(V){const H=V.getSelections();if(H&&H.length>0&&V.currentDocumentModel){const{selectionStartLineNumber:K,selectionStartColumn:Y,positionLineNumber:X,positionColumn:oe}=H[0],ie=V.currentDocumentModel.getText(new h.Range(K,Y,X,oe));this.monacoService.testTokenize(ie,V.currentDocumentModel.languageId)}}}}),$.registerCommand(o.EDITOR_COMMANDS.SEARCH_WORKSPACE_SYMBOL,{execute:()=>this.prefixQuickOpenService.open("#")}),$.registerCommand(o.EDITOR_COMMANDS.SEARCH_WORKSPACE_SYMBOL_CLASS,{execute:()=>this.prefixQuickOpenService.open("##")}),$.registerCommand(o.EDITOR_COMMANDS.GO_TO_LINE,{execute:()=>this.prefixQuickOpenService.open(":")}),$.registerCommand(o.EDITOR_COMMANDS.TOGGLE_COLUMN_SELECTION,{execute:()=>{const V=this.preferenceService.get("editor.columnSelection");this.preferenceService.set("editor.columnSelection",!V,s.PreferenceScope.User)}}),$.registerCommand(o.EDITOR_COMMANDS.TOGGLE_WORD_WRAP,{execute:()=>{const V=this.preferenceService.get("editor.wordWrap");if(V){const H=["off","on"],K=H.indexOf(V)+1;K>-1&&this.preferenceService.set("editor.wordWrap",H[K%H.length],s.PreferenceScope.User)}}}),$.registerCommand(o.EDITOR_COMMANDS.FORMAT_DOCUMENT_WITH,{execute:async()=>{this.injector.get(I.DocumentFormatService).formatDocumentWith()}}),$.registerCommand(o.EDITOR_COMMANDS.FORMAT_SELECTION_WITH,{execute:async()=>{this.injector.get(I.DocumentFormatService).formatSelectionWith()}}),$.registerCommand({id:o.EDITOR_COMMANDS.VSCODE_OPEN_MULTI_DIFF_EDITOR_COMMAND_ID},{execute:async V=>{const H=[];for(const{originalUri:Y,modifiedUri:X}of V.resources)H.push(new y.MultiDiffEditorItem(Y?o.URI.from(Y):void 0,X?o.URI.from(X):void 0,X?o.URI.from(X):void 0));const K=o.URI.from(V.multiDiffSourceUri);this.multiDiffResolver.registerSources(K,H),await this.workbenchEditorService.open(K,{label:V.title,...V.editorOptions})}})}registerMenus($){$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.COPY_PATH.id,group:"10_path",order:1}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.COPY_RELATIVE_PATH.id,group:"10_path",order:2}),$.registerMenuItem(p.MenuId.BreadcrumbsTitleContext,{command:o.EDITOR_COMMANDS.COPY_PATH.id,group:"0_path",order:1}),$.registerMenuItem(p.MenuId.BreadcrumbsTitleContext,{command:o.EDITOR_COMMANDS.COPY_RELATIVE_PATH.id,group:"0_path",order:2}),$.registerMenuItem(p.MenuId.BreadcrumbsTitleContext,{command:{id:o.FILE_COMMANDS.REVEAL_IN_EXPLORER.id,label:(0,o.localize)("file.revealInExplorer")},group:"1_file",order:3}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:{id:o.FILE_COMMANDS.REVEAL_IN_EXPLORER.id,label:(0,o.localize)("file.revealInExplorer")},group:"6_file",order:3}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.SPLIT_TO_LEFT.id,group:"9_split"}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.SPLIT_TO_RIGHT.id,group:"9_split"}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.SPLIT_TO_TOP.id,group:"9_split"}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.SPLIT_TO_BOTTOM.id,group:"9_split"}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:{id:o.EDITOR_COMMANDS.CLOSE.id,label:(0,o.localize)("editor.title.context.close")},group:"0_tab",order:1}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.CLOSE_ALL_IN_GROUP.id,group:"0_tab",order:2}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.CLOSE_SAVED.id,group:"0_tab",order:3}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.CLOSE_OTHER_IN_GROUP.id,group:"0_tab",order:4}),$.registerMenuItem(p.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.CLOSE_TO_RIGHT.id,group:"0_tab",order:5}),$.registerMenuItem(p.MenuId.EditorTitle,{command:o.EDITOR_COMMANDS.CLOSE_ALL_IN_GROUP.id,group:"0_internal"}),$.registerMenuItem(p.MenuId.EditorTitle,{command:o.EDITOR_COMMANDS.SPLIT_TO_RIGHT.id,iconClass:(0,o.getIcon)("embed"),group:"navigation",when:"resource",order:5}),$.registerMenuItem(p.MenuId.EditorContext,{command:o.EDITOR_COMMANDS.FORMAT_DOCUMENT_WITH.id,group:"1_modification",order:1.3,when:d.ContextKeyExpr.and(u.EditorContextKeys.writable,u.EditorContextKeys.hasMultipleDocumentFormattingProvider)}),$.registerMenuItem(p.MenuId.EditorContext,{command:o.EDITOR_COMMANDS.FORMAT_SELECTION_WITH.id,when:d.ContextKeyExpr.and(u.EditorContextKeys.writable,u.EditorContextKeys.hasMultipleDocumentSelectionFormattingProvider,u.EditorContextKeys.hasNonEmptySelection),group:"1_modification",order:1.31})}registerOpener($){$.registerOpener(this.editorOpener)}registerQuickOpenHandlers($){$.registerHandler(this.workspaceSymbolQuickOpenHandler,{title:(0,o.localize)("quickopen.tab.symbol"),order:3,commandId:o.EDITOR_COMMANDS.SEARCH_WORKSPACE_SYMBOL.id,sub:{"#":{title:(0,o.localize)("quickopen.tab.class"),order:2,commandId:o.EDITOR_COMMANDS.SEARCH_WORKSPACE_SYMBOL_CLASS.id}}}),$.registerHandler(this.goToLineQuickOpenHandler,{title:(0,o.localize)("quickopen.tab.goToLine"),commandId:o.EDITOR_COMMANDS.GO_TO_LINE.id,order:5})}};t.EditorContribution=Q,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],Q.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],Q.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(f.WorkbenchEditorService),n.__metadata("design:type",j.WorkbenchEditorServiceImpl)],Q.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",T.EditorStatusBarService)],Q.prototype,"editorStatusBarService",void 0),n.__decorate([(0,r.Autowired)(o.QuickPickService),n.__metadata("design:type",Object)],Q.prototype,"quickPickService",void 0),n.__decorate([(0,r.Autowired)(f.ILanguageService),n.__metadata("design:type",Object)],Q.prototype,"languagesService",void 0),n.__decorate([(0,r.Autowired)(A.IEditorDocumentModelService),n.__metadata("design:type",Object)],Q.prototype,"editorDocumentModelService",void 0),n.__decorate([(0,r.Autowired)(f.IDocPersistentCacheProvider),n.__metadata("design:type",Object)],Q.prototype,"cacheProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",P.EditorHistoryService)],Q.prototype,"historyService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",o.MonacoService)],Q.prototype,"monacoService",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],Q.prototype,"openerService",void 0),n.__decorate([(0,r.Autowired)(s.ILogger),n.__metadata("design:type",Object)],Q.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",S.EditorOpener)],Q.prototype,"editorOpener",void 0),n.__decorate([(0,r.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],Q.prototype,"clipboardService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",L.WorkspaceSymbolQuickOpenHandler)],Q.prototype,"workspaceSymbolQuickOpenHandler",void 0),n.__decorate([(0,r.Autowired)(o.PrefixQuickOpenService),n.__metadata("design:type",Object)],Q.prototype,"prefixQuickOpenService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",F.GoToLineQuickOpenHandler)],Q.prototype,"goToLineQuickOpenHandler",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],Q.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(l.ITextmateTokenizer),n.__metadata("design:type",Object)],Q.prototype,"textmateService",void 0),n.__decorate([(0,r.Autowired)(o.CorePreferences),n.__metadata("design:type",Object)],Q.prototype,"corePreferences",void 0),n.__decorate([(0,r.Autowired)(g.MergeEditorService),n.__metadata("design:type",g.MergeEditorService)],Q.prototype,"mergeEditorService",void 0),n.__decorate([(0,r.Autowired)(A.IEditorDocumentModelContentRegistry),n.__metadata("design:type",Object)],Q.prototype,"contentRegistry",void 0),n.__decorate([(0,r.Autowired)(o.IQuickInputService),n.__metadata("design:type",Object)],Q.prototype,"quickInputService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],Q.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(f.ResourceService),n.__metadata("design:type",f.ResourceService)],Q.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(v.AbstractContextMenuService),n.__metadata("design:type",v.AbstractContextMenuService)],Q.prototype,"contextMenuService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],Q.prototype,"globalContextKeyService",void 0),n.__decorate([(0,r.Autowired)(m.ICtxMenuRenderer),n.__metadata("design:type",m.ICtxMenuRenderer)],Q.prototype,"contextMenuRenderer",void 0),n.__decorate([(0,r.Autowired)(x.MultiDiffResolver),n.__metadata("design:type",x.MultiDiffResolver)],Q.prototype,"multiDiffResolver",void 0),t.EditorContribution=Q=n.__decorate([(0,o.Domain)(o.CommandContribution,o.ClientAppContribution,o.KeybindingContribution,o.MonacoContribution,a.ComponentContribution,p.MenuContribution,o.OpenerContribution,o.QuickOpenContribution)],Q);let G=class{registerEditorFeature($){$.registerEditorFeatureContribution({contribute:V=>{const H=new o.Disposable;return H.addDispose(V.monacoEditor.onDidBlurEditorWidget(()=>{this.preferenceService.get("editor.autoSave")===c.AUTO_SAVE_MODE.EDITOR_FOCUS_CHANGE&&V.currentDocumentModel&&!V.currentDocumentModel.closeAutoSave&&V.currentDocumentModel.dirty&&V.currentDocumentModel.savable&&V.currentDocumentModel.save(void 0,f.SaveReason.FocusOut)})),H.addDispose(V.monacoEditor.onDidChangeModel(K=>{if(this.preferenceService.get("editor.autoSave")===c.AUTO_SAVE_MODE.EDITOR_FOCUS_CHANGE&&K.oldModelUrl){const Y=new o.URI(K.oldModelUrl.toString()),X=this.editorDocumentService.getModelReference(Y,"editor-focus-autosave");X&&!X.instance.closeAutoSave&&X.instance.dirty&&X.instance.savable&&X.instance.save(void 0,f.SaveReason.FocusOut),X?.dispose()}})),H}}),window.addEventListener("blur",()=>{this.preferenceService.get("editor.autoSave")===c.AUTO_SAVE_MODE.WINDOWS_LOST_FOCUS&&this.commandService.executeCommand(o.EDITOR_COMMANDS.SAVE_ALL.id,f.SaveReason.FocusOut)}),this.preferenceSettings.setEnumLabels("editor.autoSave",{[c.AUTO_SAVE_MODE.OFF]:(0,o.localize)("editor.autoSave.enum.off"),[c.AUTO_SAVE_MODE.AFTER_DELAY]:(0,o.localize)("editor.autoSave.enum.afterDelay"),[c.AUTO_SAVE_MODE.EDITOR_FOCUS_CHANGE]:(0,o.localize)("editor.autoSave.enum.editorFocusChange"),[c.AUTO_SAVE_MODE.WINDOWS_LOST_FOCUS]:(0,o.localize)("editor.autoSave.enum.windowLostFocus")}),$.registerEditorFeatureContribution(new W.EditorTopPaddingContribution),$.registerEditorFeatureContribution(this.injector.get(U.EditorSuggestWidgetContribution)),this.registerAutoSaveConfigurationChange()}registerAutoSaveConfigurationChange(){this.preferenceService.onSpecificPreferenceChange("editor.autoSave",$=>{const V=$.newValue;if(V!==c.AUTO_SAVE_MODE.OFF){let H=f.SaveReason.FocusOut;V===c.AUTO_SAVE_MODE.AFTER_DELAY&&(H=f.SaveReason.AfterDelay);for(const K of this.workbenchEditorService.editorGroups)for(const Y of K.resources)$.affects(Y?.uri.toString())&&K.saveResource(Y,H)}})}registerCommands($){$.registerCommand(o.EDITOR_COMMANDS.AUTO_SAVE,{execute:()=>{const V="editor.autoSave",H=this.preferenceSettings.getPreference(V,s.PreferenceScope.User).value||c.AUTO_SAVE_MODE.OFF,K=[c.AUTO_SAVE_MODE.AFTER_DELAY,c.AUTO_SAVE_MODE.EDITOR_FOCUS_CHANGE,c.AUTO_SAVE_MODE.WINDOWS_LOST_FOCUS].includes(H)?c.AUTO_SAVE_MODE.OFF:c.AUTO_SAVE_MODE.AFTER_DELAY;return this.preferenceSettings.setPreference(V,K,s.PreferenceScope.User)}}),$.registerCommand(o.EDITOR_COMMANDS.COPY_PATH,{execute:V=>{V&&this.commandService.executeCommand(o.FILE_COMMANDS.COPY_PATH.id,V.uri)}}),$.registerCommand(o.EDITOR_COMMANDS.COPY_RELATIVE_PATH,{execute:V=>{V&&this.commandService.executeCommand(o.FILE_COMMANDS.COPY_RELATIVE_PATH.id,V.uri)}})}};t.EditorAutoSaveEditorContribution=G,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],G.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],G.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(f.WorkbenchEditorService),n.__metadata("design:type",j.WorkbenchEditorServiceImpl)],G.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],G.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(A.IEditorDocumentModelService),n.__metadata("design:type",Object)],G.prototype,"editorDocumentService",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],G.prototype,"preferenceSettings",void 0),t.EditorAutoSaveEditorContribution=G=n.__decorate([(0,o.Domain)(B.BrowserEditorContribution,o.CommandContribution)],G)},2863:(M,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorDecorationCollectionService=void 0;const r=e(85608),o=e(76003),a=e(41869),p=e(52416),v=e(10045),m=e(82196);let _=n=class{constructor(){this.decorations=new Map,this.tempId=0,this.decorationProviders=new Map}getNextTempId(){return this.tempId++,"temp-decoration-"+this.tempId}createTextEditorDecorationType(g,l){l||(l=this.getNextTempId());const h=this.resolveDecoration(l,g),u={key:l,property:h,dispose:()=>{l&&this.decorations.has(l)&&(h.dispose(),this.decorations.delete(l),this.eventBus.fire(new m.EditorDecorationTypeRemovedEvent(l)))}};return this.decorations.set(l,u),u}getTextEditorDecorationType(g){return this.decorations.get(g)}resolveDecoration(g,l){const h=this.createThemeCSSStyleCollection(g,l);return{default:h.default,light:h.light,dark:h.dark,isWholeLine:l.isWholeLine||!1,overviewRulerLane:l.overviewRulerLane,dispose:()=>{h.dispose()}}}createThemeCSSStyleCollection(g,l){const h=new a.DisposableStore,d={default:this.addedThemeDecorationToCSSStyleSheet(g,l),light:null,dark:null,dispose:()=>{h.dispose()}};if(l.light){const E=this.addedThemeDecorationToCSSStyleSheet(g+"-light",l.light);d.light=E,h.add(E)}if(l.dark){const E=this.addedThemeDecorationToCSSStyleSheet(g+"-dark",l.dark);d.dark=E,h.add(E)}return d}addedThemeDecorationToCSSStyleSheet(g,l){const h=g,u=g+"-inline",d=new a.DisposableStore;let E,f,c;const y=this.createInlineBlockCSSStyleIfNeeded(),b=this.resolveCSSStyle(l),A=this.resolveInlineCSSStyle(l);if(d.add(this.cssManager.addClass(h,b)),d.add(this.cssManager.addClass(u,A)),l.after){const S=`${g}-after`,D=this.resolveContentCSSStyle(l.after);d.add(this.cssManager.addClass(S+"::after",D)),E=`${y} ${S}`}if(l.before){const S=`${g}-before`,D=this.resolveContentCSSStyle(l.before);d.add(this.cssManager.addClass(S+"::before",D)),f=`${y} ${S}`}if(l.gutterIconPath){const S=this.resolveCSSStyle({backgroundIconSize:l.gutterIconSize,backgroundIcon:l.gutterIconPath.toString()});c=g+"-glyphMargin",d.add(this.cssManager.addClass(c,S))}return{className:h,inlineClassName:u,afterContentClassName:E,beforeContentClassName:f,glyphMarginClassName:c,overviewRulerColor:l.overviewRulerColor,dispose(){return d.dispose()}}}resolveCSSStyle(g){var l;const h=!((l=g.backgroundIcon)===null||l===void 0)&&l.startsWith("data:")?this.iconService.encodeBase64Path(decodeURIComponent(g.backgroundIcon)):g.backgroundIcon;return{backgroundColor:this.themeService.getColorVar(g.backgroundColor),background:g.backgroundIcon?`url("${h}") center center no-repeat`:void 0,backgroundSize:g.backgroundIconSize?`${g.backgroundIconSize}`:void 0,outline:g.outline,outlineColor:g.outlineColor,outlineStyle:g.outlineStyle,outlineWidth:g.outlineWidth,border:g.border,borderColor:this.themeService.getColorVar(g.borderColor),borderRadius:g.borderRadius,borderSpacing:g.borderSpacing,borderStyle:g.borderStyle,borderWidth:g.borderWidth}}resolveInlineCSSStyle(g){return{fontStyle:g.fontStyle,fontWeight:g.fontWeight,textDecoration:g.textDecoration,textUnderlinePosition:g.textUnderlinePosition,cursor:g.cursor,color:this.themeService.getColorVar(g.color),opacity:g.opacity,letterSpacing:g.letterSpacing}}resolveContentCSSStyle(g){let l;return g.contentText?l=`"${g.contentText}"`:g.contentIconPath&&(l=`url('${a.URI.from(g.contentIconPath).toString(!0).replace(/'/g,"%27")}')`),{display:"block",content:l,border:g.border,borderColor:this.themeService.getColorVar(g.borderColor),fontStyle:g.fontStyle,fontWeight:g.fontWeight,textDecoration:g.textDecoration,color:this.themeService.getColorVar(g.color),backgroundColor:this.themeService.getColorVar(g.backgroundColor),margin:g.margin,width:g.width,height:g.height}}createInlineBlockCSSStyleIfNeeded(){return this.inlineBlockDecorationDisposer||(this.inlineBlockDecorationDisposer=this.cssManager.addClass(n.DISPLAY_INLINE_BLOCK_CLS,{display:"inline-block"})),n.DISPLAY_INLINE_BLOCK_CLS}registerDecorationProvider(g){this.decorationProviders.set(g.key,g),this.eventBus.fire(new m.EditorDecorationProviderRegistrationEvent(g));const l=g.onDidDecorationChange(h=>{this.eventBus.fire(new m.EditorDecorationChangeEvent({uri:h,key:g.key}))});return{dispose:()=>{this.decorationProviders.get(g.key)===g&&(this.decorationProviders.delete(g.key),this.eventBus.fire(new m.EditorDecorationTypeRemovedEvent(g.key))),l.dispose()}}}async getDecorationFromProvider(g,l){const h={};let u=[];return l?this.decorationProviders.has(l)&&u.push(this.decorationProviders.get(l)):u=Array.from(this.decorationProviders.values()),await Promise.all(u.map(async d=>{if(d.schemes&&d.schemes.indexOf(g.scheme)===-1)return;const E=await d.provideEditorDecoration(g);E&&(h[d.key]=E)})),h}};t.EditorDecorationCollectionService=_,_.DISPLAY_INLINE_BLOCK_CLS="display-inline-block-decoration",r.__decorate([(0,o.Autowired)(v.ICSSStyleService),r.__metadata("design:type",Object)],_.prototype,"cssManager",void 0),r.__decorate([(0,o.Autowired)(p.IThemeService),r.__metadata("design:type",Object)],_.prototype,"themeService",void 0),r.__decorate([(0,o.Autowired)(p.IIconService),r.__metadata("design:type",Object)],_.prototype,"iconService",void 0),r.__decorate([(0,o.Autowired)(a.IEventBus),r.__metadata("design:type",Object)],_.prototype,"eventBus",void 0),t.EditorDecorationCollectionService=_=n=r.__decorate([(0,o.Injectable)()],_)},93152:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MonacoContextViewService=t.MonacoCodeService=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=n.__importStar(e(20868)),v=e(76947),m=e(18099),_=e(79731),s=e(16781),g=e(7760),l=e(26917),h=e(23418),u=e(51553);let d=class extends m.AbstractCodeEditorService{constructor(){super(s.StandaloneServices.get(g.IStandaloneThemeService))}getActiveCodeEditor(){return this.workbenchEditorService.currentEditor?this.workbenchEditorService.currentEditor.monacoEditor:null}async openCodeEditor(c,y,b){var A,S,D,T,w,I;const R=c.resource;if(!this.preferenceService.get("editor.enablePreviewFromCodeNavigation")&&y&&!b&&(0,v.isEqual)((A=y.getModel())===null||A===void 0?void 0:A.uri,c.resource)){for(const B of this.workbenchEditorService.editorGroups)if(((S=B.currentOpenType)===null||S===void 0?void 0:S.type)===h.EditorOpenType.code){if(((D=B.currentEditor)===null||D===void 0?void 0:D.monacoEditor)===y){B.pinPreviewed((T=B.currentResource)===null||T===void 0?void 0:T.uri);break}}else if(((w=B.currentOpenType)===null||w===void 0?void 0:w.type)===h.EditorOpenType.diff&&(B.diffEditor.modifiedEditor.monacoEditor===y||B.diffEditor.originalEditor.monacoEditor===y)){B.pinPreviewed((I=B.currentResource)===null||I===void 0?void 0:I.uri);break}}let O=this.workbenchEditorService.currentEditorGroup,x;y&&(O=this.workbenchEditorService.editorGroups.find(B=>B.currentEditor&&B.currentEditor.monacoEditor===y)||O,x=O.resources.findIndex(B=>O.currentResource&&B.uri===O.currentResource.uri),x>=0&&x++);const k=c.options?c.options.selection:null;let F;k&&(typeof k.endLineNumber=="number"&&typeof k.endColumn=="number"?F=k:F=new p.Range(k.startLineNumber,k.startColumn,k.startLineNumber,k.startColumn));const L=a.URI.parse(R.toString());return await O.open(L,{index:x,range:F,focus:!0}),O.codeEditor.monacoEditor}};t.MonacoCodeService=d,n.__decorate([(0,r.Autowired)(h.WorkbenchEditorService),n.__metadata("design:type",u.WorkbenchEditorServiceImpl)],d.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],d.prototype,"preferenceService",void 0),t.MonacoCodeService=d=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],d);class E extends l.ContextViewService{constructor(c){super(new _.EditorScopedLayoutService(document.body,c))}setContainer(c){this.menuContainer||(this.menuContainer=document.createElement("div"),this.menuContainer.className=c.className,this.menuContainer.style.left="0",this.menuContainer.style.top="0",this.menuContainer.style.position="fixed",this.menuContainer.style.zIndex="10",document.body.append(this.menuContainer)),super.setContainer(this.menuContainer)}}t.MonacoContextViewService=E},8287:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorStatusBarService=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(26542),p=e(23418),v=e(96689);let m=class extends o.WithEventBus{setListener(){this.workbenchEditorService.onActiveResourceChange(()=>{this.updateLanguageStatus(this.workbenchEditorService.currentEditor)}),this.workbenchEditorService.onCursorChange(s=>{this.updateCursorStatus(s)}),this.eventBus.on(v.EditorDocumentModelOptionChangedEvent,s=>{const g=this.workbenchEditorService.currentEditor;g&&g.currentUri&&g.currentUri.isEqual(s.payload.uri)&&this.updateLanguageStatus(this.workbenchEditorService.currentEditor)})}updateCursorStatus(s){const{position:g,selectionLength:l}=s;if(!g){this.statusBar.removeElement("editor-status-cursor");return}this.statusBar.addElement("editor-status-cursor",{name:(0,o.localize)("status-bar.editor-selection"),text:`%status-bar.label.line%${g.lineNumber}\uFF0C%status-bar.label.column%${g.column}${l?`\uFF08%status-bar.label.selected%${l}\uFF09`:""}`,priority:4,alignment:a.StatusBarAlignment.RIGHT,command:o.EDITOR_COMMANDS.GO_TO_LINE.id,tooltip:(0,o.localize)("status.editor.goToLineCol")})}updateLanguageStatus(s){if(!s){this.statusBar.removeElement("editor-status-language"),this.statusBar.removeElement("editor-status-encoding"),this.statusBar.removeElement("editor-status-eol"),this.statusBar.removeElement("editor-status-space");return}let g="",l="",h="",u=!1,d=2;const E=s.currentDocumentModel;E&&(g=E.languageId,l=E.encoding,h=E.eol,u=E.getMonacoModel().getOptions().insertSpaces,d=E.getMonacoModel().getOptions().tabSize);const f=h===`
31954
31954
  `?"LF":"CRLF",c=this.languageService.getLanguage(g),y=c?c.name:"";this.statusBar.addElement("editor-status-language",{name:(0,o.localize)("status-bar.editor-language"),text:y,alignment:a.StatusBarAlignment.RIGHT,priority:1,command:o.EDITOR_COMMANDS.CHANGE_LANGUAGE.id,tooltip:(0,o.localize)("status.editor.chooseLanguage")}),this.statusBar.addElement("editor-status-encoding",{name:(0,o.localize)("status-bar.editor-encoding"),text:l.toUpperCase(),alignment:a.StatusBarAlignment.RIGHT,priority:2,command:o.EDITOR_COMMANDS.CHANGE_ENCODING.id,tooltip:(0,o.localize)("status.editor.chooseEncoding")}),this.statusBar.addElement("editor-status-eol",{name:(0,o.localize)("status-bar.editor-eol"),text:f,alignment:a.StatusBarAlignment.RIGHT,priority:3,command:o.EDITOR_COMMANDS.CHANGE_EOL.id,tooltip:(0,o.localize)("status.editor.changeEol")}),this.statusBar.addElement("editor-status-space",{name:(0,o.localize)("status-bar.editor-space"),text:(u?(0,o.localize)("status-bar.label.tabType.space"):(0,o.localize)("status-bar.label.tabType.tab"))+": "+d,alignment:a.StatusBarAlignment.RIGHT,priority:4,command:void 0})}};t.EditorStatusBarService=m,n.__decorate([(0,r.Autowired)(a.IStatusBarService),n.__metadata("design:type",Object)],m.prototype,"statusBar",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",p.WorkbenchEditorService)],m.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(p.ILanguageService),n.__metadata("design:type",Object)],m.prototype,"languageService",void 0),t.EditorStatusBarService=m=n.__decorate([(0,r.Injectable)()],m)},30612:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorTabService=void 0;const n=e(85608),r=e(76003),o=e(41869);let a=class extends o.WithEventBus{renderEditorTab(v,m){return v}renderTabCloseComponent(v){return v}};t.EditorTabService=a,t.EditorTabService=a=n.__decorate([(0,r.Injectable)()],a)},14385:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentWrapper=t.ComponentsWrapper=t.EditorGroupBody=t.EditorGroupView=t.EditorGridView=t.EditorView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),a=n.__importDefault(e(25873)),p=e(97267),v=e(41869),m=e(81878),_=e(63373),s=e(48560),g=e(52902),l=e(23418),h=e(93669),u=n.__importDefault(e(62711)),d=e(47049),E=e(93532),f=e(52795),c=e(82196),y=()=>{const B=o.default.useRef(),U=(0,s.useInjectable)(l.WorkbenchEditorService),j=(0,s.useInjectable)(v.ComponentRegistry).getComponentRegistryInfo("editor-widget-right"),Q=j&&j.views[0].component,[G,Z]=o.default.useState(U.gridReady),$=(0,v.useDesignStyles)(u.default.kt_workbench_editor,"kt_workbench_editor");return o.default.useEffect(()=>{if(!G)if(U.gridReady)Z(!0);else{const V=U.onDidGridReady(()=>{Z(!0)});return()=>V.dispose()}},[]),G?o.default.createElement("div",{className:$,id:"workbench-editor",ref:V=>{B.current=V,V&&U.onDomCreated(V)}},o.default.createElement("div",{className:u.default.kt_editor_main_wrapper},o.default.createElement(t.EditorGridView,{grid:U.topGrid})),Q?o.default.createElement("div",{className:u.default.kt_editor_right_widget},o.default.createElement(v.ErrorBoundary,null,o.default.createElement(Q,null))):null):null};t.EditorView=y;const b={},A=({grid:B})=>{let U;const W=o.default.useContext(v.ConfigContext),j=(0,s.useInjectable)(v.IEventBus),Q=[],[,G]=o.default.useState(),Z=o.default.useCallback(()=>G({}),[]);if(o.default.useEffect(()=>{if(U)if(b[B.editorGroup.name])U.appendChild(b[B.editorGroup.name]),B.editorGroup.layoutEditors();else{const H=document.createElement("div");b[B.editorGroup.name]=H,H.style.height="100%",U.appendChild(H),a.default.createRoot(H).render(o.default.createElement(v.ConfigProvider,{value:W},o.default.createElement(t.EditorGroupView,{group:B.editorGroup})))}}),(0,v.useDisposable)(()=>[j.on(c.EditorGroupsResetSizeEvent,()=>{B.splitDirection&&Q.length>0&&Q.forEach(H=>{H.setSize(1/B.children.length,1/B.children.length)})}),B.onDidGridStateChange(()=>{Z()})],[]),B.children.length===0&&B.editorGroup)return o.default.createElement("div",{style:{height:"100%"},ref:H=>H&&(U=H)});const $=B.splitDirection===d.SplitDirection.Horizontal?{width:100/B.children.length+"%"}:{height:100/B.children.length+"%"},V=[];return B.children.forEach((H,K)=>{K!==0&&(B.splitDirection===d.SplitDirection.Vertical?V.push(o.default.createElement(m.ResizeHandleVertical,{key:"resize-"+B.children[K-1].uid+"-"+H.uid,onResize:()=>{B.children[K-1].emitResizeWithEventBus(j),H.emitResizeWithEventBus(j)},delegate:Y=>{Q.push(Y)},flexMode:m.ResizeFlexMode.Percentage})):V.push(o.default.createElement(m.ResizeHandleHorizontal,{key:"resize-"+B.children[K-1].uid+"-"+H.uid,onResize:()=>{B.children[K-1].emitResizeWithEventBus(j),H.emitResizeWithEventBus(j)},delegate:Y=>{Q.push(Y)}}))),V.push(o.default.createElement("div",{className:(0,r.default)({[u.default.kt_grid_vertical_child]:B.splitDirection===d.SplitDirection.Vertical,[u.default.kt_grid_horizontal_child]:B.splitDirection===d.SplitDirection.Horizontal}),style:$,key:H.uid,"data-min-resize":B.splitDirection===d.SplitDirection.Horizontal?150:60},o.default.createElement(t.EditorGridView,{grid:H})))}),o.default.createElement("div",{className:(0,r.default)({[u.default.kt_grid_vertical]:B.splitDirection===d.SplitDirection.Vertical,[u.default.kt_grid_horizontal]:B.splitDirection===d.SplitDirection.Horizontal})},V)};t.EditorGridView=A;const S={},D=({editorBackgroundImage:B})=>B?o.default.createElement("div",{className:u.default.editorEmpty},o.default.createElement("img",{className:u.default.editorEmptyImg,src:B})):null,T=({group:B})=>{const U=o.default.useRef(),[W,j]=o.default.useState(B.resources.length===0),Q=(0,v.useDesignStyles)(u.default.kt_editor_group,"kt_editor_group"),G=(0,s.useInjectable)(v.AppConfig),{editorBackgroundImage:Z}=G;o.default.useEffect(()=>{B.attachToDom(U.current)}),o.default.useEffect(()=>{j(B.resources.length===0);const K=B.onDidEditorGroupTabChanged(()=>{j(B.resources.length===0)});return()=>{K.dispose()}},[]);const $=(0,v.usePreference)("editor.showActionWhenGroupEmpty",!1),V=(0,s.useInjectable)(v.ComponentRegistry),H=o.default.useMemo(()=>{const K=V.getComponentRegistryInfo("editor-empty");return K&&K.views[0]||{component:D,initialProps:{editorBackgroundImage:Z}}},[]);return o.default.createElement("div",{ref:U,className:Q,tabIndex:1,onFocus:K=>{B.gainFocus()}},(!W||$)&&o.default.createElement("div",{className:u.default.editorGroupHeader},o.default.createElement(f.Tabs,{group:B})),o.default.createElement(t.EditorGroupBody,{group:B}),W&&o.default.createElement("div",{className:u.default.kt_editor_background,style:{backgroundImage:!H&&Z?`url(${Z})`:"none"}},(0,v.renderView)(H)))};t.EditorGroupView=T;const w=({group:B})=>{const[U,W]=o.default.useState(h.defaultEditorContext),j=o.default.useRef(null),Q=(0,s.useInjectable)(l.WorkbenchEditorService),G=(0,s.useInjectable)(v.IEventBus),Z=(0,v.useDesignStyles)(u.default.kt_editor_component,"kt_editor_component"),$=[],V=o.default.useRef(null),H=o.default.useRef(null),K=o.default.useRef(null),Y=o.default.useRef(null),[,X]=o.default.useState(),oe=o.default.useCallback(()=>X({}),[]);o.default.useEffect(()=>{const he=new v.DisposableStore;if(he.add(B.onDidEditorGroupBodyChanged(()=>{oe()})),V.current)if(S[B.name])S[B.name].remove(),V.current.appendChild(S[B.name]);else{const me=document.createElement("div");V.current.appendChild(me),S[B.name]=me,B.createEditor(me);const q=B.codeEditor.monacoEditor.getOption(g.monaco.editor.EditorOption.layoutInfo).minimap.minimapWidth;W({minimapWidth:q}),he.add(B.codeEditor.monacoEditor.onDidChangeConfiguration(Ee=>{Ee.hasChanged(g.monaco.editor.EditorOption.layoutInfo)&&W({minimapWidth:B.codeEditor.monacoEditor.getOption(g.monaco.editor.EditorOption.layoutInfo).minimap.minimapWidth})}))}return H.current&&B.attachDiffEditorDom(H.current),Y.current&&B.attachMergeEditorDom(Y.current),()=>{he.dispose()}},[]),o.default.useEffect(()=>{if(K.current){B.attachMultiDiffEditorDom(K.current);const he=new ResizeObserver(me=>{const q=me[0];q&&q.contentRect.height>0&&B.doLayoutEditors()});return he.observe(K.current),()=>he.disconnect()}},[K.current]),B.activeComponents.forEach((he,me)=>{const q=B.activateComponentsProps.get(me);$.push(o.default.createElement("div",{key:me.uid,className:(0,r.default)({[u.default.kt_hidden]:!(B.currentOpenType&&B.currentOpenType.componentId===me.uid)})},o.default.createElement(t.ComponentsWrapper,{key:me.uid,component:me,...q,resources:he,current:B.currentResource})))});const ie=o.default.useMemo(()=>B.resources.length===0||!B.currentResource,[B.resources.length,B.currentResource]);return o.default.useEffect(()=>{var he,me;((he=B.currentOpenType)===null||he===void 0?void 0:he.type)===c.EditorOpenType.code?G.fire(new c.CodeEditorDidVisibleEvent({groupName:B.name,type:c.EditorOpenType.code,editorId:B.codeEditor.getId()})):((me=B.currentOpenType)===null||me===void 0?void 0:me.type)===c.EditorOpenType.diff&&G.fire(new c.CodeEditorDidVisibleEvent({groupName:B.name,type:c.EditorOpenType.diff,editorId:B.diffEditor.modifiedEditor.getId()}))}),o.default.createElement(h.EditorContext.Provider,{value:U},o.default.createElement("div",{id:_.VIEW_CONTAINERS.EDITOR,ref:j,className:u.default.kt_editor_body,onDragOver:he=>{if(he.preventDefault(),j.current){const me=P(he.nativeEvent,j.current);k(j.current,me)}},onDragLeave:he=>{j.current&&F(j.current)},onDrop:he=>{if(j.current){if(F(j.current),he.dataTransfer.getData("uri")){const me=new v.URI(he.dataTransfer.getData("uri"));let q;he.dataTransfer.getData("uri-source-group")&&(q=Q.getEditorGroup(he.dataTransfer.getData("uri-source-group"))),B.dropUri(me,P(he.nativeEvent,j.current),q)}he.dataTransfer.files.length>0&&G.fire(new c.EditorGroupFileDropEvent({group:B,files:he.dataTransfer.files,position:P(he.nativeEvent,j.current)}))}}},B.currentResource&&o.default.createElement(L,{side:"top",resource:B.currentResource}),!ie&&o.default.createElement(E.NavigationBar,{editorGroup:B}),o.default.createElement("div",{className:u.default.kt_editor_components},o.default.createElement("div",{className:(0,r.default)({[Z]:!0,[u.default.kt_hidden]:!B.currentOpenType||B.currentOpenType.type!==c.EditorOpenType.component})},$),o.default.createElement("div",{className:(0,r.default)({[u.default.kt_editor_code_editor]:!0,[Z]:!0,[u.default.kt_hidden]:!B.currentOpenType||B.currentOpenType.type!==c.EditorOpenType.code}),ref:V}),o.default.createElement("div",{className:(0,r.default)(u.default.kt_editor_diff_editor,Z,{[u.default.kt_hidden]:!B.currentOpenType||B.currentOpenType.type!==c.EditorOpenType.diff}),ref:H}),o.default.createElement("div",{className:(0,r.default)(u.default.kt_editor_multi_diff_editor,Z,{[u.default.kt_hidden]:!B.currentOpenType||B.currentOpenType.type!==c.EditorOpenType.multiDiff}),ref:K}),o.default.createElement("div",{className:(0,r.default)(u.default.kt_editor_diff_3_editor,Z,{[u.default.kt_hidden]:!B.currentOpenType||B.currentOpenType.type!==c.EditorOpenType.mergeEditor}),ref:Y})),B.currentResource&&o.default.createElement(L,{side:"bottom",resource:B.currentResource})))};t.EditorGroupBody=w;const I=({component:B,resources:U,current:W,...j})=>((0,s.useUpdateOnEventBusEvent)(c.ResoucesOfActiveComponentChangedEvent,[B],Q=>Q.component===B),o.default.createElement("div",{className:u.default.kt_editor_component_wrapper},U.map(Q=>o.default.createElement(t.ComponentWrapper,{...j,key:Q.uri.toString(),component:B,resource:Q,hidden:!(W&&W.uri.toString()===Q.uri.toString())}))));t.ComponentsWrapper=I;const R=({component:B,resource:U,hidden:W,...j})=>{const Q=(0,s.useInjectable)(c.EditorComponentRegistry);let G=null,Z;B.renderMode!==c.EditorComponentRenderMode.ONE_PER_WORKBENCH&&(Z=o.default.createElement(B.component,{resource:U,...j}));const $=o.default.useContext(v.ConfigContext);return o.default.useEffect(()=>{if(B.renderMode===c.EditorComponentRenderMode.ONE_PER_WORKBENCH){if(!Q.perWorkbenchComponents[B.uid]){const V=document.createElement("div");V.style.height="100%",Q.perWorkbenchComponents[B.uid]=V,a.default.createRoot(V).render(o.default.createElement(v.ConfigProvider,{value:$},o.default.createElement(B.component,{resource:U})))}G.appendChild(Q.perWorkbenchComponents[B.uid])}}),o.default.createElement("div",{key:U.uri.toString(),className:(0,r.default)({[u.default.kt_hidden]:W})},o.default.createElement(p.Scrollbars,null,o.default.createElement(v.ErrorBoundary,null,o.default.createElement("div",{ref:V=>{G=V},style:{height:"100%"}},Z))))};t.ComponentWrapper=R;function P(B,U){const W=U.getBoundingClientRect(),j=B.clientX-W.left,Q=B.clientY-W.top,G=U.offsetWidth,Z=U.offsetHeight;return j<G*.15?c.DragOverPosition.LEFT:j>G*.85?c.DragOverPosition.RIGHT:Q<Z*.15?c.DragOverPosition.TOP:Q>Z*.85?c.DragOverPosition.BOTTOM:c.DragOverPosition.CENTER}function O(B,U){B.classList.contains(U)||B.classList.add(U)}function x(B,U){B.classList.contains(U)&&B.classList.remove(U)}function k(B,U){O(B,u.default.kt_on_drag_over),[c.DragOverPosition.LEFT,c.DragOverPosition.RIGHT,c.DragOverPosition.TOP,c.DragOverPosition.BOTTOM].filter(W=>W!==U).forEach(W=>{x(B,u.default["kt_on_drag_over_"+W])}),O(B,u.default["kt_on_drag_over_"+U])}function F(B){x(B,u.default.kt_on_drag_over),[c.DragOverPosition.LEFT,c.DragOverPosition.RIGHT,c.DragOverPosition.TOP,c.DragOverPosition.BOTTOM].forEach(U=>{x(B,u.default["kt_on_drag_over_"+U])})}const L=({side:B,resource:U})=>{const W=(0,s.useInjectable)(c.EditorComponentRegistry),j=(0,s.useInjectable)(v.IEventBus),Q=W.getSideWidgets(B,U),[,G]=o.default.useState(),Z=o.default.useCallback(()=>G({}),[]);return(0,v.useDisposable)(()=>j.on(c.RegisterEditorSideComponentEvent,Z),[]),o.default.createElement("div",{className:(0,r.default)(u.default.kt_editor_side_widgets,u.default["kt_editor_side_widgets_"+B])},Q.map($=>{const V=$.component;return o.default.createElement(V,{resource:U,key:$.id,...$.initialProps||{}})}))}},76759:(M,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorTabChangedError=t.EditorError=void 0,t.isEditorError=r;class e extends Error{}t.EditorError=e;class n extends e{constructor(){super("editor current tab changed when opening resource"),this.type=n.errorCode}}t.EditorTabChangedError=n,n.errorCode=1001;function r(o,a){return o&&o.type===a.errorCode}},59879:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorFeatureRegistryImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),{addElement:a}=o.arrays;let p=class{constructor(){this.contributions=[],this._onDidRegisterFeature=new o.Emitter,this.onDidRegisterFeature=this._onDidRegisterFeature.event}registerEditorFeatureContribution(m){const _=a(this.contributions,m);return this._onDidRegisterFeature.fire(m),_}runContributions(m){this.contributions.forEach(_=>{this.runOneContribution(m,_)})}async runProvideEditorOptionsForUri(m){return(await Promise.all(this.contributions.map(s=>s.provideEditorOptionsForUri?s.provideEditorOptionsForUri(m):{}))).reduce((s,g)=>({...s,...g}),{})}runOneContribution(m,_){try{const s=_.contribute(m);m.onDispose(()=>{s.dispose()})}catch(s){this.logger.error(s)}}};t.EditorFeatureRegistryImpl=p,n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],p.prototype,"logger",void 0),t.EditorFeatureRegistryImpl=p=n.__decorate([(0,r.Injectable)()],p)},57719:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentFormatService=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(79865),p=e(44781),v=e(52801),m=e(97854),_=e(82196),s=e(51553),g=e(85857);let l=class{async formatDocumentWith(){var u;const d=(u=this.workbenchEditorService.currentEditor)===null||u===void 0?void 0:u.monacoEditor;if(!d)return;const E=d.getModel();if(E){const f=(0,v.getRealAndSyntheticDocumentFormattersOrdered)(a.languageFeaturesService.documentFormattingEditProvider,a.languageFeaturesService.documentRangeFormattingEditProvider,E),y=await this.injector.get(g.FormattingSelector).pickFormatter(f,E);if(y)try{const b=await y.provideDocumentFormattingEdits(E,E.getFormattingOptions(),o.CancellationToken.None);b&&m.FormattingEdit.execute(d,b,!0)}catch(b){this.logger.error("execute format document with error",b)}}}async formatSelectionWith(){var u;if(!(!((u=this.workbenchEditorService.currentEditor)===null||u===void 0)&&u.monacoEditor.hasModel()))return;const d=this.workbenchEditorService.currentEditor.monacoEditor,E=d.getModel();if(E){let f=d.getSelection();f?.isEmpty()&&(f=new p.Range(f.startLineNumber,1,f.startLineNumber,E.getLineMaxColumn(f.startLineNumber)));const c=a.languageFeaturesService.documentRangeFormattingEditProvider.ordered(E),b=await this.injector.get(g.FormattingSelector).pickFormatter(c,E);if(b)try{const A=await b.provideDocumentRangeFormattingEdits(E,f,E.getFormattingOptions(),o.CancellationToken.None);A&&m.FormattingEdit.execute(d,A,!0)}catch(A){this.logger.error("execute format document with error",A)}}}};t.DocumentFormatService=l,n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],l.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(_.WorkbenchEditorService),n.__metadata("design:type",s.WorkbenchEditorServiceImpl)],l.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],l.prototype,"injector",void 0),t.DocumentFormatService=l=n.__decorate([(0,r.Injectable)()],l)},85857:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormattingSelector=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(72665),p=e(52801),v=e(96689),m="editor.preferredFormatter";let _=class{async selectFormatter(g,l,h,u){const d=this.modelService.getModelDescription(o.URI.from(l.uri.toJSON()));if(!d)return;const E=d.languageId,f=this.getPreferedFormatter(E),c={};if(g.forEach(y=>{y.extensionId&&(c[y.extensionId]=y)}),f){if(c[f])return c[f];this.messageService.error((0,o.formatLocalize)("editor.format.preferredFormatterNotFound",f,E))}if(g.length===1)return g[0];if(h===p.FormattingMode.Explicit){const{selected:y,value:b}=await this.doPick(c);if(b)return this.savePreferredFormatter(E,y),c[y]}else return}async doPick(g){const l=Object.keys(g).map(u=>({label:g[u].displayName,value:g[u].extensionId})),h=await this.quickPickService.show(l,{placeholder:(0,o.localize)("editor.format.chooseFormatter")});return h?{selected:h,value:g[h]}:{}}getPreferedFormatter(g){return(this.preferenceService.get(m)||{})[g]}async savePreferredFormatter(g,l){const h=this.preferenceService.get(m)||{};this.preferenceService.set(m,{...h,[g]:l},o.PreferenceScope.User)}async pickFormatter(g,l){const h=this.modelService.getModelDescription(o.URI.from(l.uri.toJSON()));if(!h)return;const u=h.languageId,d={};g.forEach(c=>{c.extensionId&&(d[c.extensionId]=c)});const{selected:E,value:f}=await this.doPick(d);if(f)return this.savePreferredFormatter(u,E),f}};t.FormattingSelector=_,n.__decorate([(0,r.Autowired)(o.QuickPickService),n.__metadata("design:type",Object)],_.prototype,"quickPickService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(v.IEditorDocumentModelService),n.__metadata("design:type",Object)],_.prototype,"modelService",void 0),n.__decorate([(0,r.Autowired)(a.IMessageService),n.__metadata("design:type",Object)],_.prototype,"messageService",void 0),t.FormattingSelector=_=n.__decorate([(0,r.Injectable)()],_)},5580:(M,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeSet=t.FileTreeNode=void 0;class e{get children(){return this._children||(this._children=new Map),this._children}constructor(o,a,p="/"){this.path=o,this.parent=a,this.separator=p,this._disposed=!1,a?this.key=a.key+this.separator+o:this.key=o}bindOnDispose(o){this._onDisposed=o}addChild(o){const a=new e(o,this,this.separator);return this.children.set(o,a),a}getAllDescendants(){if(this._children){const o=[this];return this.children.forEach(a=>{o.push(...a.getAllDescendants())}),o}else return[this]}dispose(){this._disposed||(this.parent&&(this.parent.children.delete(this.path),this.parent.children.size===0&&this.parent.dispose()),this._onDisposed&&this._onDisposed(),this._disposed=!0)}}t.FileTreeNode=e;class n{constructor(o=!1){this.nodes=new Map,this.separator=o?"\\":"/"}add(o){const a=o.split(this.separator);let p,v;for(const m of a){p===void 0?p=m:p+=this.separator+m;let _;this.nodes.has(p)?_=this.nodes.get(p):(v?_=v.addChild(m):_=new e(m,void 0,this.separator),_.bindOnDispose(()=>{this.nodes.delete(_.key)}),this.nodes.set(_.key,_)),v=_}}delete(o){const a=this.effects(o);return a.forEach(p=>{const v=this.nodes.get(p);v&&v.dispose()}),a}effects(o){const a=this.nodes.get(o);return a?a.getAllDescendants().map(p=>p.key):[]}}t.FileTreeSet=n},68692:(M,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseFileSystemEditorDocumentProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(14951),p=e(24328);let v=class{constructor(){this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event,this._fileContentMd5OnBrowserFs=new Set,this._detectedEncodingMap=new Map,this._detectedEolMap=new Map,this.fileServiceClient.onFilesChanged(_=>{_.forEach(s=>{this._fileContentMd5OnBrowserFs.has(s.uri)&&(s.type===o.FileChangeType.ADDED||s.type===o.FileChangeType.UPDATED)&&this._onDidChangeContent.fire(new o.URI(s.uri))})})}handlesScheme(_){return this.fileServiceClient.handlesScheme(_)}provideEncoding(_){return this._detectedEncodingMap.get(_.toString())||o.UTF8}async provideEOL(_){const s=this._detectedEolMap.get(_.toString());return s||(await this.applicationService.getBackendOS()===o.OperatingSystem.Windows?`\r
31955
31955
  `:`
31956
31956
  `)}async read(_,s){const{content:g}=await this.fileServiceClient.readFile(_.toString()),l=s.autoGuessEncoding||this.preferenceService.get("files.autoGuessEncoding",void 0,_.toString(),(0,o.getLanguageIdFromMonaco)(_)),h=await(0,o.detectEncodingFromBuffer)(g,l);h.encoding=await this.getReadEncoding(_,s,h.encoding);const u=g.toString(h.encoding),d=await this.getEol(_,u),E=_.toString();return this._detectedEncodingMap.set(E,h.encoding),this._detectedEolMap.set(E,d),this._fileContentMd5OnBrowserFs.add(E),{encoding:h.encoding||o.UTF8,content:u,eol:d}}async getEol(_,s){let l=0,h=0,u=0;const d=Math.min(2e3,s.length);for(let b=0;b<d;b++)s[b]==="\r"?s[b+1]===`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensumi/cli-engine",
3
- "version": "3.9.1-next-1747917815.0",
3
+ "version": "3.9.1-next-1747982269.0",
4
4
  "description": "Integration engine runtime for opensumi-cli and opensumi extension",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -26,14 +26,14 @@
26
26
  "dependencies": {
27
27
  "@koa/cors": "^5.0.0",
28
28
  "@opensumi/di": "^1.8.0",
29
- "@opensumi/ide-core-browser": "3.9.1-next-1747917815.0",
30
- "@opensumi/ide-core-common": "3.9.1-next-1747917815.0",
31
- "@opensumi/ide-core-node": "3.9.1-next-1747917815.0",
32
- "@opensumi/ide-express-file-server": "3.9.1-next-1747917815.0",
33
- "@opensumi/ide-extension": "3.9.1-next-1747917815.0",
34
- "@opensumi/ide-i18n": "3.9.1-next-1747917815.0",
35
- "@opensumi/ide-main-layout": "3.9.1-next-1747917815.0",
36
- "@opensumi/ide-startup": "3.9.1-next-1747917815.0",
29
+ "@opensumi/ide-core-browser": "3.9.1-next-1747982269.0",
30
+ "@opensumi/ide-core-common": "3.9.1-next-1747982269.0",
31
+ "@opensumi/ide-core-node": "3.9.1-next-1747982269.0",
32
+ "@opensumi/ide-express-file-server": "3.9.1-next-1747982269.0",
33
+ "@opensumi/ide-extension": "3.9.1-next-1747982269.0",
34
+ "@opensumi/ide-i18n": "3.9.1-next-1747982269.0",
35
+ "@opensumi/ide-main-layout": "3.9.1-next-1747982269.0",
36
+ "@opensumi/ide-startup": "3.9.1-next-1747982269.0",
37
37
  "chalk": "^4.1.2",
38
38
  "ejs": "^3.1.7",
39
39
  "ip": "^1.1.8",
@@ -72,5 +72,5 @@
72
72
  "webpack": "^5.90.0",
73
73
  "webpack-cli": "^5.1.4"
74
74
  },
75
- "gitHead": "bac3371f05196e7b67fad547a81dfbc5ede94ffb"
75
+ "gitHead": "2e0fba37ef9e8b44a75444e7a90779d0501ff631"
76
76
  }