try {
GoEnvironment goEnvironment = GoProjectEnvironment.getGoEnvironment(project);
// TODO: we should run this operation outside the UI thread.
IProgressMonitor pm = new TimeoutProgressMonitor(5000, true);
GocodeClient client = new GocodeClient(gocodePath.toOSString(), goEnvironment, pm);
ExternalProcessResult processResult = client.execute(filePath, document.get(), offset);
String stdout = processResult.getStdOutBytes().toString(StringUtil.UTF8);
List<String> completions = new ArrayList2<>(GocodeClient.LINE_SPLITTER.split(stdout));
CodeContext codeContext = codeContexts.get(filePath);
if (codeContext == null) {