import"../cm_headless/cm_headless.js";import"../third_party/codemirror/package/mode/css/css.js";import"../third_party/codemirror/package/mode/xml/xml.js";import*as Platform from"../platform/platform.js";import*as FormatterWorker from"./formatter_worker.js";self.onmessage=function(e){const r=e.data.method,t=e.data.params;if(r)switch(r){case"format":self.postMessage(FormatterWorker.FormatterWorker.format(t.mimeType,t.content,t.indentString));break;case"parseCSS":FormatterWorker.CSSRuleParser.parseCSS(t.content,self.postMessage);break;case"javaScriptOutline":self.postMessage(FormatterWorker.JavaScriptOutline.javaScriptOutline(t.content));break;case"javaScriptIdentifiers":self.postMessage(FormatterWorker.FormatterWorker.javaScriptIdentifiers(t.content));break;case"evaluatableJavaScriptSubstring":self.postMessage(FormatterWorker.FormatterWorker.evaluatableJavaScriptSubstring(t.content));break;case"findLastExpression":self.postMessage(FormatterWorker.FormatterWorker.findLastExpression(t.content));break;case"findLastFunctionCall":self.postMessage(FormatterWorker.FormatterWorker.findLastFunctionCall(t.content));break;case"argumentsList":self.postMessage(FormatterWorker.FormatterWorker.argumentsList(t.content));break;default:Platform.assertNever(r,`Unsupport method name: ${r}`)}},self.postMessage("workerReady");