import { ExtensionContext, services, workspace, LanguageClient } from 'coc.nvim' export async function activate(context: ExtensionContext): Promise { const config = workspace.getConfiguration('coc-kotlin'); const isEnable = config.get('enable', true); if (!isEnable) { return; } const serverOptions = { command: `${__dirname}/../kotlin-language-server-master/server/build/install/server/bin/kotlin-language-server`, // run language server }; const clientOptions = { documentSelector: ['kotlin'], // run language server on kotlin files }; const client = new LanguageClient( 'coc-kotlin', // the id 'coc-kotlin', // the name of the language server serverOptions, clientOptions ); context.subscriptions.push(services.registLanguageClient(client)); }