|
From: <caw...@us...> - 2007-04-12 22:31:17
|
Revision: 2301
http://svn.sourceforge.net/rubyeclipse/?rev=2301&view=rev
Author: cawilliams
Date: 2007-04-12 15:31:15 -0700 (Thu, 12 Apr 2007)
Log Message:
-----------
Merged changes from trunk r2143:2300 into the search engine feature branch
Modified Paths:
--------------
branches/search_engine/org.rubypeople.rdt.core/META-INF/MANIFEST.MF
branches/search_engine/org.rubypeople.rdt.core/plugin.xml
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/CompletionRequestor.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IOpenable.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IProblemRequestor.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyModelStatusConstants.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/formatter/Indents.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionProposalComparator.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/CompilerOptions.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/util/Util.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/CreateMethodOperation.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalRubyScript.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/Openable.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ReconcileWorkingCopyOperation.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyElementDeltaBuilder.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelCache.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelStatus.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScript.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/buffer/LRUCache.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/CodeDuplicationDetector.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/IMarkerManager.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/MarkerManager.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/ProblemRequestorMarkerManager.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/TaskCompiler.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/DefaultProblem.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/Error.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/ImmediateWarnings.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/InOrderVisitor.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/MarkerUtility.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RdtWarnings.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/TaskParser.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/TaskTag.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/Warning.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/ConstantReassignmentVisitor.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/DelegatingVisitor.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/EmptyStatementVisitor.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/RubyLintVisitor.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/CharOperation.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/DOMFinder.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Messages.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Util.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/messages.properties
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultOccurrencesFinder.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultReferenceFinder.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultTypeInferrer.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/TypeInferenceHelper.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/TypeInferenceVisitor.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/AttributeLocator.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/FirstPrecursorNodeLocator.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/OffsetNodeLocator.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/ScopedNodeLocator.java
Added Paths:
-----------
branches/search_engine/org.rubypeople.rdt.core/schema/compilationParticipant.exsd
branches/search_engine/org.rubypeople.rdt.core/schema/errorProvider.exsd
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/BuildContext.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CategorizedProblem.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipant.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipantResult.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/IProblem.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/ReconcileContext.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/search/
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/search/SearchDocument.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/search/SearchPattern.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/ISourceElementRequestor.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/parser/
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/parser/ScannerHelper.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/util/HashtableOfIntValues.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/util/HashtableOfObject.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/util/SimpleLookupTable.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/util/SimpleSet.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ASTHolderCUInfo.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceParser.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/index/
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/index/DiskIndex.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/index/EntryResult.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/index/Index.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/index/MemoryIndex.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/BasicSearchEngine.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/HandleFactory.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/IIndexConstants.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/IndexAllJob.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/IndexManager.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/InternalSearchDocument.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/ReadWriteMonitor.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/processing/
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/processing/IJob.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/processing/JobManager.java
Removed Paths:
-------------
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/BuildContext.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CategorizedProblem.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipant.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipantResult.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/IProblem.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/ReconcileContext.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/parser/
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/search/SearchDocument.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/search/SearchPattern.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/CategorizedProblem.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/parser/ScannerHelper.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/index/DiskIndex.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/index/EntryResult.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/index/Index.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/index/MemoryIndex.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/NodeUtil.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/StaticConditionalVisitor.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/IIndexConstants.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/IndexAllJob.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/IndexManager.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/InternalSearchDocument.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/ReadWriteMonitor.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/processing/IJob.java
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/processing/JobManager.java
Modified: branches/search_engine/org.rubypeople.rdt.core/META-INF/MANIFEST.MF
===================================================================
--- branches/search_engine/org.rubypeople.rdt.core/META-INF/MANIFEST.MF 2007-04-12 19:40:45 UTC (rev 2300)
+++ branches/search_engine/org.rubypeople.rdt.core/META-INF/MANIFEST.MF 2007-04-12 22:31:15 UTC (rev 2301)
@@ -9,8 +9,9 @@
Bundle-Localization: plugin
Export-Package: .,
org.rubypeople.rdt.core,
+ org.rubypeople.rdt.core.compiler,
org.rubypeople.rdt.core.formatter,
- org.rubypeople.rdt.core.parser,
+ org.rubypeople.rdt.internal.compiler,
org.rubypeople.rdt.internal.core,
org.rubypeople.rdt.internal.core.buffer,
org.rubypeople.rdt.internal.core.builder,
Modified: branches/search_engine/org.rubypeople.rdt.core/plugin.xml
===================================================================
--- branches/search_engine/org.rubypeople.rdt.core/plugin.xml 2007-04-12 19:40:45 UTC (rev 2300)
+++ branches/search_engine/org.rubypeople.rdt.core/plugin.xml 2007-04-12 22:31:15 UTC (rev 2301)
@@ -3,6 +3,8 @@
<plugin>
<extension-point id="loadpathVariableInitializer" name="%loadpathVariableInitializersName" schema="schema/loadpathVariableInitializer.exsd"/>
<extension-point id="loadpathContainerInitializer" name="%loadpathContainerInitializersName" schema="schema/loadpathContainerInitializer.exsd"/>
+ <extension-point id="compilationParticipant" name="%compilationParticipantsName" schema="schema/compilationParticipant.exsd"/>
+ <extension-point id="errorProvider" name="%errorProvidersName" schema="schema/errorProvider.exsd"/>
<extension
id="rubynature"
@@ -110,4 +112,18 @@
<initializer class="org.rubypeople.rdt.internal.core.RubyCorePreferenceInitializer"/>
</extension>
+
+ <extension
+ point="org.rubypeople.rdt.core.errorProvider">
+ <category id="org.rubypeople.rdt.errors.codeComplexity" name="Code Complexity" />
+
+ <category id="org.rubypeople.rdt.errors.potentialProblems" name="Potential programming problems" />
+ <error prefKey="org.rubypeople.rdt.core.compiler.problem.constantReassignment"
+ label="Re-Assignment to a constant"
+ categoryId="org.rubypeople.rdt.errors.potentialProblems"/>
+
+ <category id="org.rubypeople.rdt.errors.unneccesaryCode" name="Unnecessary code" />
+ <error prefKey="org.rubypeople.rdt.core.compiler.problem.emptyStatement" label="Empty Statements"
+ categoryId="org.rubypeople.rdt.errors.unneccesaryCode"/>
+ </extension>
</plugin>
Copied: branches/search_engine/org.rubypeople.rdt.core/schema/compilationParticipant.exsd (from rev 2300, trunk/org.rubypeople.rdt.core/schema/compilationParticipant.exsd)
===================================================================
--- branches/search_engine/org.rubypeople.rdt.core/schema/compilationParticipant.exsd (rev 0)
+++ branches/search_engine/org.rubypeople.rdt.core/schema/compilationParticipant.exsd 2007-04-12 22:31:15 UTC (rev 2301)
@@ -0,0 +1,191 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.rubypeople.rdt.core">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.rubypeople.rdt.core" id="compilationParticipant" name="Compilation Participants"/>
+ </appInfo>
+ <documentation>
+ This extension point allows clients to participate in the compilation process by receiving notifications at various stages of build and reconcile, via a org.rubypeople.rdt.core.compiler.CompilationParticipant.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="compilationParticipant" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="compilationParticipant">
+ <annotation>
+ <documentation>
+ definition of a compilation participant. This definition allows to order participants. Participants are run by group. The group of participants that modify the environment is run first, then the group of participants that create problems is run, finally the group of other participants is run. Inside each group, participants are ordered using their 'requires' attributes. If a 'requires' attribute point to a participant that doesn't belong to the group, it is ignored.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="requires" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="managedMarker" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ the class that implements this compilation participant. This class must implement a public subclass of <code>org.eclipse.jdt.core.compiler.CompilationParticipant</code> with a public 0-argument constructor.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.jdt.core.compiler.CompilationParticipant"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ a unique identifier for this participant
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="modifiesEnvironment" type="boolean">
+ <annotation>
+ <documentation>
+ optionally specify whether this compilation participant modifies the environment, thus affecting binding resolution. If not specified, false is assumed.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="createsProblems" type="boolean">
+ <annotation>
+ <documentation>
+ optionally specifies whether this compilation participant creates problems. If not specified, false is assumed.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="requiredSourceLevel" type="string">
+ <annotation>
+ <documentation>
+ the required source level this participant needs (one of the JavaCore.VERSION* constants). If a project's source level is below this required source level, the participant will not be invoked. If this attribute is not specified, the participant will be invoked for any source level.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="requires">
+ <annotation>
+ <documentation>
+ a participant that is required to run this compilation participant
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ the unique identifier of the participant that is required
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="managedMarker">
+ <annotation>
+ <documentation>
+ a managed marker is created from the recorded problems (see BuildContext#recordNewProblems(CategorizedProblem[])) and is removed when the corresponding source file is re-built or when the project is cleaned
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="markerType" type="string" use="required">
+ <annotation>
+ <documentation>
+ the type of the managed marker
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 0.9.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ Example of a declaration of a <code>compilationParticipant</code>: <pre>
+<extension
+ id="apt"
+ name="%annotationProcessingName"
+ point="org.rubypeoplee.rdt.core.compilationParticipant">
+ <compilationParticipant
+ class="org.eclipse.jdt.apt.core.internal.AptCompilationParticipant"
+ id="APT">
+ <managedMarker markerType="org.rubypeople.rdt.apt.core.compile.problem"/>
+ </compilationParticipant>
+</extension>
+</pre>
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2006 BEA Systems, Inc and others.<br>
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+ </documentation>
+ </annotation>
+
+</schema>
Copied: branches/search_engine/org.rubypeople.rdt.core/schema/errorProvider.exsd (from rev 2300, trunk/org.rubypeople.rdt.core/schema/errorProvider.exsd)
===================================================================
--- branches/search_engine/org.rubypeople.rdt.core/schema/errorProvider.exsd (rev 0)
+++ branches/search_engine/org.rubypeople.rdt.core/schema/errorProvider.exsd 2007-04-12 22:31:15 UTC (rev 2301)
@@ -0,0 +1,183 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.rubypeople.rdt.core">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.rubypeople.rdt.core" id="errorProvider" name="%errorProviderName"/>
+ </appInfo>
+ <documentation>
+ This extension point allows plugins to participate in surfacing their error/warning markers through the preference page. Use this point to add new categories (or groups) of errors/warnings, and to add hooks to set teh severity and argumnets for your new/custom error/warning markers. This point is likely to be used in conjucntion with the compilationParticipants (which would do the actual parsing/AST analysis).
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <choice>
+ <element ref="category"/>
+ <element ref="error"/>
+ </choice>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="category">
+ <annotation>
+ <documentation>
+ Categories group togetehr a set of Errors/Warnings in the preference page.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ A unique identifier for this category. Errors references this with their categoryId to be placed within this category.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ The text used in the preference page to group the errors.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="error">
+ <annotation>
+ <documentation>
+ An error is a type of Error/Warning that can be configured by the user.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="1">
+ <element ref="argument"/>
+ </sequence>
+ <attribute name="prefKey" type="string" use="required">
+ <annotation>
+ <documentation>
+ the preference key used to store the severity of the error/warning (which will be RubyCore.IGNORE, RubyCore.WARNING, or RubyCore.ERROR).
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string" use="required">
+ <annotation>
+ <documentation>
+ The text used on the preference page to describe the error/warning.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="categoryId" type="string" use="required">
+ <annotation>
+ <documentation>
+ the id of the category under which this error/warning resides.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="argument">
+ <annotation>
+ <documentation>
+ If this preference has a particular value or argument associated with it, this element is used.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="prefKey" type="string" use="required">
+ <annotation>
+ <documentation>
+ The preference key to store the value.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="type" use="default" value="int">
+ <annotation>
+ <documentation>
+ The type of value. Defaults to int.
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="int">
+ </enumeration>
+ <enumeration value="string">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 0.9.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ (C) 2007 Big Day Coming
+ </documentation>
+ </annotation>
+
+</schema>
Modified: branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/CompletionRequestor.java
===================================================================
--- branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/CompletionRequestor.java 2007-04-12 19:40:45 UTC (rev 2300)
+++ branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/CompletionRequestor.java 2007-04-12 22:31:15 UTC (rev 2301)
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.rubypeople.rdt.core;
-import org.rubypeople.rdt.core.parser.IProblem;
+import org.rubypeople.rdt.core.compiler.IProblem;
/**
* Abstract base class for a completion requestor which is passed completion
Modified: branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IOpenable.java
===================================================================
--- branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IOpenable.java 2007-04-12 19:40:45 UTC (rev 2300)
+++ branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IOpenable.java 2007-04-12 22:31:15 UTC (rev 2301)
@@ -170,4 +170,18 @@
* </ul>
*/
public void save(IProgressMonitor progress, boolean force) throws RubyModelException;
+
+ /**
+ * Finds and returns the recommended line separator for this element.
+ * The element's buffer is first searched and the first line separator in this buffer is returned if any.
+ * Otherwise the preference {@link org.eclipse.core.runtime.Platform#PREF_LINE_SEPARATOR}
+ * on this element's project or workspace is returned.
+ * Finally if no such preference is set, the system line separator is returned.
+ *
+ * @return the recommended line separator for this element
+ * @exception RubyModelException if this element does not exist or if an
+ * exception occurs while accessing its corresponding resource.
+ * @since 0.9.0
+ */
+ public String findRecommendedLineSeparator() throws RubyModelException;
}
Modified: branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IProblemRequestor.java
===================================================================
--- branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IProblemRequestor.java 2007-04-12 19:40:45 UTC (rev 2300)
+++ branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IProblemRequestor.java 2007-04-12 22:31:15 UTC (rev 2301)
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.rubypeople.rdt.core;
-import org.rubypeople.rdt.core.parser.IProblem;
+import org.rubypeople.rdt.core.compiler.IProblem;
/**
* A callback interface for receiving ruby problem as they are discovered
Modified: branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyModelStatusConstants.java
===================================================================
--- branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyModelStatusConstants.java 2007-04-12 19:40:45 UTC (rev 2300)
+++ branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyModelStatusConstants.java 2007-04-12 22:31:15 UTC (rev 2301)
@@ -307,4 +307,5 @@
* @since 3.1
*/
// public static final int INVALID_COMPILER_OPTION = 1007;
+ public static final int PROJECT_HAS_NO_RUBY_NATURE = 1007;
}
Modified: branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java
===================================================================
--- branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java 2007-04-12 19:40:45 UTC (rev 2300)
+++ branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java 2007-04-12 22:31:15 UTC (rev 2301)
@@ -56,7 +56,7 @@
import org.rubypeople.rdt.internal.core.builder.MassIndexUpdaterJob;
import org.rubypeople.rdt.internal.core.builder.RubyBuilder;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
-import org.rubypeople.rdt.internal.core.search.ExperimentalIndex;
+import org.rubypeople.rdt.internal.core.search.indexing.IndexManager;
import org.rubypeople.rdt.internal.core.symbols.ISymbolFinder;
import org.rubypeople.rdt.internal.core.symbols.SymbolIndex;
import org.rubypeople.rdt.internal.core.util.MementoTokenizer;
@@ -231,52 +231,14 @@
* @see #getDefaultOptions()
* @since 0.9.0
*/
- public static final String COMPILER_PB_ENSURE_BLOCK_NOT_COMPLETING = PLUGIN_ID + ".compiler.problem.ensureBlockNotCompletingNormally"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- * @since 0.9.0
- */
public static final String COMPILER_PB_EMPTY_STATEMENT = PLUGIN_ID + ".compiler.problem.emptyStatement"; //$NON-NLS-1$
+
/**
* Possible configurable option ID.
* @see #getDefaultOptions()
- */
- public static final String COMPILER_PB_HIDDEN_RESCUE_BLOCK = PLUGIN_ID + ".compiler.problem.hiddenRescueBlock"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
* @since 0.9.0
*/
- public static final String COMPILER_PB_FALLTHROUGH_CASE = PLUGIN_ID + ".compiler.problem.fallthroughCase"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- * @since 0.9.0
- */
- public static final String COMPILER_PB_NULL_REFERENCE = PLUGIN_ID + ".compiler.problem.nullReference"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- */
- public static final String COMPILER_PB_UNUSED_LOCAL = PLUGIN_ID + ".compiler.problem.unusedLocal"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- */
- public static final String COMPILER_PB_UNUSED_PARAMETER = PLUGIN_ID + ".compiler.problem.unusedParameter"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- * @since 0.9.0
- */
- public static final String COMPILER_PB_UNUSED_PRIVATE_MEMBER = PLUGIN_ID + ".compiler.problem.unusedPrivateMember"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- * @since 0.9.0
- */
- public static final String COMPILER_PB_UNNECESSARY_ELSE = PLUGIN_ID + ".compiler.problem.unnecessaryElse"; //$NON-NLS-1$
+ public static final String COMPILER_PB_CONSTANT_REASSIGNMENT = PLUGIN_ID + ".compiler.problem.constantReassignment"; //$NON-NLS-1$
/**
* Possible configurable option ID.
@@ -359,8 +321,8 @@
List rubyProjects = Arrays.asList(getRubyProjects());
MassIndexUpdaterJob massUpdater = new MassIndexUpdaterJob(indexUpdater, rubyProjects);
massUpdater.schedule();
- addElementChangedListener(ExperimentalIndex.instance());
- ExperimentalIndex.start();
+ addElementChangedListener(IndexManager.instance());
+ IndexManager.start();
}
/*
@@ -372,7 +334,7 @@
public void stop(BundleContext context) throws Exception {
try {
RubyModelManager.getRubyModelManager().shutdown();
- removeElementChangedListener(ExperimentalIndex.instance());
+ removeElementChangedListener(IndexManager.instance());
} finally {
// ensure we call super.stop as the last thing
super.stop(context);
Copied: branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler (from rev 2300, trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler)
Deleted: branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/BuildContext.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/BuildContext.java 2007-04-12 19:40:45 UTC (rev 2300)
+++ branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/BuildContext.java 2007-04-12 22:31:15 UTC (rev 2301)
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.rubypeople.rdt.core.compiler;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.rubypeople.rdt.internal.core.util.Util;
-
-/**
- * The context of a build event that is notified to interested compilation
- * participants when {@link CompilationParticipant#buildStarting(BuildContext[], boolean) a build is starting},
- * or to annotations processors when {@link CompilationParticipant#processAnnotations(BuildContext[]) a source file has annotations}.
- * <p>
- * This class is not intended to be instanciated or subclassed by clients.
- * </p>
- * @since 0.9.0
- */
-public class BuildContext extends CompilationParticipantResult {
-
-/**
- * Creates a build context for the given source file.
- * <p>
- * This constructor is not intended to be called by clients.
- * </p>
- *
- * @param sourceFile the source file being built
- */
-public BuildContext(IFile resource) {
- super(resource);
-}
-
-/**
- * Returns the contents of the compilation unit.
- *
- * @return the contents of the compilation unit
- */
-public char[] getContents() {
- try {
- return Util.getResourceContentsAsCharArray(this.resource);
- } catch (CoreException e) {
- throw new RuntimeException("Missing source file: " + this.resource);
- }
-}
-
-/**
- * Returns the <code>IFile</code> representing the compilation unit.
- *
- * @return the <code>IFile</code> representing the compilation unit
- */
-public IFile getFile() {
- return this.resource;
-}
-
-/**
- * Returns whether the compilation unit contained any annotations when it was compiled.
- *
- * NOTE: This is only valid during {@link CompilationParticipant#processAnnotations(BuildContext[])}.
- *
- * @return whether the compilation unit contained any annotations when it was compiled
- */
-public boolean hasAnnotations() {
- return this.hasAnnotations; // only set during processAnnotations
-}
-
-/**
- * Record new problems to report against this compilationUnit.
- * Markers are persisted for these problems only for the declared managed marker type
- * (see the 'compilationParticipant' extension point).
- *
- * @param newProblems the problems to report
- */
-public void recordNewProblems(CategorizedProblem[] newProblems) {
- int length2 = newProblems.length;
- if (length2 == 0) return;
-
- int length1 = this.problems == null ? 0 : this.problems.length;
- CategorizedProblem[] merged = new CategorizedProblem[length1 + length2];
- if (length1 > 0) // always make a copy even if currently empty
- System.arraycopy(this.problems, 0, merged, 0, length1);
- System.arraycopy(newProblems, 0, merged, length1, length2);
- this.problems = merged;
-}
-
-}
Copied: branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/BuildContext.java (from rev 2300, trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/BuildContext.java)
===================================================================
--- branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/BuildContext.java (rev 0)
+++ branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/BuildContext.java 2007-04-12 22:31:15 UTC (rev 2301)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *
+ *******************************************************************************/
+
+package org.rubypeople.rdt.core.compiler;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.rubypeople.rdt.internal.core.util.Util;
+
+/**
+ * The context of a build event that is notified to interested compilation
+ * participants when {@link CompilationParticipant#buildStarting(BuildContext[], boolean) a build is starting},
+ * or to annotations processors when {@link CompilationParticipant#processAnnotations(BuildContext[]) a source file has annotations}.
+ * <p>
+ * This class is not intended to be instanciated or subclassed by clients.
+ * </p>
+ * @since 0.9.0
+ */
+public class BuildContext extends CompilationParticipantResult {
+
+/**
+ * Creates a build context for the given source file.
+ * <p>
+ * This constructor is not intended to be called by clients.
+ * </p>
+ *
+ * @param sourceFile the source file being built
+ */
+public BuildContext(IFile resource) {
+ super(resource);
+}
+
+/**
+ * Returns the contents of the compilation unit.
+ *
+ * @return the contents of the compilation unit
+ */
+public char[] getContents() {
+ try {
+ return Util.getResourceContentsAsCharArray(this.resource);
+ } catch (CoreException e) {
+ throw new RuntimeException("Missing source file: " + this.resource);
+ }
+}
+
+/**
+ * Returns the <code>IFile</code> representing the compilation unit.
+ *
+ * @return the <code>IFile</code> representing the compilation unit
+ */
+public IFile getFile() {
+ return this.resource;
+}
+
+/**
+ * Returns whether the compilation unit contained any annotations when it was compiled.
+ *
+ * NOTE: This is only valid during {@link CompilationParticipant#processAnnotations(BuildContext[])}.
+ *
+ * @return whether the compilation unit contained any annotations when it was compiled
+ */
+public boolean hasAnnotations() {
+ return this.hasAnnotations; // only set during processAnnotations
+}
+
+/**
+ * Record new problems to report against this compilationUnit.
+ * Markers are persisted for these problems only for the declared managed marker type
+ * (see the 'compilationParticipant' extension point).
+ *
+ * @param newProblems the problems to report
+ */
+public void recordNewProblems(CategorizedProblem[] newProblems) {
+ int length2 = newProblems.length;
+ if (length2 == 0) return;
+
+ int length1 = this.problems == null ? 0 : this.problems.length;
+ CategorizedProblem[] merged = new CategorizedProblem[length1 + length2];
+ if (length1 > 0) // always make a copy even if currently empty
+ System.arraycopy(this.problems, 0, merged, 0, length1);
+ System.arraycopy(newProblems, 0, merged, length1, length2);
+ this.problems = merged;
+}
+
+}
Deleted: branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CategorizedProblem.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CategorizedProblem.java 2007-04-12 19:40:45 UTC (rev 2300)
+++ branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CategorizedProblem.java 2007-04-12 22:31:15 UTC (rev 2301)
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.rubypeople.rdt.core.compiler;
-
-import org.rubypeople.rdt.internal.core.util.CharOperation;
-
-
-/**
- * Richer description of a Ruby problem, as detected by the compiler or some of the underlying
- * technology reusing the compiler. With the introduction of <code>CompilationParticipant</code>,
- * the simpler problem interface <code>IProblem</code> did not carry enough information to better
- * separate and categorize Java problems. In order to minimize impact on existing API, Java problems
- * are still passed around as <code>IProblem</code>, though actual implementations should explicitly
- * extend <code>CategorizedProblem</code>. Participants can produce their own problem definitions,
- * and given these are categorized problems, they can be better handled by clients (such as user
- * interface).
- *
- * A categorized problem provides access to:
- * <ul>
- * <li> its location (originating source file name, source position, line number), </li>
- * <li> its message description and a predicate to check its severity (warning or error). </li>
- * <li> its ID : a number identifying the very nature of this problem. All possible IDs for standard Java
- * problems are listed as constants on <code>IProblem</code>, </li>
- * <li> its marker type : a string identfying the problem creator. It corresponds to the marker type
- * chosen if this problem was to be persisted. Standard Java problems are associated to marker
- * type "org.eclipse.jdt.core.problem"), </li>
- * <li> its category ID : a number identifying the category this problem belongs to. All possible IDs for
- * standard Java problem categories are listed in this class. </li>
- * </ul>
- *
- * Note: the compiler produces IProblems internally, which are turned into markers by the JavaBuilder
- * so as to persist problem descriptions. This explains why there is no API allowing to reach IProblem detected
- * when compiling. However, the Java problem markers carry equivalent information to IProblem, in particular
- * their ID (attribute "id") is set to one of the IDs defined on this interface.
- *
- * Note: Standard Java problems produced by Java default tooling will be subclasses of this class. Technically, most
- * API methods dealing with problems are referring to <code>IProblem</code> for backward compatibility reason.
- * It is intended that <code>CategorizedProblem</code> will be subclassed for custom problem implementation when
- * participating in compilation operations, so as to allow participant to contribute their own marker types, and thus
- * defining their own domain specific problem/category IDs.
- *
- * @since 3.2
- */
-public abstract class CategorizedProblem implements IProblem {
-
- /**
- * List of standard category IDs used by Ruby problems, more categories will be added
- * in the future.
- */
- public static final int CAT_UNSPECIFIED = 0;
- /** Category for problems related to buildpath */
- public static final int CAT_BUILDPATH = 10;
- /** Category for fatal problems related to syntax */
- public static final int CAT_SYNTAX = 20;
- /** Category for fatal problems in import statements */
- public static final int CAT_IMPORT = 30;
- /** Category for fatal problems related to types, could be addressed by some type change */
- public static final int CAT_TYPE = 40;
- /** Category for fatal problems related to type members, could be addressed by some field or method change */
- public static final int CAT_MEMBER = 50;
- /** Category for fatal problems which could not be addressed by external changes, but require an edit to be addressed */
- public static final int CAT_INTERNAL = 60;
- /** Category for optional problems in Javadoc */
- public static final int CAT_JAVADOC = 70;
- /** Category for optional problems related to coding style practices */
- public static final int CAT_CODE_STYLE = 80;
- /** Category for optional problems related to potential programming flaws */
- public static final int CAT_POTENTIAL_PROGRAMMING_PROBLEM = 90;
- /** Category for optional problems related to naming conflicts */
- public static final int CAT_NAME_SHADOWING_CONFLICT = 100;
- /** Category for optional problems related to deprecation */
- public static final int CAT_DEPRECATION = 110;
- /** Category for optional problems related to unnecessary code */
- public static final int CAT_UNNECESSARY_CODE = 120;
- /** Category for optional problems related to type safety in generics */
- public static final int CAT_UNCHECKED_RAW = 130;
- /** Category for optional problems related to internationalization of String literals */
- public static final int CAT_NLS = 140;
- /** Category for optional problems related to access restrictions */
- public static final int CAT_RESTRICTION = 150;
-
-/**
- * Returns an integer identifying the category of this problem. Categories, like problem IDs are
- * defined in the context of some marker type. Custom implementations of <code>CategorizedProblem</code>
- * may choose arbitrary values for problem/category IDs, as long as they are associated with a different
- * marker type.
- * Standard Java problem markers (i.e. marker type is "org.eclipse.jdt.core.problem") carry an
- * attribute "categoryId" persisting the originating problem category ID as defined by this method).
- * @return id - an integer identifying the category of this problem
- */
-//public abstract int getCategoryID(); FIXME Uncomment when we're ready to do categorization...
-
-/**
- * Returns the marker type associated to this problem, if it gets persisted into a marker by the JavaBuilder
- * Standard Java problems are associated to marker type "org.eclipse.jdt.core.problem").
- * Note: problem markers are expected to extend "org.eclipse.core.resources.problemmarker" marker type.
- * @return the type of the marker which would be associated to the problem
- */
-public abstract String getMarkerType();
-
-/**
- * Returns the names of the extra marker attributes associated to this problem when persisted into a marker
- * by the JavaBuilder. Extra attributes are only optional, and are allowing client customization of generated
- * markers. By default, no EXTRA attributes is persisted, and a categorized problem only persists the following attributes:
- * <ul>
- * <li> <code>IMarker#MESSAGE</code> -> {@link IProblem#getMessage()}</li>
- * <li> <code>IMarker#SEVERITY</code> -> <code> IMarker#SEVERITY_ERROR</code> or
- * <code>IMarker#SEVERITY_WARNING</code> depending on {@link IProblem#isError()} or {@link IProblem#isWarning()}</li>
- * <li> <code>IJavaModelMarker#ID</code> -> {@link IProblem#getID()}</li>
- * <li> <code>IMarker#CHAR_START</code> -> {@link IProblem#getSourceStart()}</li>
- * <li> <code>IMarker#CHAR_END</code> -> {@link IProblem#getSourceEnd()}</li>
- * <li> <code>IMarker#LINE_NUMBER</code> -> {@link IProblem#getSourceLineNumber()}</li>
- * <li> <code>IJavaModelMarker#ARGUMENTS</code> -> some <code>String[]</code> used to compute quickfixes </li>
- * </ul>
- * The names must be eligible for marker creation, as defined by <code>IMarker#setAttributes(String[], Object[])</code>,
- * and there must be as many names as values according to {@link #getExtraMarkerAttributeValues()}.
- * Note that extra marker attributes will be inserted after default ones (as described in {@link CategorizedProblem#getMarkerType()},
- * and thus could be used to override defaults.
- * @return the names of the corresponding marker attributes
- */
-public String[] getExtraMarkerAttributeNames() {
- return CharOperation.NO_STRINGS;
-}
-
-/**
- * Returns the respective values for the extra marker attributes associated to this problem when persisted into
- * a marker by the JavaBuilder. Each value must correspond to a matching attribute name, as defined by
- * {@link #getExtraMarkerAttributeNames()}.
- * The values must be eligible for marker creation, as defined by <code>IMarker#setAttributes(String[], Object[])</code>.
- * @return the values of the corresponding extra marker attributes
- */
-public Object[] getExtraMarkerAttributeValues() {
- return new Object[] {};
-}
-}
Copied: branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CategorizedProblem.java (from rev 2300, trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CategorizedProblem.java)
===================================================================
--- branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CategorizedProblem.java (rev 0)
+++ branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CategorizedProblem.java 2007-04-12 22:31:15 UTC (rev 2301)
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.rubypeople.rdt.core.compiler;
+
+import org.rubypeople.rdt.internal.core.util.CharOperation;
+
+
+/**
+ * Richer description of a Ruby problem, as detected by the compiler or some of the underlying
+ * technology reusing the compiler. With the introduction of <code>CompilationParticipant</code>,
+ * the simpler problem interface <code>IProblem</code> did not carry enough information to better
+ * separate and categorize Java problems. In order to minimize impact on existing API, Java problems
+ * are still passed around as <code>IProblem</code>, though actual implementations should explicitly
+ * extend <code>CategorizedProblem</code>. Participants can produce their own problem definitions,
+ * and given these are categorized problems, they can be better handled by clients (such as user
+ * interface).
+ *
+ * A categorized problem provides access to:
+ * <ul>
+ * <li> its location (originating source file name, source position, line number), </li>
+ * <li> its message description and a predicate to check its severity (warning or error). </li>
+ * <li> its ID : a number identifying the very nature of this problem. All possible IDs for standard Java
+ * problems are listed as constants on <code>IProblem</code>, </li>
+ * <li> its marker type : a string identfying the problem creator. It corresponds to the marker type
+ * chosen if this problem was to be persisted. Standard Java problems are associated to marker
+ * type "org.eclipse.jdt.core.problem"), </li>
+ * <li> its category ID : a number identifying the category this problem belongs to. All possible IDs for
+ * standard Java problem categories are listed in this class. </li>
+ * </ul>
+ *
+ * Note: the compiler produces IProblems internally, which are turned into markers by the JavaBuilder
+ * so as to persist problem descriptions. This explains why there is no API allowing to reach IProblem detected
+ * when compiling. However, the Java problem markers carry equivalent information to IProblem, in particular
+ * their ID (attribute "id") is set to one of the IDs defined on this interface.
+ *
+ * Note: Standard Java problems produced by Java default tooling will be subclasses of this class. Technically, most
+ * API methods dealing with problems are referring to <code>IProblem</code> for backward compatibility reason.
+ * It is intended that <code>CategorizedProblem</code> will be subclassed for custom problem implementation when
+ * participating in compilation operations, so as to allow participant to contribute their own marker types, and thus
+ * defining their own domain specific problem/category IDs.
+ *
+ * @since 3.2
+ */
+public abstract class CategorizedProblem implements IProblem {
+
+ /**
+ * List of standard category IDs used by Ruby problems, more categories will be added
+ * in the future.
+ */
+ public static final int CAT_UNSPECIFIED = 0;
+ /** Category for problems related to buildpath */
+ public static final int CAT_BUILDPATH = 10;
+ /** Category for fatal problems related to syntax */
+ public static final int CAT_SYNTAX = 20;
+ /** Category for fatal problems in import statements */
+ public static final int CAT_IMPORT = 30;
+ /** Category for fatal problems related to types, could be addressed by some type change */
+ public static final int CAT_TYPE = 40;
+ /** Category for fatal problems related to type members, could be addressed by some field or method change */
+ public static final int CAT_MEMBER = 50;
+ /** Category for fatal problems which could not be addressed by external changes, but require an edit to be addressed */
+ public static final int CAT_INTERNAL = 60;
+ /** Category for optional problems in Javadoc */
+ public static final int CAT_JAVADOC = 70;
+ /** Category for optional problems related to coding style practices */
+ public static final int CAT_CODE_STYLE = 80;
+ /** Category for optional problems related to potential programming flaws *...
[truncated message content] |