diff --git a/utils/doclint/generateDotnetApi.js b/utils/doclint/generateDotnetApi.js index 567a0f62c3..04b8007a93 100644 --- a/utils/doclint/generateDotnetApi.js +++ b/utils/doclint/generateDotnetApi.js @@ -98,7 +98,7 @@ classNameMap.set('Readable', 'Stream'); * @param {string} folder * @param {string} extendsName */ -function writeFile(kind, name, spec, body, folder, extendsName = null) { +function writeFile(kind, name, spec, body, folder, extendsName = null, namespace = "Microsoft.Playwright") { const out = []; // console.log(`Generating ${name}`); @@ -124,7 +124,7 @@ function writeFile(kind, name, spec, body, folder, extendsName = null) { out.push(...body); out.push('}'); - let content = template.replace('[CONTENT]', out.join(EOL)); + let content = template.replace('[NAMESPACE]', namespace).replace('[CONTENT]', out.join(EOL)); fs.writeFileSync(path.join(folder, name + '.cs'), content); } @@ -184,7 +184,8 @@ function renderBaseClass(clazz) { [], body, adaptersDir, - null); + null, + 'Microsoft.Playwright.Core'); } /** diff --git a/utils/doclint/templates/interface.cs b/utils/doclint/templates/interface.cs index e2b3da3c1f..3e2aff2e48 100644 --- a/utils/doclint/templates/interface.cs +++ b/utils/doclint/templates/interface.cs @@ -37,7 +37,7 @@ using System.Threading.Tasks; #nullable enable -namespace Microsoft.Playwright +namespace [NAMESPACE] { [CONTENT] } diff --git a/utils/generate_dotnet_channels.js b/utils/generate_dotnet_channels.js index ee3f6bcf23..38782f50c0 100755 --- a/utils/generate_dotnet_channels.js +++ b/utils/generate_dotnet_channels.js @@ -150,6 +150,7 @@ for (const [name, item] of Object.entries(protocol)) { const initializerName = channelName + 'Initializer'; const superName = inherits.get(name); channels_ts.push('using System.Collections.Generic;'); + channels_ts.push('using Microsoft.Playwright.Core;'); channels_ts.push(``); channels_ts.push(`namespace Microsoft.Playwright.Transport.Protocol`); channels_ts.push(`{`);