diff --git a/src/main/java/com/sjhy/plugin/service/TableInfoSettingsService.java b/src/main/java/com/sjhy/plugin/service/TableInfoSettingsService.java index b5f1205..de0c0bf 100644 --- a/src/main/java/com/sjhy/plugin/service/TableInfoSettingsService.java +++ b/src/main/java/com/sjhy/plugin/service/TableInfoSettingsService.java @@ -1,14 +1,17 @@ package com.sjhy.plugin.service; import com.intellij.database.psi.DbTable; +import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.components.PersistentStateComponent; -import com.intellij.openapi.components.ServiceManager; +import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiClass; import com.sjhy.plugin.dto.TableInfoSettingsDTO; import com.sjhy.plugin.entity.TableInfo; import com.sjhy.plugin.service.impl.TableInfoSettingsServiceImpl; import com.sjhy.plugin.tool.ProjectUtils; +import java.io.IOException; + /** * @author makejava * @version 1.0.0 @@ -21,7 +24,26 @@ public interface TableInfoSettingsService extends PersistentStateComponent { + try { + configFile.delete(null); + } catch (IOException ex) { + ex.printStackTrace(); + } + }); + } + } + // 重新获取配置 + return ProjectUtils.getCurrProject().getService(TableInfoSettingsServiceImpl.class); + } } /**