26
$\begingroup$

When typing the name of a built-in function like Integrate, the button (ℹ︎) appears next to that name in the autocomplete:

enter image description here

But I don't get that (ℹ︎) button for my package functions, even though I have a help page for it that was made with Wolfram Workbench:

enter image description here

How do I add the info button to the autocompletion menu that links to the relevant documentation page for my package functions?

$\endgroup$
2
  • $\begingroup$ Something of interest (maybe?). JLink stuff has that but some built in packages e.g. GeneralUtilities do not. And it's not just that documented things have it, since I've definitely clicked the button and gotten a blank search page. E.g. ExportPacket has it but pops up nothing. $\endgroup$
    – b3m2a1
    Commented Jul 19, 2017 at 5:15
  • $\begingroup$ Look at FileNameJoin@{$InstallationDirectory, "SystemFiles", "Components", "AutoCompletionData", "Main", "documentedContexts.m"}. I found that via TextSearch for "JLink" in the AutoCompletionData directory. Editing it allowed me to add the i for my own package (only works where there are searchable docs I think) but I couldn't get it to work a la specialArgFunctions.tr -- i.e. editable in my own package, not the file itself. $\endgroup$
    – b3m2a1
    Commented Jul 19, 2017 at 5:46

2 Answers 2

11
+50
$\begingroup$

So I mentioned this in a comment but I'll get it out here for the bounty poster too. Searching for the "JLink`" in the autocomplete directory gave me this:

FileNameJoin@{$InstallationDirectory, "SystemFiles", "Components", "AutoCompletionData", "Main", "documentedContexts.m"}

If we look at what's inside it:

FileNameJoin@{$InstallationDirectory, "SystemFiles", "Components", 
    "AutoCompletionData", "Main", "documentedContexts.m"} // 
  Import // NewlineateInput

{
 "System`",
 "ANOVA`",
 "BlackBodyRadiation`",
 "Compatibility`",
 "ComputerArithmetic`",
 "DatabaseLink`",
 "EquationTrekker`",
 "FiniteFields`",
 "JLink`",
 "NETLink`",
 "CUDALink`",
 "OpenCLLink`",
 "TetGenLink`",
 "RLink`",
 "CCodeGenerator`",
 "SymbolicC`",
 "NonlinearRegression`",
 "PhysicalConstants`",
 "PolyhedronOperations`",
 "Quaternions`",
 "ResonanceAbsorptionLines`",
 "StandardAtmosphere`",
 "VariationalMethods`",
 "LibraryLink`",
 "CCompilerDriver`",
 "Audio`",
 "FunctionApproximations`",
 "GUIKit`",
 "HierarchicalClustering`",
 "HypothesisTesting`",
 "MultivariateStatistics`",
 "Music`",
 "Notation`",
 "NumericalDifferentialEquationAnalysis`",
 "StatisticalPlots`"
 }

I'll add something:

FileNameJoin@{$InstallationDirectory, "SystemFiles", "Components", 
    "AutoCompletionData", "Main", "documentedContexts.m"} // 
  Import // Last

"ChemTools`"

and we can see the i appears on reload:

A wild i appears!

Haven't figured out how to set this at the paclet level though, or even in $UserBaseDirectory.

Note that this is for 11

For 10 it seems the file is

FileNameJoin@{$InstallationDirectory, "SystemFiles", "FrontEnd", 
  "SystemResources", "FunctionalFrequency", "documentedContexts.m"}

Another cool file seems to be obsoleteFunctions.m which turns out to be a list of names to not autocomplete, even though they're in the language. I added Print, restarted, and got this:

no print :o

Note that Print is no longer completed by the FE.

There is also internalFunctions.m which has a similar effect. That contains things like DeclareKnownSymbols, and AutoStyleOptions which don't get autocompleted either, but I suppose are there because they're still used in the language.

Then there are the developerFunctions.m which are clearly contexts that don't get filled out by autocomplete (think NotebookTools`FlattenCellGroups -- NotebookTools` is in there).

$\endgroup$
8
  • $\begingroup$ thanks @b3m2a1, this is fantastic! impressive detective work! I will add two bits for anyone who might come this way in the future: $\endgroup$
    – billc
    Commented Jul 22, 2017 at 15:28
  • $\begingroup$ (1) in my case, I needed to add a two-part path to "documentedContexts.m", as in MyApp`MyPackage` $\endgroup$
    – billc
    Commented Jul 22, 2017 at 15:34
  • $\begingroup$ (2) after I did this and restarted, I had the previously missing info icon, but it took me to a blank result in the documentation center. To get the icon to actually link to my documentation, I had to rerun BuildApplication["MyApp"]. (I'm using jmlopez's ApplicationMaker project. I'm not sure what the equivalent process would be otherwise.) $\endgroup$
    – billc
    Commented Jul 22, 2017 at 15:34
  • 1
    $\begingroup$ @billc don't know what BuildApplication does as I have my own docs system, but I bet your docs weren't properly indexed. I'm gonna bet that i button just uses the same Command-F (on Mac) system which I think works via Documentation`HelpLookup which eventually dead ends on Documentation`ResolveLink. So if Documentation`ResolveLink["MySym"] doesn't work the i button probably won't. $\endgroup$
    – b3m2a1
    Commented Jul 22, 2017 at 16:27
  • 2
    $\begingroup$ It's not currently possible to add to the DocumentedPath variable via paclets, but I have forwarded that suggestion to the relevant developer. It should be relatively straightforward to add. $\endgroup$ Commented Jul 22, 2017 at 19:06
0
$\begingroup$

Very curious if there's been any progress on this. It's now 2021, and I've built my own paclet application with documentation using Workbench 3 (Eclipse add-in 10.1.822) with MM 12.1. Workbench is creating the index file but I get the same behavior as above for my own functions.

enter image description here

In addition, while the hover button double-chevron shows usage correctly, the info button is grayed out and does not link to my symbol documentation like the built-in functions do.

enter image description here

I have notice though, if I go ahead and evaluate this ?function line, it brings up the usage statement. In the top right corner of the usage statement, there is an info button that actually works and actually links to my symbol page!

enter image description here

While this may not be an "answer", per se, it does show that the index is working to some limited degree and provides a work-around to getting to the desired ref/symbol page.

$\endgroup$
1
  • $\begingroup$ Better to post this useful information as a new question referencing the earlier question. $\endgroup$
    – bbgodfrey
    Commented May 21, 2021 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.