21
21
// USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
package phasereditor .project .core ;
23
23
24
+ import org .eclipse .core .resources .FileInfoMatcherDescription ;
24
25
import org .eclipse .core .resources .ICommand ;
25
26
import org .eclipse .core .resources .IProject ;
26
27
import org .eclipse .core .resources .IProjectDescription ;
27
28
import org .eclipse .core .resources .IProjectNature ;
28
29
import org .eclipse .core .resources .IResource ;
30
+ import org .eclipse .core .resources .IResourceFilterDescription ;
29
31
import org .eclipse .core .runtime .CoreException ;
30
32
import org .eclipse .core .runtime .IProgressMonitor ;
31
33
import org .eclipse .core .runtime .NullProgressMonitor ;
@@ -35,8 +37,7 @@ public class PhaserProjectNature implements IProjectNature {
35
37
36
38
public static final String NATURE_IDS [] = { ProjectCore .PHASER_PROJECT_NATURE };
37
39
38
- public static void addPhaserNature (IProject project , IProgressMonitor monitor )
39
- throws CoreException {
40
+ public static void addPhaserNature (IProject project , IProgressMonitor monitor ) throws CoreException {
40
41
if (monitor != null && monitor .isCanceled ()) {
41
42
throw new OperationCanceledException ();
42
43
}
@@ -109,7 +110,7 @@ public void configure() throws CoreException {
109
110
// add the builder
110
111
IProjectDescription desc = _project .getDescription ();
111
112
ICommand [] commands = desc .getBuildSpec ();
112
-
113
+
113
114
boolean found = false ;
114
115
115
116
String builderId = ProjectCore .PHASER_BUILDER_ID ;
@@ -120,7 +121,7 @@ public void configure() throws CoreException {
120
121
break ;
121
122
}
122
123
}
123
-
124
+
124
125
if (!found ) {
125
126
126
127
// Phaser builder command
@@ -142,6 +143,30 @@ public void configure() throws CoreException {
142
143
// javaProv.configure();
143
144
144
145
_project .refreshLocal (IResource .DEPTH_INFINITE , new NullProgressMonitor ());
146
+
147
+ {
148
+ _project .createFilter (
149
+
150
+ IResourceFilterDescription .EXCLUDE_ALL
151
+
152
+ | IResourceFilterDescription .FOLDERS
153
+
154
+ | IResourceFilterDescription .INHERITABLE
155
+
156
+ , new FileInfoMatcherDescription ("org.eclipse.ui.ide.patternFilterMatcher" , "node_modules" ),
157
+ IResource .BACKGROUND_REFRESH , new NullProgressMonitor ());
158
+
159
+ _project .createFilter (
160
+
161
+ IResourceFilterDescription .EXCLUDE_ALL
162
+
163
+ | IResourceFilterDescription .FOLDERS
164
+
165
+ | IResourceFilterDescription .INHERITABLE
166
+
167
+ , new FileInfoMatcherDescription ("org.eclipse.ui.ide.patternFilterMatcher" , ".git" ),
168
+ IResource .BACKGROUND_REFRESH , new NullProgressMonitor ());
169
+ }
145
170
}
146
171
147
172
@ Override
0 commit comments