/*---------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/
"use strict";var __extends=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n};define("vs/workbench/common/textEditorWorker",["require","exports","vs/editor/common/modes/abstractModeWorker","vs/base/common/strings","vs/base/common/arrays","vs/base/common/paths","vs/editor/common/core/range"],function(e,t,n,r,i,o,a){var s=function(e){function t(n,r,i){e.call(this,n,r,i),this._contextService=n.contextService;var o=this._contextService.getWorkspace();this.patterns=o?t.createPatterns(o):[]}return __extends(t,e),Object.defineProperty(t.prototype,"contextService",{get:function(){return this._contextService},enumerable:!0,configurable:!0}),t.prototype.computeLinks=function(n){var r=this;return e.prototype.computeLinks.call(this,n).then(function(e){if(!r.patterns.length)return e;for(var i=r.resourceService.get(n),o=1,a=i.getLineCount();a>=o;o++)e=e.concat(t.detectLinks(i.getLineContent(o),o,r.patterns,r._contextService));return e})},t.createPatterns=function(e){var t=[],n=i.distinct([o.normalize(e.resource.fsPath,!0),o.normalize(e.resource.fsPath,!1)]);return n.forEach(function(e){t.push(new RegExp(r.escapeRegExpCharacters(e)+"(\\S*) on line ((\\d+)(, column (\\d+))?)","gi")),t.push(new RegExp(r.escapeRegExpCharacters(e)+"(\\S*):line ((\\d+)(, column (\\d+))?)","gi")),t.push(new RegExp(r.escapeRegExpCharacters(e)+"([^\\s\\(\\)]*)(\\s?\\((\\d+)(,(\\d+))?)\\)","gi")),t.push(new RegExp(r.escapeRegExpCharacters(e)+"([^:\\s\\(\\)<>'\"\\[\\]]*)(:(\\d+))?(:(\\d+))?","gi"))}),t},t.detectLinks=function(e,t,n,i){var o=[];return n.forEach(function(n){n.lastIndex=0;for(var s,c=0;null!==(s=n.exec(e));){var u=r.replaceAll(r.rtrim(s[1],"."),"\\","/"),l=i.toResource(u).toString();if(s[3]){var p=s[3];if(s[5]){var d=s[5];l=r.format("{0}#{1},{2}",l,p,d)}else l=r.format("{0}#{1}",l,p)}var m=r.rtrim(s[0],"."),h=e.indexOf(m,c);c+=h+m.length;var f={startColumn:h+1,startLineNumber:t,endColumn:h+1+m.length,endLineNumber:t};if(o.some(function(e){return a.Range.areIntersectingOrTouching(e.range,f)}))return;o.push({range:f,url:l})}}),o},t}(n.AbstractModeWorker);t.TextEditorWorker=s});var __extends=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n};define("vs/workbench/parts/output/common/outputWorker",["require","exports","vs/workbench/common/textEditorWorker"],function(e,t,n){var r=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t}(n.TextEditorWorker);t.OutputWorker=r});