本文整理汇总了TypeScript中promised-neovim-client.attach函数的典型用法代码示例。如果您正苦于以下问题:TypeScript attach函数的具体用法?TypeScript attach怎么用?TypeScript attach使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了attach函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: initNvim
static async initNvim(vimState: VimState) {
const proc = spawn(Configuration.neovimPath, ['-u', 'NONE', '-N', '--embed'], {
cwd: __dirname,
});
proc.on('error', function(err) {
console.log(err);
vscode.window.showErrorMessage('Unable to setup neovim instance! Check your path.');
Configuration.enableNeovim = false;
});
vimState.nvim = await attach(proc.stdin, proc.stdout);
}
示例2: initialize
async initialize() {
let dir = dirname(vscode.window.activeTextEditor!.document.uri.fsPath);
if (!existsSync(dir)) {
dir = __dirname;
}
this.process = spawn(configuration.neovimPath, ['-u', 'NONE', '-N', '--embed'], {
cwd: dir,
});
this.process.on('error', err => {
Logger.error(err.message, `Neovim: Error spawning neovim. Error=${err.message}.`);
configuration.enableNeovim = false;
});
this.nvim = await attach(this.process.stdin, this.process.stdout);
}
示例3: startNeovim
private async startNeovim() {
let dir = dirname(vscode.window.activeTextEditor!.document.uri.fsPath);
if (!(await util.promisify(exists)(dir))) {
dir = __dirname;
}
this.process = spawn(configuration.neovimPath, ['-u', 'NONE', '-N', '--embed'], {
cwd: dir,
});
this.process.on('error', err => {
logger.error(`Neovim: Error spawning neovim. Error=${err.message}.`);
configuration.enableNeovim = false;
});
return attach(this.process.stdin, this.process.stdout);
}