Coc-jedi
lastmod 2024-04-10created 2024-04-093 edits
coc.nvim wrapper for jedi-language-server
Custom executable command
It is also covered in the documentation, but you can refer to the following code:
/*
* Get the jedi-language-server executable, along with its arguments.
* This function considers
* 1. user configuration (a command configured by user trumps everything)
* 2. binaries currently in the path
* 3. defaults provided in ./constants.ts
*/
export default function getJlsExecutable(
config: WorkspaceConfiguration
): JlsExecutable {
const command = config.get<string>('executable.command')
if (!command) {
return getJlsExecutableDefault()
}
const args = config.get<string[]>('executable.args', [])
return { command, args }
}
The call site is as follows:
export async function activate(context: ExtensionContext): Promise<void> {
const config = workspace.getConfiguration('jedi')
const isEnable = config.get<boolean>('enable', true)
if (!isEnable) {
return
}
const serverOptions = getJlsExecutable(config)
//...
}