mirror of https://gitee.com/makejava/EasyCode.git
兼容低版本IDEA
This commit is contained in:
parent
fc843d0ee6
commit
b01738c9c8
|
@ -3,6 +3,7 @@ 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;
|
||||
|
@ -25,7 +26,7 @@ public interface TableInfoSettingsService extends PersistentStateComponent<Table
|
|||
*/
|
||||
static TableInfoSettingsService getInstance() {
|
||||
try {
|
||||
return ProjectUtils.getCurrProject().getService(TableInfoSettingsServiceImpl.class);
|
||||
return ServiceManager.getService(ProjectUtils.getCurrProject(), TableInfoSettingsServiceImpl.class);
|
||||
} catch (AssertionError e) {
|
||||
// 出现配置文件被错误修改,或不兼容时直接删除配置文件。
|
||||
VirtualFile workspaceFile = ProjectUtils.getCurrProject().getWorkspaceFile();
|
||||
|
@ -42,7 +43,7 @@ public interface TableInfoSettingsService extends PersistentStateComponent<Table
|
|||
}
|
||||
}
|
||||
// 重新获取配置
|
||||
return ProjectUtils.getCurrProject().getService(TableInfoSettingsServiceImpl.class);
|
||||
return ServiceManager.getService(ProjectUtils.getCurrProject(), TableInfoSettingsServiceImpl.class);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue