} else {
String oldImport = lastImport.getText();
int start = lastImport.getTextOffset();
int end = start + lastImport.getTextLength();
String declarations = String.format("(\n%s\n\"%s\"\n)", oldImport, pathToImport);
document.replaceString(start, end, declarations);
reformatPositions(file, start, start + declarations.length());
}
}
private static void addImportUnderPackage(GoFile file, Document document, String pathToImport) {