This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 169038 - IndexabilityQuery is needed
Summary: IndexabilityQuery is needed
Status: RESOLVED INVALID
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Vitezslav Stejskal
URL:
Keywords: API
Depends on:
Blocks: 169036
  Show dependency tree
 
Reported: 2009-07-23 12:54 UTC by Jaroslav Tulach
Modified: 2009-08-13 09:50 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2009-07-23 12:54:47 UTC
While investigating issue 16874 I found out that the PHP is defining its own 
org.netbeans.modules.php.project.PhpVisibilityQuery not to suppress visibility, but "indexability" of certain 
subfolders in PHP projects. This is more a misuse of that query as originally it was invented for version control 
systems.

The PhpVisibilityQuery instructs the parsing API what folders to ignore and in this sense it works. However as it is 
globally registered, it has its flaws. Whenever user starts to work with the (fully enabled) IDE, there is some piece 
of PHP running. This is unfortunate.

Moreover it is not that unlikely that various projects will wish to skip some parts of its sources. As such I propose 
to define

public class final IndexabilityController {
  public static IndexabilityController create(String excludes) {
     // excludes in the classical Ant format for example: mydir/subdir/**/*.php
  }
}

This interface would be found in getLookup() of a project and would be consulted by the parsing API together with 
already queried VisibilityQuery.
Comment 1 Vitezslav Stejskal 2009-07-23 13:44:24 UTC
This sounds reasonable to me. I assume that the implementors of IndexabilityQuery will also provide means for user to
configure what is or is not indexable in particular projects. In other the infrastructure is not going to provide any
support for implementing these queries nor it is going to provide default query (with eg. some sort of UI customizer in
Tools-Options). In general, I still assume that the mainstream usecase is to index stuff under the source roots in the
project and the cases when IQ is needed are rather rare.

I'm CCing Tomas, because he as the potential primary user of this API might have some useful notes/ideas/requests. I'd
be grateful for some real world user scenarios/usecases that would describe how this is going to be used. Thanks
Comment 2 Tomas Mysik 2009-07-23 14:20:16 UTC
> In general, I still assume that the mainstream usecase is to index stuff under the source roots in the project and
> the cases when IQ is needed are rather rare.

Yes, I agree. I did it because - and this the example you asked for, Víťo - there are frameworks that define specific
directory structure, e.g. Smarty or Symfony (Symfony is supported in NB 6.8):

.
|-- apps
|-- cache      <-- needs to be ignored otherwise some classes are doubled in Go To Type, code completion etc.
|-- config
|-- data
|-- doc
|-- lib
|-- log
|-- plugins
|-- symfony
|-- test
`-- web

Moreover, many users already asked for such possibility for their existing projects, because of folders with
documentations etc. underneath source-directory.
(I know it's a bad practice but there's no easy way to solve it now.)

One comment - I think we need to be able to listen on changes of the exclude pattern.
Comment 3 Vladimir Voskresensky 2009-07-23 16:57:39 UTC
FYI, I have asked originally for the same functionality (in C++ projects source roots are full of object files after
building project).
For now we use Jan's patch where we customize class paths (although it's really funny to have C++ project depending on
org.netbeans.spi.java.classpath.FilteringPathResourceImplementation)
http://hg.netbeans.org/cnd-main?cmd=changeset;node=f49234c9860a
Comment 4 Tomas Mysik 2009-08-13 09:50:26 UTC
Obsolete, see issue #170308 for more information.