Fixed: couldn't launch linked files nor launch files under a linked folder when local...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / builder / IdentifierIndexManager.java
index 499bd82..2d84bec 100644 (file)
@@ -324,7 +324,6 @@ public class IdentifierIndexManager {
                                StringBuffer buf) {
                        char[] ident;
                        String identifier;
-                       int counter = 0;
                        boolean hasModifiers = false;
                        int phpdocOffset = -1;
                        int phpdocLength = -1;
@@ -508,12 +507,11 @@ public class IdentifierIndexManager {
         * 
         */
        public void addFile(IFile fileToParse) {
-               // InputStream iStream;
                LineCreator lineCreator = createLineCreator();
                try {
                        addInputStream(new BufferedInputStream(fileToParse.getContents()),
                                        fileToParse.getProjectRelativePath().toString(),
-                                       lineCreator);
+                                       lineCreator, fileToParse.getCharset());
                } catch (CoreException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
@@ -526,17 +524,13 @@ public class IdentifierIndexManager {
         * @throws CoreException
         */
        public void addInputStream(InputStream stream, String filePath,
-                       LineCreator lineCreator) throws CoreException {
+                       LineCreator lineCreator , String charset) throws CoreException {
                try {
                        StringBuffer lineBuffer = new StringBuffer();
                        lineBuffer.append(filePath);
-                       int lineLength = lineBuffer.length();
                        lineCreator.parseIdentifiers(Util.getInputStreamAsCharArray(stream,
-                                       -1, null), lineBuffer);
-                       // if (lineLength != lineBuffer.length()) {
-                       // always add the file for Open Include Action
+                                       -1, charset),  lineBuffer);
                        addLine(lineBuffer.toString());
-                       // }
                } catch (IOException e) {
                        e.printStackTrace();
                } finally {
@@ -545,6 +539,7 @@ public class IdentifierIndexManager {
                                        stream.close();
                                }
                        } catch (IOException e) {
+                               //do nothing
                        }
                }
        }