mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-08 16:10:49 +00:00
[Bind] Corrected CSharpSpecWriter output and warning messages
CSharpSpecWriter now correctly outputs doc summaries on ARB_imaging functions that do not have a version/deprecation string. Additionally, it no longer warns about documentation parameter mismatches for parameters matching C# keywords.
This commit is contained in:
parent
d68c31a561
commit
bd920a15f2
|
@ -297,6 +297,7 @@ namespace Bind
|
||||||
if (!String.IsNullOrEmpty(category) || !String.IsNullOrEmpty(warning))
|
if (!String.IsNullOrEmpty(category) || !String.IsNullOrEmpty(warning))
|
||||||
{
|
{
|
||||||
sw.Write(WriteOptions.NoIndent, "{0}{1}", category, warning);
|
sw.Write(WriteOptions.NoIndent, "{0}{1}", category, warning);
|
||||||
|
}
|
||||||
if (!String.IsNullOrEmpty(docs.Summary))
|
if (!String.IsNullOrEmpty(docs.Summary))
|
||||||
{
|
{
|
||||||
sw.WriteLine();
|
sw.WriteLine();
|
||||||
|
@ -307,7 +308,6 @@ namespace Bind
|
||||||
{
|
{
|
||||||
sw.WriteLine(WriteOptions.NoIndent, "</summary>");
|
sw.WriteLine(WriteOptions.NoIndent, "</summary>");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Write function parameters
|
// Write function parameters
|
||||||
for (int i = 0; i < f.Parameters.Count; i++)
|
for (int i = 0; i < f.Parameters.Count; i++)
|
||||||
|
@ -332,7 +332,8 @@ namespace Bind
|
||||||
|
|
||||||
if (docparam != null)
|
if (docparam != null)
|
||||||
{
|
{
|
||||||
if (docparam.Name != param.RawName)
|
if (docparam.Name != param.RawName &&
|
||||||
|
docparam.Name != param.RawName.Substring(1)) // '@ref' -> 'ref' etc
|
||||||
{
|
{
|
||||||
Console.Error.WriteLine(
|
Console.Error.WriteLine(
|
||||||
"[Warning] Parameter '{0}' in function '{1}' has incorrect doc name '{2}'",
|
"[Warning] Parameter '{0}' in function '{1}' has incorrect doc name '{2}'",
|
||||||
|
|
|
@ -41,9 +41,14 @@ namespace Bind
|
||||||
throw new ArgumentNullException();
|
throw new ArgumentNullException();
|
||||||
|
|
||||||
Generator = generator;
|
Generator = generator;
|
||||||
foreach (string file in Directory.GetFiles(Settings.DocPath))
|
foreach (string file in Directory.GetFiles(Settings.DocPath).Concat(
|
||||||
|
Directory.GetFiles(Settings.FallbackDocPath)))
|
||||||
{
|
{
|
||||||
DocumentationFiles.Add(Path.GetFileName(file), file);
|
var name = Path.GetFileName(file);
|
||||||
|
if (!DocumentationFiles.ContainsKey(name))
|
||||||
|
{
|
||||||
|
DocumentationFiles.Add(name, file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace Bind
|
||||||
public string DefaultOutputPath = "../../../Source/OpenTK/Graphics/OpenGL";
|
public string DefaultOutputPath = "../../../Source/OpenTK/Graphics/OpenGL";
|
||||||
public string DefaultOutputNamespace = "OpenTK.Graphics.OpenGL";
|
public string DefaultOutputNamespace = "OpenTK.Graphics.OpenGL";
|
||||||
public string DefaultDocPath = "../../../Source/Bind/Specifications/Docs";
|
public string DefaultDocPath = "../../../Source/Bind/Specifications/Docs";
|
||||||
public string DefaultDocFile = "ToInlineDocs.xslt";
|
public string DefaultFallbackDocPath = "../../../Source/Bind/Specifications/Docs/GL";
|
||||||
public string DefaultLicenseFile = "License.txt";
|
public string DefaultLicenseFile = "License.txt";
|
||||||
public string DefaultOverridesFile = "GL2/gloverrides.xml";
|
public string DefaultOverridesFile = "GL2/gloverrides.xml";
|
||||||
public string DefaultLanguageTypeMapFile = "csharp.tm";
|
public string DefaultLanguageTypeMapFile = "csharp.tm";
|
||||||
|
@ -34,7 +34,7 @@ namespace Bind
|
||||||
public string DefaultWrappersFile = "GL.cs";
|
public string DefaultWrappersFile = "GL.cs";
|
||||||
public Legacy DefaultCompatibility = Legacy.NoDropMultipleTokens;
|
public Legacy DefaultCompatibility = Legacy.NoDropMultipleTokens;
|
||||||
|
|
||||||
string inputPath, outputPath, outputNamespace, docPath, docFile, licenseFile, overridesFile,
|
string inputPath, outputPath, outputNamespace, docPath, fallbackDocPath, licenseFile, overridesFile,
|
||||||
languageTypeMapFile, keywordEscapeCharacter, importsFile, delegatesFile, enumsFile,
|
languageTypeMapFile, keywordEscapeCharacter, importsFile, delegatesFile, enumsFile,
|
||||||
wrappersFile;
|
wrappersFile;
|
||||||
Nullable<Legacy> compatibility;
|
Nullable<Legacy> compatibility;
|
||||||
|
@ -42,7 +42,7 @@ namespace Bind
|
||||||
public string OutputPath { get { return outputPath ?? DefaultOutputPath; } set { outputPath = value; } }
|
public string OutputPath { get { return outputPath ?? DefaultOutputPath; } set { outputPath = value; } }
|
||||||
public string OutputNamespace { get { return outputNamespace ?? DefaultOutputNamespace; } set { outputNamespace = value; } }
|
public string OutputNamespace { get { return outputNamespace ?? DefaultOutputNamespace; } set { outputNamespace = value; } }
|
||||||
public string DocPath { get { return docPath ?? DefaultDocPath; } set { docPath = value; } }
|
public string DocPath { get { return docPath ?? DefaultDocPath; } set { docPath = value; } }
|
||||||
public string DocFile { get { return docFile ?? DefaultDocFile; } set { docFile = value; } }
|
public string FallbackDocPath { get { return fallbackDocPath ?? DefaultFallbackDocPath; } set { fallbackDocPath = value; } }
|
||||||
public string LicenseFile { get { return licenseFile ?? DefaultLicenseFile; } set { licenseFile = value; } }
|
public string LicenseFile { get { return licenseFile ?? DefaultLicenseFile; } set { licenseFile = value; } }
|
||||||
public string OverridesFile { get { return overridesFile ?? DefaultOverridesFile; } set { overridesFile = value; } }
|
public string OverridesFile { get { return overridesFile ?? DefaultOverridesFile; } set { overridesFile = value; } }
|
||||||
public string LanguageTypeMapFile { get { return languageTypeMapFile ?? DefaultLanguageTypeMapFile; } set { languageTypeMapFile = value; } }
|
public string LanguageTypeMapFile { get { return languageTypeMapFile ?? DefaultLanguageTypeMapFile; } set { languageTypeMapFile = value; } }
|
||||||
|
|
Loading…
Reference in a new issue