20
20
import org .eclipse .core .runtime .IPath ;
21
21
import org .eclipse .core .runtime .Path ;
22
22
import org .eclipse .core .runtime .QualifiedName ;
23
+ import org .eclipse .dltk .compiler .problem .DefaultProblemIdentifier ;
23
24
import org .eclipse .dltk .compiler .problem .IProblem ;
24
25
import org .eclipse .dltk .compiler .problem .ProblemSeverities ;
26
+ import org .eclipse .dltk .compiler .problem .ProblemSeverity ;
25
27
import org .phpsrc .eclipse .pti .core .launching .OperatingSystem ;
26
28
import org .phpsrc .eclipse .pti .core .launching .PHPToolLauncher ;
27
29
import org .phpsrc .eclipse .pti .core .php .inifile .INIFileEntry ;
@@ -146,9 +148,9 @@ protected IProblem[] parseOutput(ISourceFile file, String output, PHPCodeSniffer
146
148
147
149
Document doc = parser .getDocument ();
148
150
problems .addAll (createProblemMarker (file , doc .getElementsByTagName ("error" ),
149
- ProblemSeverities . Error , tabWidth , prefs .getIgnoreSniffs ()));
151
+ ProblemSeverity . ERROR , tabWidth , prefs .getIgnoreSniffs ()));
150
152
problems .addAll (createProblemMarker (file , doc .getElementsByTagName ("warning" ),
151
- ProblemSeverities . Warning , tabWidth , prefs .getIgnoreSniffs ()));
153
+ ProblemSeverity . WARNING , tabWidth , prefs .getIgnoreSniffs ()));
152
154
}
153
155
}
154
156
} catch (Exception e ) {
@@ -158,7 +160,7 @@ protected IProblem[] parseOutput(ISourceFile file, String output, PHPCodeSniffer
158
160
return problems .toArray (new IProblem [0 ]);
159
161
}
160
162
161
- protected ArrayList <IProblem > createProblemMarker (ISourceFile file , NodeList list , int type , int tabWidth ,
163
+ protected ArrayList <IProblem > createProblemMarker (ISourceFile file , NodeList list , ProblemSeverity type , int tabWidth ,
162
164
String [] ignoreSniffs ) {
163
165
if (tabWidth <= 0 )
164
166
tabWidth = 2 ;
@@ -192,8 +194,10 @@ protected ArrayList<IProblem> createProblemMarker(ISourceFile file, NodeList lis
192
194
if (column > 1 )
193
195
lineStart += (column - 1 - (file .lineStartTabCount (lineNr ) * (tabWidth - 1 )));
194
196
197
+ System .out .println (IProblem .Syntax );
198
+ System .out .println (DefaultProblemIdentifier .decode (IProblem .Syntax ));
195
199
problems .add (new CodeSnifferProblem (file .getFile ().getFullPath ().toOSString (), item .getTextContent (),
196
- IProblem .Syntax , new String [0 ], type , lineStart , file .lineEnd (lineNr ), lineNr , column , source ));
200
+ DefaultProblemIdentifier . decode ( IProblem .Syntax ) , new String [0 ], type , lineStart , file .lineEnd (lineNr ), lineNr , column , source ));
197
201
}
198
202
199
203
return problems ;
0 commit comments