-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation command #3
Comments
|
In the online REPL, now |
This is extra cool! |
Frege documentation is also available now in online REPL. Few examples:
We can also import another module and then look up the documentation for the functions in that module.
This should display the documentation for |
Magnificent! It doesn't seem to work for class or type names, though? |
Ah! yes, I will look into it. |
Now types and classes are working in online REPL. There is still one problem: Items with explicit namespaces are not working. My current approach is to create a
Here Items with explicit namespaces do not fall in either of these cases or I think I am not creating This works:
But the following is not working:
Any ideas? |
Some observations:
Same for I recommend not to construct a In order to make this work with name spaces, it is required that you have a Global state that has the name spaces actually imported. You may run the import pass for every import definition (and keep that state) to achieve this. Since obviously the :t command does find the correct things, you must already have something you can reuse. Note however that you would need to do an extra check in case we have just a namespace name. |
Thanks Ingo for the great explanation. I fixed the implementation as per your suggestion and it seems to be working now. Just want to make sure if I am creating SNames correctly, could you please verify the code below? (Complete code for this feature is here)
|
Looks good so far.
|
I thought about the anchors but completely missed I guess this enhancement is now complete for online REPL unless there are some bugs or things that can be improved still. Now I am thinking of implementing this feature for console REPL. Do we need to write a similar function like |
I've thought about that, too. |
It seems Java Swing has some support to render HTML contents but JavaFX WebView looks promising (an example). |
These commands are now supported in console REPL (New version available in releases page here). A Swing window will be launched to display the Java code or to display the Frege documentation. In the Swing window displaying Frege documentation, clicking any links would trigger the user browser to display the link contents. |
The following would be nice to have:
(where name could be a qualified name)
which should print the html-ized doc comment for that item.
Most of the needed functionality should already be there in compiler/DocUtils.fr and compiler/EclipseUtils.fr
The only difficulty should be to keep track of the namespaces in scope according to the imports done by the user. This you need to resolve the name and get the corresponding symbol table entry, which could then be handed down to the documentation functions.
Also nice (but not really important) would be to have a command like
to see the generated java code, maybe in an extra tab or page. I sometimes wanted this for answering "how would I write this Haskell code in Java" type questions on stackoverflow quickly. :)
The text was updated successfully, but these errors were encountered: