PSI api suggestions

Sorry if I should not post here for PSI (A separate news group for the semi-open api would be best than wiki notification IMHO if you do not want to use the Open Api forum.)

I have 2 little comments:

1) Consider moving PsiFile.findImportReferenceTo(PsiClass) to PsiJavaFle. Rational: what does it return when it isn't a java file? Should it be valid at all? It doesn't look like it is very cohesive right now.

2) PsiManager.getRootDirectories(int) should be deprecated in favor to a more explicit interface like PsiManager.getRootDirectories(PsiRootPackageType)

Jacques

2 comments
Comment actions Permalink

1) Consider moving PsiFile.findImportReferenceTo(PsiClass) to PsiJavaFle.

Rational: what does it return when it isn't a java file? Should it be valid
at all? It doesn't look like it is very cohesive right now.

Please remember about JSP files.

>

2) PsiManager.getRootDirectories(int) should be deprecated in favor to a

more explicit interface like
PsiManager.getRootDirectories(PsiRootPackageType)

PsiRootPackageType is nothing but collection of integer constants. Anyway
this method will probably be changed because of new module-based project
structure.

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"


"Jacques Morel" <jacmorel@yahoo.com> wrote in message
news:3661060.1059557013632.JavaMail.javamailuser@localhost...

Sorry if I should not post here for PSI (A separate news group for the

semi-open api would be best than wiki notification IMHO if you do not want
to use the Open Api forum.)
>

I have 2 little comments:

>

1) Consider moving PsiFile.findImportReferenceTo(PsiClass) to PsiJavaFle.

Rational: what does it return when it isn't a java file? Should it be valid
at all? It doesn't look like it is very cohesive right now.
>

2) PsiManager.getRootDirectories(int) should be deprecated in favor to a

more explicit interface like
PsiManager.getRootDirectories(PsiRootPackageType)
>

Jacques



0
Comment actions Permalink

Please remember about JSP files

Not to worry. Everybody that puts java code in their jsp should be shot anyway ;)

PsiRootPackageType is nothing but collection of integer constants

Why not having a real enum like OrderRootType? For people like us, mere mortals, it would be self documented (right now it is rather difficult to know what to feed that method when you know nothing about psi) and you could make sure that only the allowed value would be passed in.
Anyway I am sure you know all that since you have already done this. Consider this a friendly reminder to change it when you introduce the multi-module support.

Jacques

0

Please sign in to leave a comment.