25
$\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$
  • $\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 Jul 19 '17 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 Jul 19 '17 at 5:46
10
+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$
  • $\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 Jul 22 '17 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 Jul 22 '17 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 Jul 22 '17 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 Jul 22 '17 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$ – Itai Seggev Jul 22 '17 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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