Closed koleesch closed 9 years ago
I got the message in atom after installing the packages racer and autocomplete-plus
my atom version is 0.177.0
Oh, right, the new Atom version does use a new descriptive way to declare services. As warned in:
I'll correct this as soon as I understand what needs to be done (which, with the rapid change of atom's API, might take some time...) :)
Anyway, it's "just" a deprecation warning, it shouldn't break for now.
@alkama My understanding is we have a very short window to make this change prior to atom.services
being removed entirely. Think 1 or 2 atom versions.
The fix is quite simple, and I will update the docs shortly (once I have a proven working example of a provider using this technique). In essence: you include some config in package.json, and add a function that is called in your mainModule.
@joefitzgerald yes, that's what I understood too. They sure seem to be in a hurry :) It ain't that dramatic thought.
I understood too that what we need is to add some:
{
"providedServices": {
"[NAME]": {
"description": "lorem ipsum",
"versions": {
"[NUMBER]": "[METHOD]"
}
}
}
}
What I still dont get is:
[NAME]
should be, if it's the id of our provider, or if it's the string "autocomplete.provider" that we used to use to register via atom.services.provide()
.[NUMBER]
should be, if it's the version of our provider, or if it's the version of the autocomplete-plus API that we provide.[METHOD]
is a method we have to create and that becomes the new entrypoint of the provider, but I dont know what it's meant return? should it return the provider object that we used to register with atom.services.provide()
or some different construct?My best guess is I would do something like:
{
"providedServices": {
"autocomplete.provider": {
"description": "Intelligent Rust code completion",
"versions": {
"1.0.0": "provideAutocompletion"
}
}
}
}
and
module.exports =
provider: null
activate: ->
@provider = new MyProvider()
return
provideAutocompletion: ->
return @provider # or return {provider: @provider}, who knows :)
deactivate: ->
@provider?.dispose()
@provider = null
return
But I'm probably wrong :) Anyway, thank for your nice work on autocomplete-plus !
{
"providedServices": {
"autocomplete.provider": {
"description": "Intelligent Rust code completion",
"versions": {
"1.0.0": "provideAutocompletion"
}
}
}
}
is correct.
return {provider: @provider}
is correct.
@joefitzgerald thanks, it indeed seems to work.
fixed in v0.9.1
atom.services is no longer available. To register service providers and consumers, use the
providedServices
andconsumedServices
fields in your package's package.json.