I’m getting close to publishing an extension I’ve been working on for 2 weeks full time, but before I do it would be great to have confirmation about the scoping of identifiers.
Are identifiers scoped to the kind of thing being identified, or do they have to be globally unique across every class of thing that can be identified in an extension?
Also, do identifiers occupy the same store as config?
For example, is it safe to use the identifier myextensionnamespace.foo
for all of these things (and more) at the same time:
- A config.
- When registering a task assistant.
- When constructing a new
LanguageClient
. - When constructing a new
NotificationRequest
. - When registering a command. This is called a “name” instead of an identifier, but it seems to be conceptually similar? When can a user see the “name”? And, does the name have to be namespaced for the extension (e.g.
myextensionnamespace.commandName
), or can you just have the name you want (e.g.commandName
) without potentially colliding with other extension’s command names?
It would be really great if everywhere in the API reference there is a name or identifier, it’s clearly documented how it should be namespaced. Does it need no namespace, your extensions’s namespace, or your extensions namespace + a deeper namespace to group identifiers of that category (e.g. .tasks.
).
I’ve seen some extensions just have super long ultra-namespace identifiers for everything, but it really makes the code messy and can bloat configuration files that users might version control and read. Also, I’ve seen identifiers not really namespaced at all which could lead to collisions between extensions, or even within the same extension? Having clarity sooner rather than later would really help the Nova extension ecosystem grows healthily as some config names and things are a risky mess to try to change in updates, and bad patterns get copied by people learning extension dev by example.