[Pydev-code] re: context-sensitive help
Brought to you by:
fabioz
From: Jeff L. <jl...@op...> - 2006-03-29 06:30:05
|
"Hummm... actually, I don't think that they use the javadoc=20 itself... What they probably do is parse the code to gather the=20 comments and use that info to know what to present (so, not much=20 that can be rearranged)." You and I are talking about two related but separate use cases, I=20 think. Yours: user writes code with docustrings in PyDev project;=20 docustrings are parsed when code is 'compiled' and stored in=20 resource somewhere (XML file?) for later lookup. Mine (Java case):=20 user includes rt.jar file, makes association with javadoc directory=20 in project settings (see attached picture). =20=20=20 "So, what I thought was to make the javadoc available in the help...=20 The hovering is probably going to work on the same base that the=20 code-completion works, getting the docs from the code itself..."=20 =20=20=20 For the python case, I guess this would work (but not in the Java=20 case as the jar files don't have comments). I wonder, though, if=20 we can leverage the javadoc file association as in the case above?=20 Not quite the same, is it, since there's nothing to associate the=20 javadoc with? Guess I see the point now. It's possible that even in=20 the case where the rt.jar <-> javadoc association is made, the=20 javadocs are parsed into a lookup structure rather than relying=20 browser HTML navigation. Too much of a newbie to know, myself.=20=20 So there is a tool out there to generate API docs from Python=20 docustrings call Epydoc. Whatever route is taken, I think that is=20 the tool to use. How fast is it? -- that's the question. For project file docustrings it's no doubt fast enough, but for the entire Python=20 library?? I think there are two choices: 1) distributing with a=20 pre-generated api docs; 2) have logic to do a one-time api doc=20 generation. Distributing with pre-generated stuff would work until=20 a new Python version came along; generating once, base on version=20 determined by PYTHONHOME setting would be better, I think, and then=20 reuse the generated documentation until a new one is needed. I=20 think you'll agree that last makes sense. Do we even need the Javadoc at all then? I'm not sure what help=20 you are referring to: F1 help? "There is a faq on how to add a hover to the text:=20 http://wiki.eclipse.org/index.php/FAQ_How_do_I_add_hover_support_to_my_text= _editor%3F"=20 It's a good start. From that I might be able to figure out how the=20 linkage is made between .jar files and their javadocs.=20 "There is already a hover implemented for errors, but it has to be=20 extended for adding the pydocs. The class that does it is:=20 PyTextHover (basically, the getHoverInfo method would have to make=20 something as a code-completion request and with the info returned,=20 present the hover -- in addition to what is already shown). " Yeah, found PyTextHover today. The light is slowly dawning. =20=20=20 "To make the code completion, you'd have to check the=20 PythonCompletionProcessor, that currently makes the code-completion=20 (it might need some customizing for that, but not so much).=20 =20=20=20 "So, if you're up to the task and want more info... Should not be so=20 hard to implement... (I can give you some tips on how to do it)."=20 Got an ant build file or .project/.classpath pair? Can't figure=20 out which modules I need from CVS... looks like some old stuff in=20 there. =20=20=20 "You should register in the pydev-code list... That's the place=20 where this kind of discussion belongs"=20 Okay, the request is in. =20=20 Take care, Jeff --=20 _______________________________________________ Surf the Web in a faster, safer and easier way: Download Opera 8 at http://www.opera.com Powered by Outblaze |