File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Plugins/UnrealJS/Source/JavascriptEditor Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 5
5
#include " JavascriptEditorTick.h"
6
6
#include " IV8.h"
7
7
#include " ScopedTransaction.h"
8
+ #if WITH_EDITOR
9
+ #include " Settings/EditorLoadingSavingSettings.h"
10
+ #endif
8
11
9
12
class FJavascriptEditorModule : public IJavascriptEditorModule
10
13
{
@@ -47,9 +50,44 @@ void FJavascriptEditorModule::RemoveExtension(IEditorExtension* Extension)
47
50
#endif
48
51
}
49
52
53
+ #if WITH_EDITOR
54
+ static void PatchReimportRule ()
55
+ {
56
+ FAutoReimportWildcard WildcardToInject;
57
+ WildcardToInject.Wildcard = TEXT (" Scripts/**.json" );
58
+ WildcardToInject.bInclude = false ;
59
+
60
+ auto Default = GetMutableDefault<UEditorLoadingSavingSettings>();
61
+ bool bHasChanged = false ;
62
+ for (auto & Setting : Default->AutoReimportDirectorySettings )
63
+ {
64
+ bool bFound = false ;
65
+ for (const auto & Wildcard : Setting.Wildcards )
66
+ {
67
+ if (Wildcard.Wildcard == WildcardToInject.Wildcard )
68
+ {
69
+ bFound = true ;
70
+ break ;
71
+ }
72
+ }
73
+ if (!bFound)
74
+ {
75
+ Setting.Wildcards .Add (WildcardToInject);
76
+ bHasChanged = true ;
77
+ }
78
+ }
79
+ if (bHasChanged)
80
+ {
81
+ Default->PostEditChange ();
82
+ }
83
+ }
84
+ #endif
85
+
50
86
void FJavascriptEditorModule::StartupModule ()
51
87
{
52
88
#if WITH_EDITOR
89
+ PatchReimportRule ();
90
+
53
91
auto Isolate = NewObject<UJavascriptIsolate>();
54
92
auto Context = Isolate->CreateContext ();
55
93
You can’t perform that action at this time.
0 commit comments