Skip to content

Commit

Permalink
Reset TMPDIR properly for gopls
Browse files Browse the repository at this point in the history
Fixes #105
  • Loading branch information
josa42 committed Sep 29, 2020
1 parent 2931916 commit 5b41e9a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ async function registerGopls(context: ExtensionContext): Promise<void> {
// TMPDIR needs to be resetted, because its altered by coc.nvim, which breaks
// the automatic deamon launching of gopls.
// See: https://github.com/neoclide/coc.nvim/commit/bdd9a9e1401fe6fdd57a9bd078e3651ecf1e0202
const tmpdir = await workspace.nvim.eval('$TMPDIR') as string

const server = (): Promise<ChildProcess> => {
return new Promise(resolve => {
resolve(spawn(command, args, {
cwd: workspace.cwd,
env: { ...process.env, TMPDIR: '', ...config.goplsEnv },
env: { ...process.env, TMPDIR: tmpdir, ...config.goplsEnv },
}))
})
}
Expand Down

0 comments on commit 5b41e9a

Please sign in to comment.