Summary: | Move namespaces from IType to IPackageDeclaration | ||
---|---|---|---|
Product: | z_Archived | Reporter: | Dawid Pakula <zulus> |
Component: | PDT | Assignee: | PHP Core <php.core-inbox> |
Status: | NEW --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | CC: | kaloyan, wywrzal |
Version: | unspecified | Keywords: | investigate, performance |
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://git.eclipse.org/r/44958 https://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=e12b5d6b72d454f435508932622e80a07a3538e0 https://git.eclipse.org/r/102761 |
||
Whiteboard: | |||
Bug Depends on: | 438087, 462138 | ||
Bug Blocks: |
Description
Dawid Pakula
2014-08-01 06:46:35 EDT
I started to look at this problem and I think I know why it was implemented with IType and not with IPackageDeclaration. IPackageDeclaration api doesn't have any type of "getChildren" method, so there is not place for fields, methods, types. Probably we can implement custom member type to fill this gap, but I just started to review it. In general I agree that we need separate types from namespaces in DB. It should give big performance improvement for some queries e.g. where element name is not specified. With some projects I noticed that overall number of types can be even around 30K+ and almost half of it were namespaces. I think we can start on index level, without changing models: Index everything as packages, but while search resolve as types (PhpElementResolver). PHPModelAccess will need additional method : findNamespaces or findPackages. Sounds good from performance perspective:) New Gerrit change created: https://git.eclipse.org/r/44958 Gerrit patch is in general ready to review, but I think this change should be accepted only when bug #462138 will be fixed. Gerrit change https://git.eclipse.org/r/44958 was merged to [master]. Commit: http://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=e12b5d6b72d454f435508932622e80a07a3538e0 Conversation from Gerrit: @Dawid I also thought to split this bug into 3 smaller pieces: Index (this patch), INamespace usage (IType.getNamespace), PackageDeclaration. @Michal I agree that implementing working IType.getNamespace can be useful, but what is your plan for IPackageDeclaration? @Dawid IType.getChildren() isn't important, because namespace and type declarations should be reported on same level (IType.getNamespace() and you can forget about namespace declaration, also see what happens in IType.getParent()). Like in JDT for one type per file pattern. Import declarations use only package names (bug 455754). In general, IPackageDeclaration is lighter than IType. Problems with two namespaces in file may be easy resolved by outliner / explorer contentproviders or sorters. Besides I personally hate current icon, it's too similar to class icon. First part of changes was merged (Namespaces are indexed as IPackageDeclaration now). New Gerrit change created: https://git.eclipse.org/r/102761 |