提交 a8a81c68 编写于 作者: I isidor

fixes #33359

上级 785c7645
......@@ -5,6 +5,7 @@
import fs = require('fs');
import path = require('path');
import { parse } from 'vs/base/common/json';
import * as nls from 'vs/nls';
import uri from 'vs/base/common/uri';
import { TPromise } from 'vs/base/common/winjs.base';
......@@ -147,12 +148,20 @@ export class Adapter {
if (typeof this.rawAdapter.initialConfigurations === 'string') {
// Contributed initialConfigurations is a command that needs to be invoked
// Debug adapter will dynamically provide the full launch.json
// TODO@Isidor stop supporting initialConfigurations
return this.commandService.executeCommand<string>(<string>this.rawAdapter.initialConfigurations, folderUri).then(content => {
// Debug adapter returned the full content of the launch.json - return it after format
if (editorConfig.editor.insertSpaces) {
content = content.replace(new RegExp('\t', 'g'), strings.repeat(' ', editorConfig.editor.tabSize));
try {
const config = parse(content);
config.configurations.push(...initialConfigs);
content = JSON.stringify(config, null, '\t').split('\n').map(line => '\t' + line).join('\n').trim();
} catch (e) {
// noop
}
if (editorConfig.editor && editorConfig.editor.insertSpaces) {
content = content.replace(new RegExp('\t', 'g'), strings.repeat(' ', editorConfig.editor.tabSize));
}
return content;
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册