mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
refresh html5 schema
#IDEA-122531 fixed
This commit is contained in:
@@ -2,12 +2,16 @@ package com.intellij.javaee;
|
||||
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.xml.Html5SchemaProvider;
|
||||
|
||||
/**
|
||||
* @author Eugene.Kudelevsky
|
||||
*/
|
||||
public class DefaultHtmlDoctypeInitialConfigurator {
|
||||
public static final int VERSION = 1;
|
||||
|
||||
public DefaultHtmlDoctypeInitialConfigurator(ProjectManager projectManager,
|
||||
PropertiesComponent propertiesComponent) {
|
||||
@@ -16,5 +20,13 @@ public class DefaultHtmlDoctypeInitialConfigurator {
|
||||
ExternalResourceManagerEx.getInstanceEx()
|
||||
.setDefaultHtmlDoctype(Html5SchemaProvider.getHtml5SchemaLocation(), projectManager.getDefaultProject());
|
||||
}
|
||||
if (propertiesComponent.getOrInitInt("DefaultHtmlDoctype.Refreshed", 0) < VERSION) {
|
||||
propertiesComponent.setValue("DefaultHtmlDoctype.Refreshed", Integer.toString(VERSION));
|
||||
final String schemaUrl = VfsUtilCore.pathToUrl(Html5SchemaProvider.getHtml5SchemaLocation());
|
||||
final VirtualFile schemaFile = VirtualFileManager.getInstance().findFileByUrl(schemaUrl);
|
||||
if (schemaFile != null) {
|
||||
schemaFile.getParent().refresh(false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user