mirror of https://gitee.com/makejava/EasyCode.git
兼容低版本IDEA
This commit is contained in:
parent
af853461d8
commit
7328e16d6d
|
@ -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.sjhy.plugin.dto.TableInfoSettingsDTO;
|
||||
import com.sjhy.plugin.entity.TableInfo;
|
||||
|
@ -24,7 +25,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();
|
||||
|
@ -41,7 +42,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