Help with package development issue


#1

Anyone care to review this package installation bug?
After install, my commands aren’t really available, unless a first-usage step is performed.

Instead, a command appears, which when clicked, installs the commands.

I must have conflated my naming somewhere…


#2

You need to look at your package activation commands. Only the ones listed there will be visible in the command palette before the package is actually activated. Once you package is activated of course, all the commands it adds in that function will be visible.

Perhaps try doing what I said above, but specifying the second part (so with the :google and :docs)


#3

I kind of assumed, my package is activated when atom starts up (given the user has opted to install it). Indeed what seems to happen is that it only gets activated after being selected by the user one time; only after that do the commands show when searched for.


#4

No, your package is not activated (i.e. the activate function has not been executed). Atom has just looked in your package.json file and seen a list of commands it should offer, and triggering one will then activate your package. This can be seen by adding log statements like console.log("activating...") to the relevant functions. (just remember to remove them before publishing).


#5

Oh, thanks! I removed the activationCommands clause from the package.json, to avoid that. It seems that clause enforces that unnecessary behavior. Now it works as intended :slight_smile:


#6

The clause is actually a good thing to have. It means Atom won’t waste time on startup loading your package, which is especially good if the user never ends up using the package. This is called lazy loading, and will ultimately make Atom feel quicker.