190
191
getInitialConfigurationContent(initialConfigs?: IConfig[]): Promise<string> {
192
>
// at this point we got some configs from the package.json and/or from registered DebugConfigurationProviders
debugger.ts
193
>
let initialConfigurations = this.debuggerContribution.initialConfigurations || [];
194
>
if (initialConfigs) {
195
initialConfigurations = initialConfigurations.concat(initialConfigs);
196
}
198
>
const eol = this.resourcePropertiesService.getEOL(URI.from({ scheme: Schemas.untitled, path: '1' })) === '\r\n' ? '\r\n' : '\n';
199
>
const configs = JSON.stringify(initialConfigurations, null, '\t').split('\n').map(line => '\t' + line).join(eol).trim();
200
>
const comment1 = nls.localize('launch.config.comment1', "Use IntelliSense to learn about possible attributes.");
201
>
const comment2 = nls.localize('launch.config.comment2', "Hover to view descriptions of existing attributes.");
202
>
const comment3 = nls.localize('launch.config.comment3', "For more information, visit: {0}", 'https://go.microsoft.com/fwlink/?linkid=830387');
203
>
204
>
let content = [
205
>
'{',
206
>
`\t// ${comment1}`,
207
>
`\t// ${comment2}`,
208
>
`\t// ${comment3}`,
209
>
`\t"version": "0.2.0",`,
210
>
`\t"configurations": ${configs}`,
211
>
'}'
212
>
].join(eol);
213
>
214
>
// fix formatting
215
>
const editorConfig = this.configurationService.getValue<any>();
216
>
if (editorConfig.editor && editorConfig.editor.insertSpaces) {
217
content = content.replace(new RegExp('\t', 'g'), ' '.repeat(editorConfig.editor.tabSize));
218
}
220
>
return Promise.resolve(content);
221
>
}
222
223
getMainExtensionDescriptor(): IExtensionDescription {