public static CommonCodeStyleSettings getCodeStyleSettings(InsertionContext context) {
    Language lang = PsiUtilCore.getLanguageAtOffset(context.getFile(), context.getTailOffset());
    return CodeStyle.getLanguageSettings(context.getFile(), lang);
  }
public static CommonCodeStyleSettings getCodeStyleSettings(InsertionContext context)