@opensumi/cli-engine 3.9.1-next-1756901517.0 → 3.9.1-next-1760616868.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.
@@ -33308,7 +33308,7 @@ ${y}`)}return this.keybindingsChanged.fire({affectsCommands:[f.command]}),{dispo
33308
33308
  `,S=!!u.saveDocumentModel,D=this.injector.get(v.EditorDocumentModel,[h,c,{readonly:E,languageId:f,savable:S,eol:A,encoding:a,alwaysDirty:d,closeAutoSave:y,disposeEvenDirty:b}]);return this.onceReady(()=>{if(this.preferredModelOptions.has(h.toString())){const I=this.preferredModelOptions.get(h.toString());I?.encoding&&D.updateEncoding(I.encoding),I?.eol&&(D.eol=I.eol),I?.languageId&&(D.languageId=I.languageId)}}),this.editorDocModels.set(h.toString(),D),D}async saveEditorDocumentModel(g,a,h,u,c,E,f){const d=await this.contentRegistry.getProvider(g);if(!d)throw new Error(`No document provider found for ${g.toString()}`);if(!d.saveDocumentModel)throw new Error(`The document provider of ${g.toString()} does not have a save method`);return await d.saveDocumentModel(g,a,h,u,c,E,f)}dispose(){super.dispose(),this.getAllModels().forEach(g=>{g.getMonacoModel().dispose()})}};t.EditorDocumentModelServiceImpl=p,n.__decorate([(0,r.Autowired)(m.IEditorDocumentModelContentRegistry),n.__metadata("design:type",Object)],p.prototype,"contentRegistry",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],p.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(o.StorageProvider),n.__metadata("design:type",Function)],p.prototype,"getStorage",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],p.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],p.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(l.IHashCalculateService),n.__metadata("design:type",Object)],p.prototype,"hashCalculateService",void 0),n.__decorate([(0,r.Autowired)(_.IFileServiceClient),n.__metadata("design:type",Object)],p.prototype,"fileSystem",void 0),n.__decorate([o.memoize,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",Promise)],p.prototype,"initialize",null),n.__decorate([(0,o.OnEvent)(m.EditorDocumentModelOptionExternalUpdatedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[m.EditorDocumentModelOptionExternalUpdatedEvent]),n.__metadata("design:returntype",Promise)],p.prototype,"acceptExternalChange",null),t.EditorDocumentModelServiceImpl=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},91249:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorDocumentModel=void 0;const r=e(85608),o=r.__importDefault(e(12784)),l=e(76003),_=e(41869),v=e(96405),m=e(52902),p=e(68475),s=e(72665),g=e(2261),a=e(44781),h=e(43255),u=e(24347),c=e(23418),E=e(55113),f=e(90915),d=e(82196),y=e(86942),b=e(98469),A=e(96689);let S=n=class extends _.Disposable{constructor(I,w,T={}){super(),this.uri=I,this.saveQueue=new _.Throttler,this._encoding="utf8",this.readonly=!1,this.savable=!1,this.alwaysDirty=!1,this.closeAutoSave=!1,this.disposeEvenDirty=!1,this._originalEncoding=this._encoding,this._persistVersionId=0,this._baseContent="",this.savingTasks=[],this.dirtyChanges=[],this._isInitOption=!0,this._onDidChangeEncoding=new _.Emitter,this.onDidChangeEncoding=this._onDidChangeEncoding.event,this.onDispose(()=>{this.eventBus.fire(new A.EditorDocumentModelRemovalEvent(this.uri))}),T.encoding&&(this._encoding=T.encoding),this.readonly=!!T.readonly,this.savable=!!T.savable,this.alwaysDirty=!!T.alwaysDirty,this.disposeEvenDirty=!!T.disposeEvenDirty,this.closeAutoSave=!!T.closeAutoSave,this.monacoModel=m.monaco.editor.createModel(w,T.languageId,m.URI.parse(I.toString())),this.editorPreferences=(0,f.createEditorPreferenceProxy)(this.preferences,this.uri.toString(),this.languageId),this.updateOptions({}),T.eol&&(this.eol=T.eol),this._originalEncoding=this._encoding,this._previousVersionId=this.monacoModel.getVersionId(),this._persistVersionId=this.monacoModel.getAlternativeVersionId(),this.baseContent=w,this._isInitOption=!1,this.listenTo(this.monacoModel),this.readCacheToApply(),this.addDispose(this._onDidChangeEncoding),this.addDispose(this.monacoModel.onDidChangeLanguage(R=>{this.eventBus.fire(new A.EditorDocumentModelOptionChangedEvent({uri:this.uri,languageId:R.newLanguage}))}))}updateOptions(I){const w={tabSize:this.editorPreferences["editor.tabSize"]||1,insertSpaces:this.editorPreferences["editor.insertSpaces"],detectIndentation:this.editorPreferences["editor.detectIndentation"],...I};w.detectIndentation?this.monacoModel.detectIndentation(w.insertSpaces,w.tabSize):this.monacoModel.updateOptions(w)}listenTo(I){this.addDispose(I.onDidChangeContent(w=>{w.changes&&w.changes.length>0&&this.dirtyChanges.push({fromVersionId:this._previousVersionId,toVersionId:w.versionId,changes:w.changes}),this._previousVersionId=w.versionId,this.notifyChangeEvent(w.changes,w.isRedoing,w.isUndoing)})),this.addDispose(I)}readCacheToApply(){if(!this.cacheProvider.hasCache(this.uri))return;const I=this.cacheProvider.getCache(this.uri,this.encoding);I&&((0,_.isThenable)(I)?I.then(w=>{w&&this.applyCache(w)}).catch(w=>{this.logger.error(`${y.EditorDocumentError.READ_CACHE_ERROR} ${w&&w.message}`)}):this.applyCache(I))}applyCache(I){if(this.dirty){this.logger.error(y.EditorDocumentError.APPLY_CACHE_TO_DIRTY_DOCUMENT);return}if(this.baseContentMd5!==I.startMD5){this.logger.error(y.EditorDocumentError.APPLY_CACHE_TO_DIFFERENT_DOCUMENT);return}const w=T=>{const[R,M,O,x,k]=T;return a.Range.lift({startLineNumber:M,startColumn:O,endLineNumber:x,endColumn:k})};if((0,c.isDocContentCache)(I))this.monacoModel.setValue(I.content);else for(const T of I.changeMatrix){const R=T.map(M=>({range:w(M),text:M[0]}));this.monacoModel.applyEdits(R)}}cleanAndUpdateContent(I){this.monacoModel.setValue(I),this.monacoModel._commandManager.clear(),this._persistVersionId=this.monacoModel.getAlternativeVersionId(),this.savingTasks=[],this.notifyChangeEvent([],!1,!1),this.baseContent=I}async updateEncoding(I){let w=!1;this._encoding!==I&&(w=!0),this._encoding=I,await this.reload(),w&&(this.eventBus.fire(new A.EditorDocumentModelOptionChangedEvent({uri:this.uri,encoding:this._encoding})),this._onDidChangeEncoding.fire())}get encoding(){return this._encoding}set eol(I){this.monacoModel.setEOL(I===`
33309
33309
  `?p.EndOfLineSequence.LF:p.EndOfLineSequence.CRLF),this._isInitOption||this.eventBus.fire(new A.EditorDocumentModelOptionChangedEvent({uri:this.uri,eol:I}))}get eol(){return this.monacoModel.getEOL()}get dirty(){return this.alwaysDirty?!0:!this.savable||this.monacoModel.isDisposed()||this.readonly?!1:this._persistVersionId!==this.monacoModel.getAlternativeVersionId()}set languageId(I){m.monaco.editor.setModelLanguage(this.monacoModel,I),this.eventBus.fire(new A.EditorDocumentModelOptionChangedEvent({uri:this.uri,languageId:I}))}get languageId(){return this.monacoModel.getLanguageId()}get id(){return this.monacoModel.id}getMonacoModel(){return this.monacoModel}async syncDocumentModelToExtThread(){await this.eventBus.fireAndAwait(new A.EditorDocumentModelOptionChangedEvent({uri:this.uri,languageId:this.languageId,encoding:this.encoding,eol:this.eol,dirty:this.dirty}))}async save(I=!1,w=c.SaveReason.Manual){if(!this.dirty)return await this.syncDocumentModelToExtThread(),!1;const T=await this.contentRegistry.getProvider(this.uri);if(await T?.isReadonly(this.uri))return!1;const M=async(O=!1,x=c.SaveReason.Manual)=>{if(await this.formatOnSave(x),await this.eventBus.fireAndAwait(new A.EditorDocumentModelWillSaveEvent({uri:this.uri,reason:x,language:this.languageId,dirty:this.dirty})),this.editorPreferences["editor.askIfDiff"]||(O=!0),!this.dirty)return!1;const k=this.monacoModel.getVersionId(),F=this.savingTasks[this.savingTasks.length-1];if(F&&F.versionId===k){F.cancel();const U=this.savingTasks.pop();U?.dispose()}const L=new b.SaveTask(this.uri,k,this.monacoModel.getAlternativeVersionId(),this.getText(),O);this.savingTasks.push(L),this.savingTasks.length>0&&this.initSave();const N=await L.finished;if(N.state===_.SaveTaskResponseState.SUCCESS)return this.monacoModel.pushStackElement(),!0;if(N.state===_.SaveTaskResponseState.ERROR)return N.errorMessage!=="cancel"&&(this.logger.error(N.errorMessage),this.messageService.error((0,_.localize)("doc.saveError.failed")+`
33310
33310
  `+N.errorMessage)),!1;if(N.state===_.SaveTaskResponseState.DIFF){const U=(0,_.localize)("doc.saveError.diffAndSave"),W=(0,_.localize)("doc.saveError.overwrite");return this.messageService.error((0,_.formatLocalize)("doc.saveError.diff",this.uri.toString()),[U,W]).then(j=>{j===U?this.compareAndSave():j===W&&M(!0,x)}),this.logger.error("The file cannot be saved, the version is inconsistent with the disk"),!1}return!1};return this.saveQueue.queue(M.bind(this,I,w))}async compareAndSave(){const I=_.URI.from({scheme:A.ORIGINAL_DOC_SCHEME,query:_.URI.stringifyQuery({target:this.uri.toString()})}),w=this.uri.path.base,T=await this.compareService.compare(I,this.uri,(0,_.formatLocalize)("editor.compareAndSave.title",w,w));T===d.CompareResult.revert?this.revert():T===d.CompareResult.accept&&this.save(!0)}async initSave(){for(;this.savingTasks.length>0;){const I=this.dirtyChanges;this.dirtyChanges=[],(await this.savingTasks[0].run(this.service,this.baseContent,I,this.encoding,this.eol)).state==="success"&&this.savingTasks[0]?(this.baseContent=this.savingTasks[0].content,this.eventBus.fire(new A.EditorDocumentModelSavedEvent(this.uri)),this.setPersist(this.savingTasks[0].alternativeVersionId)):this.dirtyChanges.unshift(...I),this.savingTasks.shift()}}setPersist(I){this._persistVersionId=I,this.notifyChangeEvent([],!1,!1)}async reload(){try{const I=await this.contentRegistry.getContentForUri(this.uri,this._encoding);(0,_.isUndefinedOrNull)(I)||this.cleanAndUpdateContent(I)}catch{this._persistVersionId=this.monacoModel.getAlternativeVersionId()}}async revert(I){I?this._persistVersionId=this.monacoModel.getAlternativeVersionId():await this.updateEncoding(this._originalEncoding)}getText(I){return I?this.monacoModel.getValueInRange(I):this.monacoModel.getValue()}updateContent(I,w,T=!1){w&&(this.eol=w);const R=this.eol===`\r
33311
- `?h.DefaultEndOfLine.CRLF:h.DefaultEndOfLine.LF,{textBuffer:M,disposable:O}=(0,u.createTextBuffer)(I,R),x=n._computeEdits(this.monacoModel,M);this.monacoModel.pushEditOperations([],x,()=>[]),T&&(this.setPersist(this.monacoModel.getAlternativeVersionId()),this.baseContent=I,this.dirtyChanges=[]),O.dispose()}static _computeEdits(I,w){const T=I.getLineCount(),R=w.getLineCount(),M=this._commonPrefix(I,T,1,w,R,1);if(T===R&&M===T)return[];const O=this._commonSuffix(I,T-M,M,w,R-M,M);let x,k;return O>0?(x=new a.Range(M+1,1,T-O+1,1),k=new a.Range(M+1,1,R-O+1,1)):M>0?(x=new a.Range(M,I.getLineMaxColumn(M),T,I.getLineMaxColumn(T)),k=new a.Range(M,1+w.getLineLength(M),R,1+w.getLineLength(R))):(x=new a.Range(1,1,T,I.getLineMaxColumn(T)),k=new a.Range(1,1,R,1+w.getLineLength(R))),[g.EditOperation.replaceMove(x,w.getValueInRange(k,h.EndOfLinePreference.TextDefined))]}static _commonPrefix(I,w,T,R,M,O){const x=Math.min(w,M);let k=0;for(let F=0;F<x&&I.getLineContent(T+F)===R.getLineContent(O+F);F++)k++;return k}static _commonSuffix(I,w,T,R,M,O){const x=Math.min(w,M);let k=0;for(let F=0;F<x&&I.getLineContent(T+w-F)===R.getLineContent(O+M-F);F++)k++;return k}set baseContent(I){this._baseContent=I,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,c.SaveReason.AfterDelay)},this.editorPreferences["editor.autoSaveDelay"]||1e3),this.addDispose(this.editorPreferences.onPreferenceChanged(I=>{I.preferenceName==="editor.autoSaveDelay"&&(this._tryAutoSaveAfterDelay=(0,o.default)(()=>{this.save(void 0,c.SaveReason.AfterDelay)},this.editorPreferences["editor.autoSaveDelay"]||1e3))}))),this._tryAutoSaveAfterDelay}getBaseContentMd5(){return this._baseContentMd5||(this._baseContentMd5=this.hashCalculateService.calculate(this._baseContent)),this._baseContentMd5}notifyChangeEvent(I=[],w,T){!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:I,eol:this.eol,isRedoing:w,isUndoing:T,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:M})=>M)},encoding:this.encoding})}async formatOnSave(I){if(this.editorPreferences["editor.formatOnSave"]&&I!==c.SaveReason.AfterDelay){const T=this.editorPreferences["editor.formatOnSaveTimeout"]||3e3,R=this.reporter.time(_.REPORT_NAME.FORMAT_ON_SAVE);try{await Promise.race([new Promise((M,O)=>{setTimeout(()=>{const x=new Error((0,_.formatLocalize)("preference.editor.formatOnSaveTimeoutError",T));x.name="FormatOnSaveTimeoutError",O(x)},T)}),this.commandService.executeCommand(_.EDITOR_COMMANDS.FORMAT_DOCUMENT.id)])}catch(M){M.name==="FormatOnSaveTimeoutError"&&this.reporter.point(_.REPORT_NAME.FORMAT_ON_SAVE_TIMEOUT_ERROR,this.uri.toString()),this.logger.warn(`${y.EditorDocumentError.FORMAT_ERROR} ${M&&M.message}`)}finally{R.timeEnd(this.uri.path.ext)}}}};t.EditorDocumentModel=S,r.__decorate([(0,l.Autowired)(A.IEditorDocumentModelContentRegistry),r.__metadata("design:type",Object)],S.prototype,"contentRegistry",void 0),r.__decorate([(0,l.Autowired)(A.IEditorDocumentModelService),r.__metadata("design:type",Object)],S.prototype,"service",void 0),r.__decorate([(0,l.Autowired)(d.ICompareService),r.__metadata("design:type",Object)],S.prototype,"compareService",void 0),r.__decorate([(0,l.Autowired)(c.IDocPersistentCacheProvider),r.__metadata("design:type",Object)],S.prototype,"cacheProvider",void 0),r.__decorate([(0,l.Autowired)(s.IMessageService),r.__metadata("design:type",Object)],S.prototype,"messageService",void 0),r.__decorate([(0,l.Autowired)(_.IEventBus),r.__metadata("design:type",Object)],S.prototype,"eventBus",void 0),r.__decorate([(0,l.Autowired)(_.ILogger),r.__metadata("design:type",Object)],S.prototype,"logger",void 0),r.__decorate([(0,l.Autowired)(_.CommandService),r.__metadata("design:type",Object)],S.prototype,"commandService",void 0),r.__decorate([(0,l.Autowired)(_.IReporterService),r.__metadata("design:type",Object)],S.prototype,"reporter",void 0),r.__decorate([(0,l.Autowired)(_.PreferenceService),r.__metadata("design:type",Object)],S.prototype,"preferences",void 0),r.__decorate([(0,l.Autowired)(v.IHashCalculateService),r.__metadata("design:type",Object)],S.prototype,"hashCalculateService",void 0),t.EditorDocumentModel=S=n=r.__decorate([(0,l.Injectable)({multiple:!0}),r.__metadata("design:paramtypes",[_.URI,String,Object])],S)},78157:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorDocumentModelContentRegistryImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(96689);let _=class{constructor(){this.providers=[],this._onOriginalDocChanged=new o.Emitter,this.cachedProviders=new o.LRUMap(1e3,500),this.originalProvider={handlesScheme:m=>m===l.ORIGINAL_DOC_SCHEME,provideEditorDocumentModelContent:async m=>{const{target:p}=m.getParsedQuery(),s=new o.URI(p);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 p=m.onDidChangeContent(s=>{this.eventBus.fire(new l.EditorDocumentModelOptionExternalUpdatedEvent(s))});return m!==this.originalProvider&&m.onDidChangeContent&&m.onDidChangeContent(s=>{this._onOriginalDocChanged.fire(o.URI.from({scheme:l.ORIGINAL_DOC_SCHEME,query:o.URI.stringifyQuery({target:s.toString()})}))}),{dispose:()=>{p.dispose();const s=this.providers.indexOf(m);s&&(this.providers.splice(s,1),this.cachedProviders.clear())}}}getProvider(m){const p=m.toString();return this.cachedProviders.has(p)||this.cachedProviders.set(p,this.calculateProvider(m)),this.cachedProviders.get(p)}async calculateProvider(m){let p={provider:void 0,weight:-1,index:1};for(const s of this.providers){let g=-1;const a=this.providers.indexOf(s);s.handlesUri?g=await s.handlesUri(m):s.handlesScheme&&(g=await s.handlesScheme(m.scheme)?10:-1),g>=0&&(g>p.weight||g===p.weight&&a>p.index)&&(p={index:a,weight:g,provider:s})}return p.provider}async getContentForUri(m,p){const s=await this.getProvider(m);if(!s)throw new Error;return s.provideEditorDocumentModelContent(m,p)}};t.EditorDocumentModelContentRegistryImpl=_,n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],_.prototype,"eventBus",void 0),t.EditorDocumentModelContentRegistryImpl=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},37275:(P,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:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MonacoTextModelService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(96689);let _=class{canHandleResource(m){return!0}hasTextModelContentProvider(m){throw new Error("Method not implemented.")}async createModelReference(m){const p=await this.documentModelManager.createModelReference(new o.URI(m.toString()),"monaco");if(p){const s=p.instance.getMonacoModel();return Promise.resolve({object:{textEditorModel:s},dispose:()=>{p.dispose()}})}}registerTextModelContentProvider(m,p){return{dispose(){}}}};t.MonacoTextModelService=_,n.__decorate([(0,r.Autowired)(l.IEditorDocumentModelService),n.__metadata("design:type",Object)],_.prototype,"documentModelManager",void 0),t.MonacoTextModelService=_=n.__decorate([(0,r.Injectable)()],_)},98469:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SaveTask=void 0;const n=e(41869);class r extends n.Disposable{constructor(l,_,v,m,p){super(),this.uri=l,this.versionId=_,this.alternativeVersionId=v,this.content=m,this.ignoreDiff=p,this.deferred=new n.Deferred,this.finished=this.deferred.promise,this.started=!1,this.disposables.push(this.cancelToken=new n.CancellationTokenSource)}async run(l,_,v,m,p){this.started=!0;try{const s=await l.saveEditorDocumentModel(this.uri,this.content,_,v,m,this.ignoreDiff,p,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 l={errorMessage:"cancel",state:n.SaveTaskResponseState.ERROR};this.deferred.resolve(l)}}t.SaveTask=r},66537:(P,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),l=e(68969),_=n.__importStar(e(20868)),v=e(29046),m=e(52902),p=e(79865),s=e(2261),g=e(44781),a=n.__importStar(e(40540)),h=e(84866),u=e(93152),c=e(82196),E=e(96689);function f(A,S){let D=null;if(A.isAttachedToEditor()){for(const I of S.listCodeEditors())if(I.hasModel()&&I.getModel()===A){if(I.hasTextFocus())return I;D=I}}return D}let d=class extends o.WithEventBus{get bulkEditService(){return this.overrideServiceRegistry.getRegisteredService(o.ServiceNames.BULK_EDIT_SERVICE)}activate(){}async onEditorDocumentModelWillSave(S){if(S.payload.reason!==c.SaveReason.Manual)return;const D=this.preferenceService.get("editor.codeActionsOnSave",void 0,S.payload.uri.toString(),S.payload.language);if(!D)return;const I=this.preferenceService.get("editor.codeActionsOnSaveNotification",!0,S.payload.uri.toString(),S.payload.language),w=T=>{const M=(Array.isArray(D)?D:Object.keys(D)).map(N=>new v.CodeActionKind(N));if(Array.isArray(D)||M.sort((N,U)=>v.CodeActionKind.SourceFixAll.contains(N)?v.CodeActionKind.SourceFixAll.contains(U)?0:-1:v.CodeActionKind.SourceFixAll.contains(U)?1:0),M.length===0)return;const O=this.docService.getModelReference(S.payload.uri,"codeActionOnSave");if(!O)return;const x=O.instance.getMonacoModel(),k=new _.CancellationTokenSource,F=this.preferenceService.get("editor.codeActionsOnSaveTimeout",void 0,S.payload.uri.toString(),S.payload.language),L=Array.isArray(D)?[]:Object.keys(D).filter(N=>D[N]===!1).map(N=>new v.CodeActionKind(N));return Promise.race([new Promise((N,U)=>setTimeout(()=>{k.cancel(),U("codeActionsOnSave timeout")},F)),this.applyOnSaveActions(x,M,L,T,k.token)]).finally(()=>{k.cancel(),O.dispose()})};return I?this.progressService.withProgress({title:(0,o.formatLocalize)("editor.saveCodeActions.saving",S.payload.uri.displayName),location:o.ProgressLocation.Notification,cancellable:!0},async T=>w(T)):w(null)}async applyOnSaveActions(S,D,I,w,T){const R=new class{constructor(){this._names=new Set}_report(){w&&w.report({message:(0,o.formatLocalize)("editor.saveCodeActions.getting",[...this._names].map(M=>`'${M}'`).join(", "))})}report(M){M.displayName&&!this._names.has(M.displayName)&&(this._names.add(M.displayName),this._report())}};for(const M of D)try{const O=await this.getActionsToRun(S,M,I,R,T);await this.applyCodeActions(O.validActions)}catch(O){this.logger.error(O)}}async applyCodeActions(S){var D;for(const I of S)I.action.edit&&await((D=this.bulkEditService)===null||D===void 0?void 0:D.apply(m.ResourceEdit.convert(I.action.edit))),I.action.command&&await this.commandService.executeCommand(I.action.command.id,...I.action.command.arguments||[])}async getActionsToRun(S,D,I,w,T){return(0,h.getCodeActions)(p.languageFeaturesService.codeActionProvider,S,S.getFullModelRange(),{type:a.CodeActionTriggerType.Auto,filter:{include:D,excludes:I,includeSourceActions:!0},triggerAction:v.CodeActionTriggerSource.OnSave},w,T)}};t.CodeActionOnSaveParticipant=d,n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],d.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.MonacoOverrideServiceRegistry),n.__metadata("design:type",o.MonacoOverrideServiceRegistry)],d.prototype,"overrideServiceRegistry",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],d.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(E.IEditorDocumentModelService),n.__metadata("design:type",Object)],d.prototype,"docService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],d.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(l.IProgressService),n.__metadata("design:type",Object)],d.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)],d.prototype,"onEditorDocumentModelWillSave",null),t.CodeActionOnSaveParticipant=d=n.__decorate([(0,r.Injectable)()],d);let y=class extends o.WithEventBus{activate(){}async onEditorDocumentModelWillSave(S){if(this.preferenceService.get("files.trimFinalNewlines")){const I=this.docService.getModelReference(S.payload.uri,"trimFinalNewlines");if(!I)return;const w=I.instance.getMonacoModel();this.doTrimFinalNewLines(w,S.payload.reason!==c.SaveReason.Manual),I.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 I=S.getLineCount();if(I===1)return;let w=[],T=0;const R=this.injector.get(u.MonacoCodeService),M=f(S,R);if(M&&(w=M.getSelections(),D))for(let F=0,L=w.length;F<L;F++){const N=w[F].positionLineNumber;N>T&&(T=N)}const O=this.findLastNonEmptyLine(S),x=Math.max(O+1,T+1),k=S.validateRange(new g.Range(x,1,I,S.getLineMaxColumn(I)));k.isEmpty()||(S.pushEditOperations(w,[s.EditOperation.delete(k)],()=>w),M?.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",d)],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:(P,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 l extends n.BasicEvent{}t.EditorDocumentModelOptionExternalUpdatedEvent=l;class _ extends n.BasicEvent{}t.EditorDocumentModelCreationEvent=_;class v extends n.BasicEvent{}t.EditorDocumentModelRemovalEvent=v;class m extends n.BasicEvent{}t.EditorDocumentModelSavedEvent=m;class p extends n.BasicEvent{}t.EditorDocumentModelWillSaveEvent=p,t.ORIGINAL_DOC_SCHEME="original_doc"},71624:(P,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),l=e(66e3),_=e(22689),v=e(43718),m=e(99721),p=e(23418),s=e(55113),g=e(30526),a=e(96689),h=e(59879),u=e(39266),c=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(I=>{this.editorFeatureRegistry.runOneContribution(I,D)})}))}createCodeEditor(D,I,w){const T={...(0,c.getConvertedMonacoOptions)(this.configurationService).editorOptions,...I},R=this.monacoService.createCodeEditor(D,T,w),M=this.injector.get(d,[R,I]);return this._onCodeEditorCreate.fire(M),M}listEditors(){return Array.from(this._editors.values())}getEditorByUri(D){var I;for(const w of this._editors.values())if(!((I=w.currentUri)===null||I===void 0)&&I.isEqual(D))return w}addEditors(D){const I=this._editors.size;D.forEach(w=>{let T=!1;const R=Array.from(this._editors).find(M=>M.currentUri&&w.currentUri&&M.currentUri.isEqual(w.currentUri));R&&R.monacoEditor.getId()===w.monacoEditor.getId()&&(T=!0),T?(w.decorationApplier.clearDecorations(),w.decorationApplier.applyDecorationFromProvider()):(this._editors.add(w),this.editorFeatureRegistry.runContributions(w),w.monacoEditor.onDidFocusEditorWidget(()=>{this._currentEditor=w}),w.monacoEditor.onContextMenu(()=>{this._currentEditor=w}))}),this._editors.size!==I&&this._onCodeEditorChange.fire()}removeEditors(D){const I=this._editors.size;D.forEach(w=>{this._editors.delete(w),this._currentEditor===w&&(this._currentEditor=void 0)}),this._editors.size!==I&&this._onCodeEditorChange.fire()}createDiffEditor(D,I,w){const T=(0,c.getConvertedMonacoOptions)(this.configurationService),R={...T.editorOptions,...T.diffOptions,...I},M=this.monacoService.createDiffEditor(D,R,w),O=this.injector.get(y,[M,I]);return this._onDiffEditorCreate.fire(O),O}createMultiDiffEditor(D,I,w){const T=(0,c.getConvertedMonacoOptions)(this.configurationService),R=this.monacoService.createMultiDiffEditorWidget(D,w),M={...T.diffOptions,...I};return this.injector.get(u.BrowserMultiDiffEditor,[R,M,this])}createMergeEditor(D,I,w){const T=(0,c.getConvertedMonacoOptions)(this.configurationService),R={...T.editorOptions,...T.diffOptions,...I,wordWrap:"off"};return this.monacoService.createMergeEditor(D,R,w)}listDiffEditors(){return Array.from(this._diffEditors.values())}addDiffEditors(D){const I=this._diffEditors.size;D.forEach(w=>{this._diffEditors.has(w)||this._diffEditors.add(w)}),this._diffEditors.size!==I&&this._onDiffEditorChange.fire()}removeDiffEditors(D){const I=this._diffEditors.size;D.forEach(w=>{this._diffEditors.delete(w)}),this._diffEditors.size!==I&&this._onDiffEditorChange.fire()}listMultiDiffEditors(){return Array.from(this._multiDiffEditors.values())}addMultiDiffEditors(D){const I=this._multiDiffEditors.size;D.forEach(w=>{this._multiDiffEditors.has(w)||this._multiDiffEditors.add(w)}),this._multiDiffEditors.size!==I&&this._onMultiDiffEditorChange.fire()}removeMultiDiffEditors(D){const I=this._multiDiffEditors.size;D.forEach(w=>{this._multiDiffEditors.delete(w)}),this._multiDiffEditors.size!==I&&this._onMultiDiffEditorChange.fire()}onDocModelContentChangedEvent(D){this.eventBus.fire(new p.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",_.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)(a.IEditorDocumentModelService),n.__metadata("design:type",Object)],f.prototype,"documentModelService",void 0),n.__decorate([(0,v.OnEvent)(a.EditorDocumentModelContentChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[a.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 d=class extends g.BaseMonacoEditorWrapper{get currentDocumentModel(){return this._currentDocumentModelRef&&!this._currentDocumentModelRef.disposed?this._currentDocumentModelRef.instance:null}getType(){return p.EditorType.CODE}constructor(D,I={}){super(D,p.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=I,this.collectionService.addEditors([this]);const w=D.onDidChangeModel(()=>{b(this.monacoEditor.getDomNode()),w.dispose()});this.addDispose(D.onDidChangeCursorPosition(()=>{if(!this.currentDocumentModel)return;const T=D.getSelection();this._onCursorPositionChanged.fire({position:D.getPosition(),selectionLength:T?this.currentDocumentModel.getMonacoModel().getValueInRange(T).length:0})})),this.addDispose(this.monacoEditor)}layout(D,I=!1){this.monacoEditor.layout(D,I)}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 I=this.currentDocumentModel.getMonacoModel();this.disableSelectionEmitter(),this.monacoEditor.setModel(I),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 p.ResourceDecorationNeedChangeEvent({uri:w.uri,decoration:{readOnly:w.readonly}}))}};t.BrowserCodeEditor=d,n.__decorate([(0,r.Autowired)(p.EditorCollectionService),n.__metadata("design:type",f)],d.prototype,"collectionService",void 0),n.__decorate([(0,r.Autowired)(E.IEditorFeatureRegistry),n.__metadata("design:type",Object)],d.prototype,"editorFeatureRegistry",void 0),t.BrowserCodeEditor=d=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object])],d);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 I=this.editorState.get(this.currentUri.toString());(0,s.isTextEditorViewState)(I)&&((D.range||D.originalRange)&&(I.modified.cursorState=[]),this.monacoDiffEditor.restoreViewState(I))}}constructor(D,I={}){super(),this.monacoDiffEditor=D,this.specialOptions=I,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,c.isDiffEditorOption)(R)).length>0&&this.updateDiffOptions()}))}async compare(D,I,w={},T){if(this.saveCurrentState(),this.originalDocModelRef=D,this.modifiedDocModelRef=I,!this.originalDocModel||!this.modifiedDocModel)return;const R=this.originalDocModel.getMonacoModel(),M=this.modifiedDocModel.getMonacoModel(),O=this.monacoDiffEditor.createViewModel({original:R,modified:M});if(this.monacoDiffEditor.setModel(O),T?this.currentUri=T:this.currentUri=v.URI.from({scheme:p.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(I);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,I=this.modifiedEditor.currentDocumentModel?this.modifiedEditor.currentDocumentModel.languageId:void 0,w=(0,c.getConvertedMonacoOptions)(this.configurationService,D,I),T=this.isReadonly();this.monacoDiffEditor.updateOptions({...w.diffOptions,...this.specialOptions,readOnly:T,renderMarginRevertIcon:!T}),this.currentUri&&this.eventBus.fire(new p.ResourceDecorationNeedChangeEvent({uri:this.currentUri,decoration:{readOnly:this.isReadonly()}}))}updateDiffOptions(){this.doUpdateDiffOptions()}getLineChanges(){const D=this.monacoDiffEditor.getLineChanges();return D?D.map(I=>{var w;return[I.originalStartLineNumber,I.originalEndLineNumber,I.modifiedStartLineNumber,I.modifiedEndLineNumber,(w=I.charChanges)===null||w===void 0?void 0:w.map(T=>[T.originalStartLineNumber,T.originalStartColumn,T.originalEndLineNumber,T.originalEndColumn,T.modifiedStartLineNumber,T.modifiedStartColumn,T.modifiedEndLineNumber,T.modifiedEndColumn])]}):null}wrapEditors(){const D=this;this.originalEditor=this.injector.get(g.DiffEditorPart,[D.monacoDiffEditor.getOriginalEditor(),()=>D.originalDocModel,p.EditorType.ORIGINAL_DIFF]),this.modifiedEditor=this.injector.get(g.DiffEditorPart,[D.monacoDiffEditor.getModifiedEditor(),()=>D.modifiedDocModel,p.EditorType.MODIFIED_DIFF]),this.collectionService.addEditors([this.originalEditor,this.modifiedEditor]),this.collectionService.addDiffEditors([this]);const I=this.contextKeyService.createScoped(this.modifiedEditor.monacoEditor._contextKeyService),w=this.contextKeyService.createScoped(this.originalEditor.monacoEditor._contextKeyService);this.diffResourceKeys=[new l.ResourceContextKey(I,void 0,"diffResource"),new l.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)(p.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:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorElectronContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(37406),v=e(23418),m=e(96689),p=e(82196),s=e(51553);let g=class extends l.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"}),l.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)(_.IElectronMainUIService),n.__metadata("design:type",Object)],g.prototype,"electronMainUIService",void 0),n.__decorate([(0,l.OnEvent)(p.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:(P,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 l=class{async open(v){let m;const p=/^L?(\d+)(?:,(\d+))?/.exec(v.fragment);if(p){const s=parseInt(p[1],10),g=p[2]?parseInt(p[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=l,n.__decorate([(0,r.Autowired)(o.ResourceService),n.__metadata("design:type",o.ResourceService)],l.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(o.WorkbenchEditorService),n.__metadata("design:type",o.WorkbenchEditorService)],l.prototype,"workbenchEditorService",void 0),t.EditorOpener=l=n.__decorate([(0,r.Injectable)()],l)},19352:(P,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)),l=n.__importDefault(e(62251));class _ 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 p=m.pageX-this.draggingStart;this.ref.scrollLeft=this.draggingStartPos+this.calculateXToLeft(p)},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 p=m.pageY-this.draggingStart;this.ref.scrollTop=this.draggingStartPos+this.calculateYToTop(p)},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 p=this.ref.scrollWidth,s=this.ref.offsetWidth,g=this.ref.scrollHeight,a=this.ref.offsetHeight;this.thumbH.style.left=this.position.left*s/p+"px",this.thumbV.style.top=this.position.top*a/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 p=m.target,s=m.clientX-p.getBoundingClientRect().left,g=this.ref.scrollWidth,a=this.ref.offsetWidth,h=s*g/a-.5*a;this.scrollTo({left:h,top:this.position.top})}calculateXToLeft(m){const p=this.ref.scrollWidth,s=this.ref.offsetWidth;return m*p/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 p=m.target,s=m.clientY-p.getBoundingClientRect().top,g=this.ref.scrollHeight,a=this.ref.offsetHeight,h=s*g/a-.5*a;this.scrollTo({left:this.position.left,top:h})}calculateYToTop(m){const p=this.ref.scrollHeight,s=this.ref.offsetHeight;return m*p/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,p){return m&&p&&m.offsetHeight===p.offsetHeight&&m.scrollHeight===p.scrollHeight&&m.offsetWidth===p.offsetWidth&&m.scrollWidth===p.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,p=this.ref.offsetWidth;if(p<m){const a=p*p/m;this.thumbH.style.width=a+"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)({[l.default.scroll]:!0,[l.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)(l.default.scroll,l.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:l.default["scrollbar-decoration-vertical-l"],ref:m=>m&&(this.decorationL=m)}),o.default.createElement("div",{className:l.default["scrollbar-decoration-vertical-r"],ref:m=>m&&(this.decorationR=m)}),o.default.createElement("div",{className:l.default["scroll-horizontal"]},o.default.createElement("div",{className:l.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:l.default["scroll-vertical"]},o.default.createElement("div",{className:l.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=_},93669:(P,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:(P,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),l=e(68456),_=e(93899),v=e(1237),m=e(77661),p=e(75524),s=e(43718),g=e(96177),a=e(62660),h=n.__importStar(e(84555)),u=e(94170),c=e(23268),E=e(96640),f=e(23418),d=e(55113),y=e(64335),b=e(89618),A=e(96689),S=e(75522),D=e(93152),I=e(8287),w=e(14385),T=e(57719),R=e(85857),M=e(95338),O=e(94617),x=e(86997),k=e(93532),F=e(53135),L=e(50236),N=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=p.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:p.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],re=(H=X?.currentResource)===null||H===void 0?void 0:H.uri;X&&re&&await X.split(f.EditorGroupSplitAction.Right,re,{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 re,oe;return X.value===((oe=(re=this.workbenchEditorService.currentCodeEditor)===null||re===void 0?void 0:re.currentDocumentModel)===null||oe===void 0?void 0:oe.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 re=(K=this.workbenchEditorService.currentEditor)===null||K===void 0?void 0:K.currentDocumentModel;if(!V)return;const oe=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),be=(X=re?.encoding)!==null&&X!==void 0?X:q?.encoding;let ge;const te=Object.keys(o.SUPPORTED_ENCODINGS).sort((Pe,Me)=>Pe===oe?-1:Me===oe?1:o.SUPPORTED_ENCODINGS[Pe].order-o.SUPPORTED_ENCODINGS[Me].order).filter(Pe=>Pe===me&&me!==oe?!1:!o.SUPPORTED_ENCODINGS[Pe].encodeOnly).map((Pe,Me)=>((Pe===be||o.SUPPORTED_ENCODINGS[Pe].alias===be)&&(ge=Me),{label:o.SUPPORTED_ENCODINGS[Pe].labelLong,value:Pe,description:Pe}));me&&oe!==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 ge=="number"&&ge++);const fe=await this.quickPickService.show(te,{placeholder:(0,o.localize)("editor.chooseEncoding"),selectIndex(Pe){return Pe?-1:typeof ge=="number"?ge:-1}});if(!fe)return;const Oe=[];if(V.scheme===f.DIFF_SCHEME){const Pe=await this.resourceService.getResource(V);Pe.metadata&&(Oe.push(Pe.metadata.original),Oe.push(Pe.metadata.modified))}else Oe.push(V);Oe.forEach(Pe=>{this.editorDocumentModelService.changeModelOptions(Pe,{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:`
33311
+ `?h.DefaultEndOfLine.CRLF:h.DefaultEndOfLine.LF,{textBuffer:M,disposable:O}=(0,u.createTextBuffer)(I,R),x=n._computeEdits(this.monacoModel,M);this.monacoModel.pushEditOperations([],x,()=>[]),T&&(this.setPersist(this.monacoModel.getAlternativeVersionId()),this.baseContent=I,this.dirtyChanges=[]),O.dispose()}static _computeEdits(I,w){const T=I.getLineCount(),R=w.getLineCount(),M=this._commonPrefix(I,T,1,w,R,1);if(T===R&&M===T)return[];const O=this._commonSuffix(I,T-M,M,w,R-M,M);let x,k;return O>0?(x=new a.Range(M+1,1,T-O+1,1),k=new a.Range(M+1,1,R-O+1,1)):M>0?(x=new a.Range(M,I.getLineMaxColumn(M),T,I.getLineMaxColumn(T)),k=new a.Range(M,1+w.getLineLength(M),R,1+w.getLineLength(R))):(x=new a.Range(1,1,T,I.getLineMaxColumn(T)),k=new a.Range(1,1,R,1+w.getLineLength(R))),[g.EditOperation.replaceMove(x,w.getValueInRange(k,h.EndOfLinePreference.TextDefined))]}static _commonPrefix(I,w,T,R,M,O){const x=Math.min(w,M);let k=0;for(let F=0;F<x&&I.getLineContent(T+F)===R.getLineContent(O+F);F++)k++;return k}static _commonSuffix(I,w,T,R,M,O){const x=Math.min(w,M);let k=0;for(let F=0;F<x&&I.getLineContent(T+w-F)===R.getLineContent(O+M-F);F++)k++;return k}set baseContent(I){this._baseContent=I,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,c.SaveReason.AfterDelay)},this.editorPreferences["editor.autoSaveDelay"]||1e3),this.addDispose(this.editorPreferences.onPreferenceChanged(I=>{I.preferenceName==="editor.autoSaveDelay"&&(this._tryAutoSaveAfterDelay=(0,o.default)(()=>{this.save(void 0,c.SaveReason.AfterDelay)},this.editorPreferences["editor.autoSaveDelay"]||1e3))}))),this._tryAutoSaveAfterDelay}getBaseContentMd5(){return this._baseContentMd5||(this._baseContentMd5=this.hashCalculateService.calculate(this._baseContent)),this._baseContentMd5}notifyChangeEvent(I=[],w,T){!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:I,eol:this.eol,isRedoing:w,isUndoing:T,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:M})=>M)},encoding:this.encoding})}async formatOnSave(I){if(this.editorPreferences["editor.formatOnSave"]&&I!==c.SaveReason.AfterDelay){const T=this.editorPreferences["editor.formatOnSaveTimeout"]||3e3,R=this.reporter.time(_.REPORT_NAME.FORMAT_ON_SAVE);try{await Promise.race([new Promise((M,O)=>{setTimeout(()=>{const x=new Error((0,_.formatLocalize)("preference.editor.formatOnSaveTimeoutError",T));x.name="FormatOnSaveTimeoutError",O(x)},T)}),this.commandService.executeCommand(_.EDITOR_COMMANDS.FORMAT_DOCUMENT.id)])}catch(M){M.name==="FormatOnSaveTimeoutError"&&this.reporter.point(_.REPORT_NAME.FORMAT_ON_SAVE_TIMEOUT_ERROR,this.uri.toString()),this.logger.warn(`${y.EditorDocumentError.FORMAT_ERROR} ${M&&M.message}`)}finally{R.timeEnd(this.uri.path.ext)}}}dispose(){var I;const w=this._tryAutoSaveAfterDelay;(I=w?.cancel)===null||I===void 0||I.call(w),this._tryAutoSaveAfterDelay=void 0;for(const T of this.savingTasks)try{T.dispose()}catch{}this.savingTasks=[],this.dirtyChanges=[],this._baseContent="",this._baseContentMd5=null,this.monacoModel&&!this.monacoModel.isDisposed()&&this.monacoModel.dispose(),this.monacoModel=void 0,super.dispose()}};t.EditorDocumentModel=S,r.__decorate([(0,l.Autowired)(A.IEditorDocumentModelContentRegistry),r.__metadata("design:type",Object)],S.prototype,"contentRegistry",void 0),r.__decorate([(0,l.Autowired)(A.IEditorDocumentModelService),r.__metadata("design:type",Object)],S.prototype,"service",void 0),r.__decorate([(0,l.Autowired)(d.ICompareService),r.__metadata("design:type",Object)],S.prototype,"compareService",void 0),r.__decorate([(0,l.Autowired)(c.IDocPersistentCacheProvider),r.__metadata("design:type",Object)],S.prototype,"cacheProvider",void 0),r.__decorate([(0,l.Autowired)(s.IMessageService),r.__metadata("design:type",Object)],S.prototype,"messageService",void 0),r.__decorate([(0,l.Autowired)(_.IEventBus),r.__metadata("design:type",Object)],S.prototype,"eventBus",void 0),r.__decorate([(0,l.Autowired)(_.ILogger),r.__metadata("design:type",Object)],S.prototype,"logger",void 0),r.__decorate([(0,l.Autowired)(_.CommandService),r.__metadata("design:type",Object)],S.prototype,"commandService",void 0),r.__decorate([(0,l.Autowired)(_.IReporterService),r.__metadata("design:type",Object)],S.prototype,"reporter",void 0),r.__decorate([(0,l.Autowired)(_.PreferenceService),r.__metadata("design:type",Object)],S.prototype,"preferences",void 0),r.__decorate([(0,l.Autowired)(v.IHashCalculateService),r.__metadata("design:type",Object)],S.prototype,"hashCalculateService",void 0),t.EditorDocumentModel=S=n=r.__decorate([(0,l.Injectable)({multiple:!0}),r.__metadata("design:paramtypes",[_.URI,String,Object])],S)},78157:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorDocumentModelContentRegistryImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(96689);let _=class{constructor(){this.providers=[],this._onOriginalDocChanged=new o.Emitter,this.cachedProviders=new o.LRUMap(1e3,500),this.originalProvider={handlesScheme:m=>m===l.ORIGINAL_DOC_SCHEME,provideEditorDocumentModelContent:async m=>{const{target:p}=m.getParsedQuery(),s=new o.URI(p);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 p=m.onDidChangeContent(s=>{this.eventBus.fire(new l.EditorDocumentModelOptionExternalUpdatedEvent(s))});return m!==this.originalProvider&&m.onDidChangeContent&&m.onDidChangeContent(s=>{this._onOriginalDocChanged.fire(o.URI.from({scheme:l.ORIGINAL_DOC_SCHEME,query:o.URI.stringifyQuery({target:s.toString()})}))}),{dispose:()=>{p.dispose();const s=this.providers.indexOf(m);s&&(this.providers.splice(s,1),this.cachedProviders.clear())}}}getProvider(m){const p=m.toString();return this.cachedProviders.has(p)||this.cachedProviders.set(p,this.calculateProvider(m)),this.cachedProviders.get(p)}async calculateProvider(m){let p={provider:void 0,weight:-1,index:1};for(const s of this.providers){let g=-1;const a=this.providers.indexOf(s);s.handlesUri?g=await s.handlesUri(m):s.handlesScheme&&(g=await s.handlesScheme(m.scheme)?10:-1),g>=0&&(g>p.weight||g===p.weight&&a>p.index)&&(p={index:a,weight:g,provider:s})}return p.provider}async getContentForUri(m,p){const s=await this.getProvider(m);if(!s)throw new Error;return s.provideEditorDocumentModelContent(m,p)}};t.EditorDocumentModelContentRegistryImpl=_,n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],_.prototype,"eventBus",void 0),t.EditorDocumentModelContentRegistryImpl=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},37275:(P,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:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MonacoTextModelService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(96689);let _=class{canHandleResource(m){return!0}hasTextModelContentProvider(m){throw new Error("Method not implemented.")}async createModelReference(m){const p=await this.documentModelManager.createModelReference(new o.URI(m.toString()),"monaco");if(p){const s=p.instance.getMonacoModel();return Promise.resolve({object:{textEditorModel:s},dispose:()=>{p.dispose()}})}}registerTextModelContentProvider(m,p){return{dispose(){}}}};t.MonacoTextModelService=_,n.__decorate([(0,r.Autowired)(l.IEditorDocumentModelService),n.__metadata("design:type",Object)],_.prototype,"documentModelManager",void 0),t.MonacoTextModelService=_=n.__decorate([(0,r.Injectable)()],_)},98469:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SaveTask=void 0;const n=e(41869);class r extends n.Disposable{constructor(l,_,v,m,p){super(),this.uri=l,this.versionId=_,this.alternativeVersionId=v,this.content=m,this.ignoreDiff=p,this.deferred=new n.Deferred,this.finished=this.deferred.promise,this.started=!1,this.disposables.push(this.cancelToken=new n.CancellationTokenSource)}async run(l,_,v,m,p){this.started=!0;try{const s=await l.saveEditorDocumentModel(this.uri,this.content,_,v,m,this.ignoreDiff,p,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 l={errorMessage:"cancel",state:n.SaveTaskResponseState.ERROR};this.deferred.resolve(l)}}t.SaveTask=r},66537:(P,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),l=e(68969),_=n.__importStar(e(20868)),v=e(29046),m=e(52902),p=e(79865),s=e(2261),g=e(44781),a=n.__importStar(e(40540)),h=e(84866),u=e(93152),c=e(82196),E=e(96689);function f(A,S){let D=null;if(A.isAttachedToEditor()){for(const I of S.listCodeEditors())if(I.hasModel()&&I.getModel()===A){if(I.hasTextFocus())return I;D=I}}return D}let d=class extends o.WithEventBus{get bulkEditService(){return this.overrideServiceRegistry.getRegisteredService(o.ServiceNames.BULK_EDIT_SERVICE)}activate(){}async onEditorDocumentModelWillSave(S){if(S.payload.reason!==c.SaveReason.Manual)return;const D=this.preferenceService.get("editor.codeActionsOnSave",void 0,S.payload.uri.toString(),S.payload.language);if(!D)return;const I=this.preferenceService.get("editor.codeActionsOnSaveNotification",!0,S.payload.uri.toString(),S.payload.language),w=T=>{const M=(Array.isArray(D)?D:Object.keys(D)).map(N=>new v.CodeActionKind(N));if(Array.isArray(D)||M.sort((N,U)=>v.CodeActionKind.SourceFixAll.contains(N)?v.CodeActionKind.SourceFixAll.contains(U)?0:-1:v.CodeActionKind.SourceFixAll.contains(U)?1:0),M.length===0)return;const O=this.docService.getModelReference(S.payload.uri,"codeActionOnSave");if(!O)return;const x=O.instance.getMonacoModel(),k=new _.CancellationTokenSource,F=this.preferenceService.get("editor.codeActionsOnSaveTimeout",void 0,S.payload.uri.toString(),S.payload.language),L=Array.isArray(D)?[]:Object.keys(D).filter(N=>D[N]===!1).map(N=>new v.CodeActionKind(N));return Promise.race([new Promise((N,U)=>setTimeout(()=>{k.cancel(),U("codeActionsOnSave timeout")},F)),this.applyOnSaveActions(x,M,L,T,k.token)]).finally(()=>{k.cancel(),O.dispose()})};return I?this.progressService.withProgress({title:(0,o.formatLocalize)("editor.saveCodeActions.saving",S.payload.uri.displayName),location:o.ProgressLocation.Notification,cancellable:!0},async T=>w(T)):w(null)}async applyOnSaveActions(S,D,I,w,T){const R=new class{constructor(){this._names=new Set}_report(){w&&w.report({message:(0,o.formatLocalize)("editor.saveCodeActions.getting",[...this._names].map(M=>`'${M}'`).join(", "))})}report(M){M.displayName&&!this._names.has(M.displayName)&&(this._names.add(M.displayName),this._report())}};for(const M of D)try{const O=await this.getActionsToRun(S,M,I,R,T);await this.applyCodeActions(O.validActions)}catch(O){this.logger.error(O)}}async applyCodeActions(S){var D;for(const I of S)I.action.edit&&await((D=this.bulkEditService)===null||D===void 0?void 0:D.apply(m.ResourceEdit.convert(I.action.edit))),I.action.command&&await this.commandService.executeCommand(I.action.command.id,...I.action.command.arguments||[])}async getActionsToRun(S,D,I,w,T){return(0,h.getCodeActions)(p.languageFeaturesService.codeActionProvider,S,S.getFullModelRange(),{type:a.CodeActionTriggerType.Auto,filter:{include:D,excludes:I,includeSourceActions:!0},triggerAction:v.CodeActionTriggerSource.OnSave},w,T)}};t.CodeActionOnSaveParticipant=d,n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],d.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.MonacoOverrideServiceRegistry),n.__metadata("design:type",o.MonacoOverrideServiceRegistry)],d.prototype,"overrideServiceRegistry",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],d.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(E.IEditorDocumentModelService),n.__metadata("design:type",Object)],d.prototype,"docService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],d.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(l.IProgressService),n.__metadata("design:type",Object)],d.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)],d.prototype,"onEditorDocumentModelWillSave",null),t.CodeActionOnSaveParticipant=d=n.__decorate([(0,r.Injectable)()],d);let y=class extends o.WithEventBus{activate(){}async onEditorDocumentModelWillSave(S){if(this.preferenceService.get("files.trimFinalNewlines")){const I=this.docService.getModelReference(S.payload.uri,"trimFinalNewlines");if(!I)return;const w=I.instance.getMonacoModel();this.doTrimFinalNewLines(w,S.payload.reason!==c.SaveReason.Manual),I.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 I=S.getLineCount();if(I===1)return;let w=[],T=0;const R=this.injector.get(u.MonacoCodeService),M=f(S,R);if(M&&(w=M.getSelections(),D))for(let F=0,L=w.length;F<L;F++){const N=w[F].positionLineNumber;N>T&&(T=N)}const O=this.findLastNonEmptyLine(S),x=Math.max(O+1,T+1),k=S.validateRange(new g.Range(x,1,I,S.getLineMaxColumn(I)));k.isEmpty()||(S.pushEditOperations(w,[s.EditOperation.delete(k)],()=>w),M?.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",d)],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:(P,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 l extends n.BasicEvent{}t.EditorDocumentModelOptionExternalUpdatedEvent=l;class _ extends n.BasicEvent{}t.EditorDocumentModelCreationEvent=_;class v extends n.BasicEvent{}t.EditorDocumentModelRemovalEvent=v;class m extends n.BasicEvent{}t.EditorDocumentModelSavedEvent=m;class p extends n.BasicEvent{}t.EditorDocumentModelWillSaveEvent=p,t.ORIGINAL_DOC_SCHEME="original_doc"},71624:(P,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),l=e(66e3),_=e(22689),v=e(43718),m=e(99721),p=e(23418),s=e(55113),g=e(30526),a=e(96689),h=e(59879),u=e(39266),c=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(I=>{this.editorFeatureRegistry.runOneContribution(I,D)})}))}createCodeEditor(D,I,w){const T={...(0,c.getConvertedMonacoOptions)(this.configurationService).editorOptions,...I},R=this.monacoService.createCodeEditor(D,T,w),M=this.injector.get(d,[R,I]);return this._onCodeEditorCreate.fire(M),M}listEditors(){return Array.from(this._editors.values())}getEditorByUri(D){var I;for(const w of this._editors.values())if(!((I=w.currentUri)===null||I===void 0)&&I.isEqual(D))return w}addEditors(D){const I=this._editors.size;D.forEach(w=>{let T=!1;const R=Array.from(this._editors).find(M=>M.currentUri&&w.currentUri&&M.currentUri.isEqual(w.currentUri));R&&R.monacoEditor.getId()===w.monacoEditor.getId()&&(T=!0),T?(w.decorationApplier.clearDecorations(),w.decorationApplier.applyDecorationFromProvider()):(this._editors.add(w),this.editorFeatureRegistry.runContributions(w),w.monacoEditor.onDidFocusEditorWidget(()=>{this._currentEditor=w}),w.monacoEditor.onContextMenu(()=>{this._currentEditor=w}))}),this._editors.size!==I&&this._onCodeEditorChange.fire()}removeEditors(D){const I=this._editors.size;D.forEach(w=>{this._editors.delete(w),this._currentEditor===w&&(this._currentEditor=void 0)}),this._editors.size!==I&&this._onCodeEditorChange.fire()}createDiffEditor(D,I,w){const T=(0,c.getConvertedMonacoOptions)(this.configurationService),R={...T.editorOptions,...T.diffOptions,...I},M=this.monacoService.createDiffEditor(D,R,w),O=this.injector.get(y,[M,I]);return this._onDiffEditorCreate.fire(O),O}createMultiDiffEditor(D,I,w){const T=(0,c.getConvertedMonacoOptions)(this.configurationService),R=this.monacoService.createMultiDiffEditorWidget(D,w),M={...T.diffOptions,...I};return this.injector.get(u.BrowserMultiDiffEditor,[R,M,this])}createMergeEditor(D,I,w){const T=(0,c.getConvertedMonacoOptions)(this.configurationService),R={...T.editorOptions,...T.diffOptions,...I,wordWrap:"off"};return this.monacoService.createMergeEditor(D,R,w)}listDiffEditors(){return Array.from(this._diffEditors.values())}addDiffEditors(D){const I=this._diffEditors.size;D.forEach(w=>{this._diffEditors.has(w)||this._diffEditors.add(w)}),this._diffEditors.size!==I&&this._onDiffEditorChange.fire()}removeDiffEditors(D){const I=this._diffEditors.size;D.forEach(w=>{this._diffEditors.delete(w)}),this._diffEditors.size!==I&&this._onDiffEditorChange.fire()}listMultiDiffEditors(){return Array.from(this._multiDiffEditors.values())}addMultiDiffEditors(D){const I=this._multiDiffEditors.size;D.forEach(w=>{this._multiDiffEditors.has(w)||this._multiDiffEditors.add(w)}),this._multiDiffEditors.size!==I&&this._onMultiDiffEditorChange.fire()}removeMultiDiffEditors(D){const I=this._multiDiffEditors.size;D.forEach(w=>{this._multiDiffEditors.delete(w)}),this._multiDiffEditors.size!==I&&this._onMultiDiffEditorChange.fire()}onDocModelContentChangedEvent(D){this.eventBus.fire(new p.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",_.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)(a.IEditorDocumentModelService),n.__metadata("design:type",Object)],f.prototype,"documentModelService",void 0),n.__decorate([(0,v.OnEvent)(a.EditorDocumentModelContentChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[a.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 d=class extends g.BaseMonacoEditorWrapper{get currentDocumentModel(){return this._currentDocumentModelRef&&!this._currentDocumentModelRef.disposed?this._currentDocumentModelRef.instance:null}getType(){return p.EditorType.CODE}constructor(D,I={}){super(D,p.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=I,this.collectionService.addEditors([this]);const w=D.onDidChangeModel(()=>{b(this.monacoEditor.getDomNode()),w.dispose()});this.addDispose(D.onDidChangeCursorPosition(()=>{if(!this.currentDocumentModel)return;const T=D.getSelection();this._onCursorPositionChanged.fire({position:D.getPosition(),selectionLength:T?this.currentDocumentModel.getMonacoModel().getValueInRange(T).length:0})})),this.addDispose(this.monacoEditor)}layout(D,I=!1){this.monacoEditor.layout(D,I)}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 I=this.currentDocumentModel.getMonacoModel();this.disableSelectionEmitter(),this.monacoEditor.setModel(I),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 p.ResourceDecorationNeedChangeEvent({uri:w.uri,decoration:{readOnly:w.readonly}}))}};t.BrowserCodeEditor=d,n.__decorate([(0,r.Autowired)(p.EditorCollectionService),n.__metadata("design:type",f)],d.prototype,"collectionService",void 0),n.__decorate([(0,r.Autowired)(E.IEditorFeatureRegistry),n.__metadata("design:type",Object)],d.prototype,"editorFeatureRegistry",void 0),t.BrowserCodeEditor=d=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object])],d);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 I=this.editorState.get(this.currentUri.toString());(0,s.isTextEditorViewState)(I)&&((D.range||D.originalRange)&&(I.modified.cursorState=[]),this.monacoDiffEditor.restoreViewState(I))}}constructor(D,I={}){super(),this.monacoDiffEditor=D,this.specialOptions=I,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,c.isDiffEditorOption)(R)).length>0&&this.updateDiffOptions()}))}async compare(D,I,w={},T){if(this.saveCurrentState(),this.originalDocModelRef=D,this.modifiedDocModelRef=I,!this.originalDocModel||!this.modifiedDocModel)return;const R=this.originalDocModel.getMonacoModel(),M=this.modifiedDocModel.getMonacoModel(),O=this.monacoDiffEditor.createViewModel({original:R,modified:M});if(this.monacoDiffEditor.setModel(O),T?this.currentUri=T:this.currentUri=v.URI.from({scheme:p.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(I);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,I=this.modifiedEditor.currentDocumentModel?this.modifiedEditor.currentDocumentModel.languageId:void 0,w=(0,c.getConvertedMonacoOptions)(this.configurationService,D,I),T=this.isReadonly();this.monacoDiffEditor.updateOptions({...w.diffOptions,...this.specialOptions,readOnly:T,renderMarginRevertIcon:!T}),this.currentUri&&this.eventBus.fire(new p.ResourceDecorationNeedChangeEvent({uri:this.currentUri,decoration:{readOnly:this.isReadonly()}}))}updateDiffOptions(){this.doUpdateDiffOptions()}getLineChanges(){const D=this.monacoDiffEditor.getLineChanges();return D?D.map(I=>{var w;return[I.originalStartLineNumber,I.originalEndLineNumber,I.modifiedStartLineNumber,I.modifiedEndLineNumber,(w=I.charChanges)===null||w===void 0?void 0:w.map(T=>[T.originalStartLineNumber,T.originalStartColumn,T.originalEndLineNumber,T.originalEndColumn,T.modifiedStartLineNumber,T.modifiedStartColumn,T.modifiedEndLineNumber,T.modifiedEndColumn])]}):null}wrapEditors(){const D=this;this.originalEditor=this.injector.get(g.DiffEditorPart,[D.monacoDiffEditor.getOriginalEditor(),()=>D.originalDocModel,p.EditorType.ORIGINAL_DIFF]),this.modifiedEditor=this.injector.get(g.DiffEditorPart,[D.monacoDiffEditor.getModifiedEditor(),()=>D.modifiedDocModel,p.EditorType.MODIFIED_DIFF]),this.collectionService.addEditors([this.originalEditor,this.modifiedEditor]),this.collectionService.addDiffEditors([this]);const I=this.contextKeyService.createScoped(this.modifiedEditor.monacoEditor._contextKeyService),w=this.contextKeyService.createScoped(this.originalEditor.monacoEditor._contextKeyService);this.diffResourceKeys=[new l.ResourceContextKey(I,void 0,"diffResource"),new l.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)(p.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:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorElectronContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(37406),v=e(23418),m=e(96689),p=e(82196),s=e(51553);let g=class extends l.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"}),l.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)(_.IElectronMainUIService),n.__metadata("design:type",Object)],g.prototype,"electronMainUIService",void 0),n.__decorate([(0,l.OnEvent)(p.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:(P,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 l=class{async open(v){let m;const p=/^L?(\d+)(?:,(\d+))?/.exec(v.fragment);if(p){const s=parseInt(p[1],10),g=p[2]?parseInt(p[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=l,n.__decorate([(0,r.Autowired)(o.ResourceService),n.__metadata("design:type",o.ResourceService)],l.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(o.WorkbenchEditorService),n.__metadata("design:type",o.WorkbenchEditorService)],l.prototype,"workbenchEditorService",void 0),t.EditorOpener=l=n.__decorate([(0,r.Injectable)()],l)},19352:(P,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)),l=n.__importDefault(e(62251));class _ 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 p=m.pageX-this.draggingStart;this.ref.scrollLeft=this.draggingStartPos+this.calculateXToLeft(p)},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 p=m.pageY-this.draggingStart;this.ref.scrollTop=this.draggingStartPos+this.calculateYToTop(p)},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 p=this.ref.scrollWidth,s=this.ref.offsetWidth,g=this.ref.scrollHeight,a=this.ref.offsetHeight;this.thumbH.style.left=this.position.left*s/p+"px",this.thumbV.style.top=this.position.top*a/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 p=m.target,s=m.clientX-p.getBoundingClientRect().left,g=this.ref.scrollWidth,a=this.ref.offsetWidth,h=s*g/a-.5*a;this.scrollTo({left:h,top:this.position.top})}calculateXToLeft(m){const p=this.ref.scrollWidth,s=this.ref.offsetWidth;return m*p/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 p=m.target,s=m.clientY-p.getBoundingClientRect().top,g=this.ref.scrollHeight,a=this.ref.offsetHeight,h=s*g/a-.5*a;this.scrollTo({left:this.position.left,top:h})}calculateYToTop(m){const p=this.ref.scrollHeight,s=this.ref.offsetHeight;return m*p/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,p){return m&&p&&m.offsetHeight===p.offsetHeight&&m.scrollHeight===p.scrollHeight&&m.offsetWidth===p.offsetWidth&&m.scrollWidth===p.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,p=this.ref.offsetWidth;if(p<m){const a=p*p/m;this.thumbH.style.width=a+"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)({[l.default.scroll]:!0,[l.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)(l.default.scroll,l.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:l.default["scrollbar-decoration-vertical-l"],ref:m=>m&&(this.decorationL=m)}),o.default.createElement("div",{className:l.default["scrollbar-decoration-vertical-r"],ref:m=>m&&(this.decorationR=m)}),o.default.createElement("div",{className:l.default["scroll-horizontal"]},o.default.createElement("div",{className:l.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:l.default["scroll-vertical"]},o.default.createElement("div",{className:l.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=_},93669:(P,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:(P,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),l=e(68456),_=e(93899),v=e(1237),m=e(77661),p=e(75524),s=e(43718),g=e(96177),a=e(62660),h=n.__importStar(e(84555)),u=e(94170),c=e(23268),E=e(96640),f=e(23418),d=e(55113),y=e(64335),b=e(89618),A=e(96689),S=e(75522),D=e(93152),I=e(8287),w=e(14385),T=e(57719),R=e(85857),M=e(95338),O=e(94617),x=e(86997),k=e(93532),F=e(53135),L=e(50236),N=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=p.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:p.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],re=(H=X?.currentResource)===null||H===void 0?void 0:H.uri;X&&re&&await X.split(f.EditorGroupSplitAction.Right,re,{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 re,oe;return X.value===((oe=(re=this.workbenchEditorService.currentCodeEditor)===null||re===void 0?void 0:re.currentDocumentModel)===null||oe===void 0?void 0:oe.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 re=(K=this.workbenchEditorService.currentEditor)===null||K===void 0?void 0:K.currentDocumentModel;if(!V)return;const oe=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),be=(X=re?.encoding)!==null&&X!==void 0?X:q?.encoding;let ge;const te=Object.keys(o.SUPPORTED_ENCODINGS).sort((Pe,Me)=>Pe===oe?-1:Me===oe?1:o.SUPPORTED_ENCODINGS[Pe].order-o.SUPPORTED_ENCODINGS[Me].order).filter(Pe=>Pe===me&&me!==oe?!1:!o.SUPPORTED_ENCODINGS[Pe].encodeOnly).map((Pe,Me)=>((Pe===be||o.SUPPORTED_ENCODINGS[Pe].alias===be)&&(ge=Me),{label:o.SUPPORTED_ENCODINGS[Pe].labelLong,value:Pe,description:Pe}));me&&oe!==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 ge=="number"&&ge++);const fe=await this.quickPickService.show(te,{placeholder:(0,o.localize)("editor.chooseEncoding"),selectIndex(Pe){return Pe?-1:typeof ge=="number"?ge:-1}});if(!fe)return;const Oe=[];if(V.scheme===f.DIFF_SCHEME){const Pe=await this.resourceService.getResource(V);Pe.metadata&&(Oe.push(Pe.metadata.original),Oe.push(Pe.metadata.modified))}else Oe.push(V);Oe.forEach(Pe=>{this.editorDocumentModelService.changeModelOptions(Pe,{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:`
33312
33312
  `},{label:"CRLF",value:`\r
33313
33313
  `}],{placeholder:(0,o.localize)("editor.changeEol"),selectIndex:()=>H.currentDocumentModel.eol===`
33314
33314
  `?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 N.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:re}=H[0],oe=V.currentDocumentModel.getText(new h.Range(K,Y,X,re));this.monacoService.testTokenize(oe,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(T.DocumentFormatService).formatDocumentWith()}}),$.registerCommand(o.EDITOR_COMMANDS.FORMAT_SELECTION_WITH,{execute:async()=>{this.injector.get(T.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(_.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.COPY_PATH.id,group:"10_path",order:1}),$.registerMenuItem(_.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.COPY_RELATIVE_PATH.id,group:"10_path",order:2}),$.registerMenuItem(_.MenuId.BreadcrumbsTitleContext,{command:o.EDITOR_COMMANDS.COPY_PATH.id,group:"0_path",order:1}),$.registerMenuItem(_.MenuId.BreadcrumbsTitleContext,{command:o.EDITOR_COMMANDS.COPY_RELATIVE_PATH.id,group:"0_path",order:2}),$.registerMenuItem(_.MenuId.BreadcrumbsTitleContext,{command:{id:o.FILE_COMMANDS.REVEAL_IN_EXPLORER.id,label:(0,o.localize)("file.revealInExplorer")},group:"1_file",order:3}),$.registerMenuItem(_.MenuId.EditorTitleContext,{command:{id:o.FILE_COMMANDS.REVEAL_IN_EXPLORER.id,label:(0,o.localize)("file.revealInExplorer")},group:"6_file",order:3}),$.registerMenuItem(_.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.SPLIT_TO_LEFT.id,group:"9_split"}),$.registerMenuItem(_.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.SPLIT_TO_RIGHT.id,group:"9_split"}),$.registerMenuItem(_.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.SPLIT_TO_TOP.id,group:"9_split"}),$.registerMenuItem(_.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.SPLIT_TO_BOTTOM.id,group:"9_split"}),$.registerMenuItem(_.MenuId.EditorTitleContext,{command:{id:o.EDITOR_COMMANDS.CLOSE.id,label:(0,o.localize)("editor.title.context.close")},group:"0_tab",order:1}),$.registerMenuItem(_.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.CLOSE_ALL_IN_GROUP.id,group:"0_tab",order:2}),$.registerMenuItem(_.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.CLOSE_SAVED.id,group:"0_tab",order:3}),$.registerMenuItem(_.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.CLOSE_OTHER_IN_GROUP.id,group:"0_tab",order:4}),$.registerMenuItem(_.MenuId.EditorTitleContext,{command:o.EDITOR_COMMANDS.CLOSE_TO_RIGHT.id,group:"0_tab",order:5}),$.registerMenuItem(_.MenuId.EditorTitle,{command:o.EDITOR_COMMANDS.CLOSE_ALL_IN_GROUP.id,group:"0_internal"}),$.registerMenuItem(_.MenuId.EditorTitle,{command:o.EDITOR_COMMANDS.SPLIT_TO_RIGHT.id,iconClass:(0,o.getIcon)("embed"),group:"navigation",when:"resource",order:5}),$.registerMenuItem(_.MenuId.EditorContext,{command:o.EDITOR_COMMANDS.FORMAT_DOCUMENT_WITH.id,group:"1_modification",order:1.3,when:c.ContextKeyExpr.and(u.EditorContextKeys.writable,u.EditorContextKeys.hasMultipleDocumentFormattingProvider)}),$.registerMenuItem(_.MenuId.EditorContext,{command:o.EDITOR_COMMANDS.FORMAT_SELECTION_WITH.id,when:c.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",I.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",M.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)(a.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,l.ComponentContribution,_.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")===d.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")===d.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")===d.AUTO_SAVE_MODE.WINDOWS_LOST_FOCUS&&this.commandService.executeCommand(o.EDITOR_COMMANDS.SAVE_ALL.id,f.SaveReason.FocusOut)}),this.preferenceSettings.setEnumLabels("editor.autoSave",{[d.AUTO_SAVE_MODE.OFF]:(0,o.localize)("editor.autoSave.enum.off"),[d.AUTO_SAVE_MODE.AFTER_DELAY]:(0,o.localize)("editor.autoSave.enum.afterDelay"),[d.AUTO_SAVE_MODE.EDITOR_FOCUS_CHANGE]:(0,o.localize)("editor.autoSave.enum.editorFocusChange"),[d.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!==d.AUTO_SAVE_MODE.OFF){let H=f.SaveReason.FocusOut;V===d.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||d.AUTO_SAVE_MODE.OFF,K=[d.AUTO_SAVE_MODE.AFTER_DELAY,d.AUTO_SAVE_MODE.EDITOR_FOCUS_CHANGE,d.AUTO_SAVE_MODE.WINDOWS_LOST_FOCUS].includes(H)?d.AUTO_SAVE_MODE.OFF:d.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)(N.BrowserEditorContribution,o.CommandContribution)],G)},2863:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorDecorationCollectionService=void 0;const r=e(85608),o=e(76003),l=e(41869),_=e(52416),v=e(10045),m=e(82196);let p=n=class{constructor(){this.decorations=new Map,this.tempId=0,this.decorationProviders=new Map}getNextTempId(){return this.tempId++,"temp-decoration-"+this.tempId}createTextEditorDecorationType(g,a){a||(a=this.getNextTempId());const h=this.resolveDecoration(a,g),u={key:a,property:h,dispose:()=>{a&&this.decorations.has(a)&&(h.dispose(),this.decorations.delete(a),this.eventBus.fire(new m.EditorDecorationTypeRemovedEvent(a)))}};return this.decorations.set(a,u),u}getTextEditorDecorationType(g){return this.decorations.get(g)}resolveDecoration(g,a){const h=this.createThemeCSSStyleCollection(g,a);return{default:h.default,light:h.light,dark:h.dark,isWholeLine:a.isWholeLine||!1,overviewRulerLane:a.overviewRulerLane,dispose:()=>{h.dispose()}}}createThemeCSSStyleCollection(g,a){const h=new l.DisposableStore,c={default:this.addedThemeDecorationToCSSStyleSheet(g,a),light:null,dark:null,dispose:()=>{h.dispose()}};if(a.light){const E=this.addedThemeDecorationToCSSStyleSheet(g+"-light",a.light);c.light=E,h.add(E)}if(a.dark){const E=this.addedThemeDecorationToCSSStyleSheet(g+"-dark",a.dark);c.dark=E,h.add(E)}return c}addedThemeDecorationToCSSStyleSheet(g,a){const h=g,u=g+"-inline",c=new l.DisposableStore;let E,f,d;const y=this.createInlineBlockCSSStyleIfNeeded(),b=this.resolveCSSStyle(a),A=this.resolveInlineCSSStyle(a);if(c.add(this.cssManager.addClass(h,b)),c.add(this.cssManager.addClass(u,A)),a.after){const S=`${g}-after`,D=this.resolveContentCSSStyle(a.after);c.add(this.cssManager.addClass(S+"::after",D)),E=`${y} ${S}`}if(a.before){const S=`${g}-before`,D=this.resolveContentCSSStyle(a.before);c.add(this.cssManager.addClass(S+"::before",D)),f=`${y} ${S}`}if(a.gutterIconPath){const S=this.resolveCSSStyle({backgroundIconSize:a.gutterIconSize,backgroundIcon:a.gutterIconPath.toString()});d=g+"-glyphMargin",c.add(this.cssManager.addClass(d,S))}return{className:h,inlineClassName:u,afterContentClassName:E,beforeContentClassName:f,glyphMarginClassName:d,overviewRulerColor:a.overviewRulerColor,dispose(){return c.dispose()}}}resolveCSSStyle(g){var a;const h=!((a=g.backgroundIcon)===null||a===void 0)&&a.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 a;return g.contentText?a=`"${g.contentText}"`:g.contentIconPath&&(a=`url('${l.URI.from(g.contentIconPath).toString(!0).replace(/'/g,"%27")}')`),{display:"block",content:a,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 a=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))),a.dispose()}}}async getDecorationFromProvider(g,a){const h={};let u=[];return a?this.decorationProviders.has(a)&&u.push(this.decorationProviders.get(a)):u=Array.from(this.decorationProviders.values()),await Promise.all(u.map(async c=>{if(c.schemes&&c.schemes.indexOf(g.scheme)===-1)return;const E=await c.provideEditorDecoration(g);E&&(h[c.key]=E)})),h}};t.EditorDecorationCollectionService=p,p.DISPLAY_INLINE_BLOCK_CLS="display-inline-block-decoration",r.__decorate([(0,o.Autowired)(v.ICSSStyleService),r.__metadata("design:type",Object)],p.prototype,"cssManager",void 0),r.__decorate([(0,o.Autowired)(_.IThemeService),r.__metadata("design:type",Object)],p.prototype,"themeService",void 0),r.__decorate([(0,o.Autowired)(_.IIconService),r.__metadata("design:type",Object)],p.prototype,"iconService",void 0),r.__decorate([(0,o.Autowired)(l.IEventBus),r.__metadata("design:type",Object)],p.prototype,"eventBus",void 0),t.EditorDecorationCollectionService=p=n=r.__decorate([(0,o.Injectable)()],p)},93152:(P,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),l=e(43718),_=n.__importStar(e(20868)),v=e(76947),m=e(18099),p=e(79731),s=e(16781),g=e(7760),a=e(26917),h=e(23418),u=e(51553);let c=class extends m.AbstractCodeEditorService{constructor(){super(s.StandaloneServices.get(g.IStandaloneThemeService))}getActiveCodeEditor(){return this.workbenchEditorService.currentEditor?this.workbenchEditorService.currentEditor.monacoEditor:null}async openCodeEditor(d,y,b){var A,S,D,I,w,T;const R=d.resource;if(!this.preferenceService.get("editor.enablePreviewFromCodeNavigation")&&y&&!b&&(0,v.isEqual)((A=y.getModel())===null||A===void 0?void 0:A.uri,d.resource)){for(const N of this.workbenchEditorService.editorGroups)if(((S=N.currentOpenType)===null||S===void 0?void 0:S.type)===h.EditorOpenType.code){if(((D=N.currentEditor)===null||D===void 0?void 0:D.monacoEditor)===y){N.pinPreviewed((I=N.currentResource)===null||I===void 0?void 0:I.uri);break}}else if(((w=N.currentOpenType)===null||w===void 0?void 0:w.type)===h.EditorOpenType.diff&&(N.diffEditor.modifiedEditor.monacoEditor===y||N.diffEditor.originalEditor.monacoEditor===y)){N.pinPreviewed((T=N.currentResource)===null||T===void 0?void 0:T.uri);break}}let O=this.workbenchEditorService.currentEditorGroup,x;y&&(O=this.workbenchEditorService.editorGroups.find(N=>N.currentEditor&&N.currentEditor.monacoEditor===y)||O,x=O.resources.findIndex(N=>O.currentResource&&N.uri===O.currentResource.uri),x>=0&&x++);const k=d.options?d.options.selection:null;let F;k&&(typeof k.endLineNumber=="number"&&typeof k.endColumn=="number"?F=k:F=new _.Range(k.startLineNumber,k.startColumn,k.startLineNumber,k.startColumn));const L=l.URI.parse(R.toString());return await O.open(L,{index:x,range:F,focus:!0}),O.codeEditor.monacoEditor}};t.MonacoCodeService=c,n.__decorate([(0,r.Autowired)(h.WorkbenchEditorService),n.__metadata("design:type",u.WorkbenchEditorServiceImpl)],c.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],c.prototype,"preferenceService",void 0),t.MonacoCodeService=c=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],c);class E extends a.ContextViewService{constructor(d){super(new p.EditorScopedLayoutService(document.body,d))}setContainer(d){this.menuContainer||(this.menuContainer=document.createElement("div"),this.menuContainer.className=d.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:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorStatusBarService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(26542),_=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:a}=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}${a?`\uFF08%status-bar.label.selected%${a}\uFF09`:""}`,priority:4,alignment:l.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="",a="",h="",u=!1,c=2;const E=s.currentDocumentModel;E&&(g=E.languageId,a=E.encoding,h=E.eol,u=E.getMonacoModel().getOptions().insertSpaces,c=E.getMonacoModel().getOptions().tabSize);const f=h===`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensumi/cli-engine",
3
- "version": "3.9.1-next-1756901517.0",
3
+ "version": "3.9.1-next-1760616868.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-1756901517.0",
30
- "@opensumi/ide-core-common": "3.9.1-next-1756901517.0",
31
- "@opensumi/ide-core-node": "3.9.1-next-1756901517.0",
32
- "@opensumi/ide-express-file-server": "3.9.1-next-1756901517.0",
33
- "@opensumi/ide-extension": "3.9.1-next-1756901517.0",
34
- "@opensumi/ide-i18n": "3.9.1-next-1756901517.0",
35
- "@opensumi/ide-main-layout": "3.9.1-next-1756901517.0",
36
- "@opensumi/ide-startup": "3.9.1-next-1756901517.0",
29
+ "@opensumi/ide-core-browser": "3.9.1-next-1760616868.0",
30
+ "@opensumi/ide-core-common": "3.9.1-next-1760616868.0",
31
+ "@opensumi/ide-core-node": "3.9.1-next-1760616868.0",
32
+ "@opensumi/ide-express-file-server": "3.9.1-next-1760616868.0",
33
+ "@opensumi/ide-extension": "3.9.1-next-1760616868.0",
34
+ "@opensumi/ide-i18n": "3.9.1-next-1760616868.0",
35
+ "@opensumi/ide-main-layout": "3.9.1-next-1760616868.0",
36
+ "@opensumi/ide-startup": "3.9.1-next-1760616868.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": "b759ebeb7e14c8cc09124768e996fcdb02bb8529"
75
+ "gitHead": "81bf02b037ad99983a7c81323d664eda567e0d35"
76
76
  }