atom / atom-languageclient

Language Server Protocol support for Atom (the basis of Atom-IDE)
https://ide.atom.io/
MIT License
388 stars 78 forks source link

Add getters to Autocomplete suggestions priority #188

Closed martinfojtik closed 6 years ago

martinfojtik commented 6 years ago

This can be useful when you want to change autocomplete suggestions priority inside LSP package.

damieng commented 6 years ago

I think we'd either want them to override provideAutocomplete or wire these up to read config settings automatically as AutoLanguageClient's surface area is already too big. Thoughts?

martinfojtik commented 6 years ago

I think overriding provideAutocomplete is riskier than overriding this new getters. Because if in future we make new changes inside provideAutocomplete, it could introduce breaking change, and we will be forced to propagate that code change into other plugins. @damieng What do you think?

damieng commented 6 years ago

The easiest option I think is to call down to the base provideAutocomplete and then change the properties, e.g.

provideAutocomplete() {
  const provided = super.provideAutocomplete()
  provided.inclusionPriority = ... // get config
  provided.suggestionPriority = ... // get config
  provided.excludeLowerPriority = ... // get config
  return provided
}