Closed THE-FYP closed 7 years ago
The .luacompleterc
file is loaded relative to the file being edited. If you're developing a package providing autocomplete, you shouldn't use a .luacompleterc
file directly. That is intended for the end user to customize his setup. Instead, you should use the option provider mechanism to load your custom options. Something like this:
getLoadedOptions = async (utils) => {
if (this.loadedOptions) { return this.loadedOptions }
let options = await loadMyOptionsFromAFileSomewhereOrJustRequireThemAsJSON()
options = utils.reviveOptions(options)
this.loadedOptions = options
return options
}
getOptions = async (request, getPreviousOptions, utils, cache) => {
if (providerIsNotApplicableToTheCurrentFile) {
return { options: await getPreviousOptions() }
}
const newOptions = this.getLoadedOptions(utils)
const previousOptions = await getPreviousOptions()
return utils.mergeOptionsCached(previousOptions, newOptions, cache)
}
Read more about option providers here: https://github.com/dapetcu21/atom-autocomplete-lua#option-providers
oh, okay. thank you.
trying to implement
.luacompleterc
in my package i ran into a problem with loading the file. after some research i found out that autocomplete-lua tries to load file from the wrong directoryC:\Users\root\.luacompleterc
instead ofC:\Users\root\.atom\dev\packages\mypackage\.luacompleterc
, i guess it is likely a bug.Windows 10 Atom v1.14.2