Zaid-Ajaj / Feliz

A fresh retake of the React API in Fable and a collection of high-quality components to build React applications in F#, optimized for happiness
https://zaid-ajaj.github.io/Feliz/
MIT License
534 stars 78 forks source link

`prop.type'` doc error. #555

Closed mrakgr closed 1 year ago

mrakgr commented 1 year ago

I get the following error when I hover over prop.type' in the editor:

internal error: 'doc/members/member[@name='M:Feliz.prop.type'(System.String)']' has an invalid token.

I am guessing it is the ' in type' name that is causing the error.

MangelMaxime commented 1 year ago

Hello,

How can we reproduce this error?

Is it when building with Fable? When running dotnet build?

mrakgr commented 1 year ago
open Feliz
prop.type'

I tried doing this in the Vite template just now and it happens. Just hover over the type' with the cursor inside VS Code. If it doesn't happen for you, tell me and I'll try to come up with a concrete example.

MangelMaxime commented 1 year ago

If the bug is inside VSCode, then I don't think the problem is in Feliz but more in the tooltip provider.

mrakgr commented 1 year ago

It happen in big VS as well. Just now before it fully loaded the error message was different when I hovered over it. It said that it was an unclosed string.

Zaid-Ajaj commented 1 year ago

@mrakgr I feel like this is more an issue with editors themselves rather than Feliz. Maybe dotnet/fsharp is a more suitable place for this issue 🙏

mrakgr commented 1 year ago

I don't know. Can you show me where the docs for prop.type' are supposed to be? This part 'M:Feliz.prop.type'(System.String)' is definitely an unclosed string. But I find it weird that it is using JS strings instead of the .NET strings. I want to study how it is generated. It just feels unlikely for this to be an editor bug.

MangelMaxime commented 1 year ago

@mrakgr Because the error happen in the editor while compilation works fine it means that this is an editor related problems.

The error you are seeing is the XMLPath used by the editor to try to find the documentation of method. The problem is that the generated XMLPath is invalid as you can see it generates a non closed string (3 '):

doc/members/member[@name='M:Feliz.prop.type'(System.String)']

A correct generation should use " instead of '.

If you download the package from NuGet and change the extension to .zip, you can then open the package and see that in the file lib/netstandard2.0/Feliz.xml, the generated XML does indeed use quotes instead of single quotes

image

What is left to know is to find if the generated XMLPath is done by each editor independently in which case the fix need to be applied in each of them or if it is provided by the compiler in which case the fix is to be send to dotnet/fsharp and wait for new release of it.

mrakgr commented 1 year ago

To summarize, it has been resolved in VS 17.5, and will be resolved in VS Code soon once it moves to the latest compiler service. You were right about this being an editor related issue.