|
From: <caw...@us...> - 2007-01-22 19:13:27
|
Revision: 1841
http://svn.sourceforge.net/rubyeclipse/?rev=1841&view=rev
Author: cawilliams
Date: 2007-01-22 11:13:24 -0800 (Mon, 22 Jan 2007)
Log Message:
-----------
try to eat duplicate syntax exceptions, make sure we pass charset to parser when we can
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RubyParser.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java 2007-01-22 19:09:06 UTC (rev 1840)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java 2007-01-22 19:13:24 UTC (rev 1841)
@@ -55,7 +55,8 @@
RubyLintVisitor visitor = new RubyLintVisitor(contents, problemRequestor);
node.accept(visitor);
} catch (SyntaxException e) {
- problemRequestor.acceptProblem(new Error(e.getPosition(), e.getMessage()));
+ // Eat the exception
+// problemRequestor.acceptProblem(new Error(e.getPosition(), e.getMessage()));
} catch (RubyModelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RubyParser.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RubyParser.java 2007-01-22 19:09:06 UTC (rev 1840)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RubyParser.java 2007-01-22 19:13:24 UTC (rev 1841)
@@ -15,6 +15,7 @@
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
@@ -26,6 +27,7 @@
import org.jruby.parser.RubyParserConfiguration;
import org.jruby.parser.RubyParserPool;
import org.jruby.parser.RubyParserResult;
+import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.internal.core.builder.IoUtils;
/**
@@ -90,8 +92,11 @@
InputStream contents = null;
try {
contents = file.getContents();
- return parse(file, new InputStreamReader(contents));
- } finally {
+ return parse(file, new InputStreamReader(contents, file.getCharset()));
+ } catch (UnsupportedEncodingException e) {
+ RubyCore.log(e);
+ return parse(file, new InputStreamReader(contents));
+ } finally {
IoUtils.closeQuietly(contents);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|