10

The format described here and here seems to be a big step forward from BeginPackage/EndPackage structure and is apparently widely used in Mathematica itself.

From my experience Workbench does not currently support it (symbol navigation does not work as well as debugging etc).

If the answer is "no" — does anyone has the experience with some IDE and "new package format"?

I've checked Idea plugin (which I actually have paid version), but it seem to have the same problem: symbol navigation does not work across files.

VSCode has very limited support for Wolfram Language (and getting language server to run stably seems next to impossible).

Thanks in advance.

Pavel Perikov
  • 1,345
  • 6
  • 14
  • 2
    With IntelliJ, you can get symbol navigation working across files with the new package format. I use it regularly. Make sure all symbols you want to include have a usage message, then it will work. – Szabolcs Oct 06 '21 at 12:12
  • 1
    To be clear, what is needed is for symbols to have a usage message and not for them to be public. In other words, you might want to add a usage message to all PackageScope symbols, not just PackageExport ones. While at first this may feel like a chore, it is quite useful to do it because you can also get a small documentation popup in case you forgot what the function does ... – Szabolcs Oct 06 '21 at 14:55
  • @Szabolcs hahaha !!!! Thanks for the advice!

    But this behaviour seems a bit strange for me. Especially because almost all my usage messages are set via GeneralUtilities`SetUsage.

    I wonder if this by design of the plugin.

    – Pavel Perikov Oct 06 '21 at 15:12
  • @Szabolcs BTW it seems anything will do, not just usage:
    tst::anything="asda
    
    – Pavel Perikov Oct 06 '21 at 15:20
  • You can bring up that point to @halirutan. As far as I can tell, with new-style packages it is easy to determine what symbols should be considered even without a usage message, so maybe this can be improved. The usage message thing was used mainly because with traditional packages there's no good way to identify what is or isn't public. – Szabolcs Oct 06 '21 at 15:40
  • Also, if you want to make use of new-style package, be aware of this warning: https://mathematica.stackexchange.com/a/238475/12 As for myself, I am too deeply invested in the new format to abandon it now, but after seeing this comment, I'd be wary ... – Szabolcs Oct 06 '21 at 15:41
  • I'v very well aware about the warning but new-style packages are much more suitable for multi-file packages, especially for rapid development.

    Considering usage messages I thought it is a relic of traditional package format.

    Does @halirutan read this site?

    Thank you again.

    – Pavel Perikov Oct 06 '21 at 15:48
  • 1
    I'd suggest opening an issue on GitHub and explaining your use case. It is not possible to notify people who are not involved in this thread. – Szabolcs Oct 06 '21 at 15:52
  • @Szabolcs Why don't you convert your comments into an answer? – Leonid Shifrin Oct 06 '21 at 22:04
  • Workbench also doens't support "autoloading" all files in the FrontEnd, like it does this for standard package definitions (i.e. I need to evaluate "Get" each time I save some changes in workbench files for multifile package) - but at the same time code in the main file "MyPackage\MyPackage.m" is loaded automatically after saving it in Workbench – Igor Feb 12 '22 at 06:40

0 Answers0