[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
3 changed files with 22 additions and 16 deletions
|
@ -297,16 +297,16 @@ namespace Bind
|
|||
if (!String.IsNullOrEmpty(category) || !String.IsNullOrEmpty(warning))
|
||||
{
|
||||
sw.Write(WriteOptions.NoIndent, "{0}{1}", category, warning);
|
||||
if (!String.IsNullOrEmpty(docs.Summary))
|
||||
{
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("/// {0}", docs.Summary);
|
||||
sw.WriteLine("/// </summary>");
|
||||
}
|
||||
else
|
||||
{
|
||||
sw.WriteLine(WriteOptions.NoIndent, "</summary>");
|
||||
}
|
||||
}
|
||||
if (!String.IsNullOrEmpty(docs.Summary))
|
||||
{
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("/// {0}", docs.Summary);
|
||||
sw.WriteLine("/// </summary>");
|
||||
}
|
||||
else
|
||||
{
|
||||
sw.WriteLine(WriteOptions.NoIndent, "</summary>");
|
||||
}
|
||||
|
||||
// Write function parameters
|
||||
|
@ -332,7 +332,8 @@ namespace Bind
|
|||
|
||||
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(
|
||||
"[Warning] Parameter '{0}' in function '{1}' has incorrect doc name '{2}'",
|
||||
|
|
|
@ -41,9 +41,14 @@ namespace Bind
|
|||
throw new ArgumentNullException();
|
||||
|
||||
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 DefaultOutputNamespace = "OpenTK.Graphics.OpenGL";
|
||||
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 DefaultOverridesFile = "GL2/gloverrides.xml";
|
||||
public string DefaultLanguageTypeMapFile = "csharp.tm";
|
||||
|
@ -34,7 +34,7 @@ namespace Bind
|
|||
public string DefaultWrappersFile = "GL.cs";
|
||||
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,
|
||||
wrappersFile;
|
||||
Nullable<Legacy> compatibility;
|
||||
|
@ -42,7 +42,7 @@ namespace Bind
|
|||
public string OutputPath { get { return outputPath ?? DefaultOutputPath; } set { outputPath = value; } }
|
||||
public string OutputNamespace { get { return outputNamespace ?? DefaultOutputNamespace; } set { outputNamespace = 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 OverridesFile { get { return overridesFile ?? DefaultOverridesFile; } set { overridesFile = value; } }
|
||||
public string LanguageTypeMapFile { get { return languageTypeMapFile ?? DefaultLanguageTypeMapFile; } set { languageTypeMapFile = value; } }
|
||||
|
|
Loading…
Reference in a new issue