sphinxcontrib-dotnetdomain icon indicating copy to clipboard operation
sphinxcontrib-dotnetdomain copied to clipboard

Fix expected failure with brace syntax

Open agjohnson opened this issue 9 years ago • 8 comments

Unknown brace syntax is Foo.Bar{1}`

Found an unknown brace syntax, failing test here: https://github.com/rtfd/sphinxcontrib-dotnetdomain/blob/083dccdf42b2f960f41770e57e34f1cf668df2de/tests/test_signature.py#L96-L100

agjohnson avatar Jul 07 '15 19:07 agjohnson

@terrajobst @chenkennt @vacancy

Not sure on this one - what's an example of a real .NET type that uses this syntax?

danroth27 avatar Jul 07 '15 20:07 danroth27

Here are a couple, it seems to be only in parameter lists -- though I can't be certain:

Microsoft.CodeAnalysis.Options.OptionSet.GetOption``1(Microsoft.CodeAnalysis.Options.Option{``0})
System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{`0,`0}}

agjohnson avatar Jul 07 '15 20:07 agjohnson

Will revisit this when I have a working BuildMeta environment.

agjohnson avatar Jul 08 '15 21:07 agjohnson

Is this brace syntax another form of generic declaration?

That is, is System.Linq.Expressions.Expression{System.Func{{TUser},System.Boolean}} equatable to System.Linq.Expressions.Expression<System.Func<<TUser>,System.Boolean>>

And is there any difference?

agjohnson avatar Aug 17 '15 22:08 agjohnson

Foo.Bar{`1} is a generic instantiation using the second parameter of class Foo. @agjohnson, could you share the yaml file generated from docfx?

chenkennt avatar Aug 19 '15 04:08 chenkennt

@chenkennt sorry for the delay, here's a file i've just generated with a few examples of the curly brace syntax: https://gist.github.com/agjohnson/dc09d43375c7ab852a0e#file-iuserclaimstore-1-yml-L71-L88

% docfx --version
Error: xdoc.exe 0.1.120.0

agjohnson avatar Sep 09 '15 00:09 agjohnson

@agjohnson could you point out the place where you think is a problem? I briefly looked at the file and didn't find any problem.

@vwxyzh

chenkennt avatar Sep 09 '15 03:09 chenkennt

So, I think the issue here is with any use of the Foo.Bar{Type} notation, as this isn't a display notation, or C# notation, that we can use for linking. All of the current definitions and cross references use the C# notation given with the item uid parameter.

Ideally, the parameter type -- and return type, and several other places that use the brace syntax -- should also include a C# notation that we can use for references. The notation as it stands would require an addition lookup layer to resolve the brace notation on top of our cross reference lookup.

agjohnson avatar Sep 09 '15 03:09 agjohnson