Skip to content

Commit

Permalink
Doctrine as standalone feature part 1 - Doctrine-Eclipse-Plugin/#7
Browse files Browse the repository at this point in the history
  • Loading branch information
zulus committed Feb 22, 2015
1 parent 7b0d0d6 commit 2184315
Show file tree
Hide file tree
Showing 31 changed files with 101 additions and 423 deletions.
4 changes: 4 additions & 0 deletions changelog.txt → CHANGELOG.md
@@ -1,3 +1,7 @@
1.1.0

* Doctrine become standalone feature

1.0.94

* Project wizard now uses composers `create-project` command
Expand Down
2 changes: 2 additions & 0 deletions com.dubture.symfony.core/.gitignore
@@ -0,0 +1,2 @@
/target/
/target/
2 changes: 1 addition & 1 deletion com.dubture.symfony.core/META-INF/MANIFEST.MF
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Symfony Core Plugin
Bundle-SymbolicName: com.dubture.symfony.core;singleton:=true
Bundle-Version: 1.0.95.qualifier
Bundle-Version: 1.1.0.qualifier
Bundle-Activator: com.dubture.symfony.core.SymfonyCorePlugin
Bundle-Vendor: https://github.com/pulse00
Require-Bundle: org.eclipse.core.runtime,
Expand Down
2 changes: 1 addition & 1 deletion com.dubture.symfony.core/pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.dubture.symfony</groupId>
<artifactId>parent</artifactId>
<version>1.0.95-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>

</parent>

Expand Down
Expand Up @@ -12,7 +12,6 @@
import org.eclipse.php.core.codeassist.ICompletionContextResolver;
import org.eclipse.php.internal.core.codeassist.contexts.CompletionContextResolver;

import com.dubture.symfony.core.codeassist.contexts.AnnotationCompletionContext;
import com.dubture.symfony.core.codeassist.contexts.EntityCompletionContext;
import com.dubture.symfony.core.codeassist.contexts.RouteCompletionContext;
import com.dubture.symfony.core.codeassist.contexts.ServiceContainerContext;
Expand All @@ -37,7 +36,6 @@ public class SymfonyCompletionContextResolver extends CompletionContextResolver
public ICompletionContext[] createContexts() {

return new ICompletionContext[] {
new AnnotationCompletionContext(),
new ServiceContainerContext(),
new TemplateVariableContext(),
new RouteCompletionContext(),
Expand Down
Expand Up @@ -15,14 +15,12 @@
import org.eclipse.php.core.codeassist.ICompletionStrategy;
import org.eclipse.php.core.codeassist.ICompletionStrategyFactory;

import com.dubture.symfony.core.codeassist.contexts.AnnotationCompletionContext;
import com.dubture.symfony.core.codeassist.contexts.EntityCompletionContext;
import com.dubture.symfony.core.codeassist.contexts.RouteCompletionContext;
import com.dubture.symfony.core.codeassist.contexts.ServiceContainerContext;
import com.dubture.symfony.core.codeassist.contexts.TemplateVariableContext;
import com.dubture.symfony.core.codeassist.contexts.TransUnitCompletionContext;
import com.dubture.symfony.core.codeassist.contexts.ViewPathArgumentContext;
import com.dubture.symfony.core.codeassist.strategies.AnnotationCompletionStrategy;
import com.dubture.symfony.core.codeassist.strategies.EntityCompletionStrategy;
import com.dubture.symfony.core.codeassist.strategies.RouteCompletionStrategy;
import com.dubture.symfony.core.codeassist.strategies.ServiceContainerCompletionStrategy;
Expand Down Expand Up @@ -51,11 +49,7 @@ public ICompletionStrategy[] create(ICompletionContext[] contexts) {

Class contextClass = context.getClass();

if (contextClass == AnnotationCompletionContext.class) {

result.add(new AnnotationCompletionStrategy(context));

} else if (contextClass == ServiceContainerContext.class) {
if (contextClass == ServiceContainerContext.class) {

result.add(new ServiceContainerCompletionStrategy(context));

Expand Down

This file was deleted.

This file was deleted.

Expand Up @@ -232,7 +232,6 @@ public boolean visit(TypeDeclaration s) throws Exception {
if (s instanceof ClassDeclaration) {

currentClass = (ClassDeclaration) s;
parseAnnotation(currentClass);

for (Object o : currentClass.getSuperClasses().getChilds()) {

Expand Down Expand Up @@ -278,52 +277,6 @@ public boolean visit(TypeDeclaration s) throws Exception {
return true;
}

/**
*
* Check if the class is tagged to be used as an annotation.
*
*/
private void parseAnnotation(ClassDeclaration clazz) {

PHPDocBlock block = clazz.getPHPDoc();

if (block == null) {
return;
}

boolean isAnnotation = false;
if (block.getCommentType() == Comment.TYPE_PHPDOC) {

List<Annotation> annotations = null;
if (org.apache.commons.lang.StringUtils.isNotBlank(block.getLongDescription())) {
annotations = parser.parse(block.getLongDescription());
} else if (org.apache.commons.lang.StringUtils.isNotBlank(block.getShortDescription())) {
annotations = parser.parse(block.getShortDescription());
}

if (annotations != null) {
for (Annotation annotation : annotations) {
if (annotation.getClassName().equals("Annotation")) {
isAnnotation = true;
break;
}
}
}
}

if (!isAnnotation) {
return;
}

String ns = "";
if (namespace != null) {
ns = namespace.getName();
}

Logger.debugMSG("indexing annotation class: " + clazz.getName() + " " + ns);
ReferenceInfo info = new ReferenceInfo(ISymfonyModelElement.ANNOTATION, clazz.sourceStart(), clazz.sourceEnd(), clazz.getName(), null, ns);
requestor.addReference(info);
}


@Override
Expand Down
Expand Up @@ -31,7 +31,6 @@ public interface ISymfonyModelElement {
int ROUTE_METHOD = 301;

// misc
int ANNOTATION = 400;
int ENVIRONMENT = 401;
int TEMPLATE_VARIABLE = 402;
int ROUTE = 403;
Expand Down

0 comments on commit 2184315

Please sign in to comment.