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 90464 - Configure Code Assistance should allow multiple source roots and possible also regexp filters
Summary: Configure Code Assistance should allow multiple source roots and possible als...
Status: RESOLVED WONTFIX
Alias: None
Product: cnd
Classification: Unclassified
Component: Project Discovery (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-01 21:04 UTC by Thomas Preisler
Modified: 2013-05-17 15:07 UTC (History)
3 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 Thomas Preisler 2006-12-01 21:04:54 UTC
Originally CR 6499471:

This is with the 5.5.1 based SSX3 bits.

I opened my "Dbx" project and the parser started merrily parsing stuff.
Then I noticed lots of messages like this:

SEVERE: create stream: .../1022751.dbx/1022751.h (No such file or directory)

These are all files that get created during a dbx testrun and they really
aren't on the disk. So where are they coming from?

I went down to that directory in the Projects explorer and the Explorer was
seeing them. Wow!

If I try to open them nothing happens, no error message, no exception.

I tried to Refresh but Refresh apparently doesn't work in the Projects
view.

I tried getting there via the Files explorer.
There the view is more accurate and up-to-date but there is no Refresh!
*** (#1 of 1): 2006-11-30 18:21:59 PST ivan
Comment 1 Vladimir Voskresensky 2007-05-25 08:54:40 UTC
I think, it was done following way:
- dbx was run in command line with "testrun" => temp files were created
- IDE project was created for the dbx folder => all temp "*.h" files were added
as well
- project was Cleaned from IDE => temp files were deleted, but remained in
Project explorer, while removed from Files explorer

The root of the problem is project system, not code model.
code model got from project system the list of registered files and tried to
open them. Because of failed to open => user notification (we can change level
to INFORMATIONAL from SEVERE if needed, but I think the notification is
absolutely correct and allowed the user to detect the problem).
Comment 2 Thomas Preisler 2007-05-25 16:21:25 UTC
This is very likely what happened except for one thing: if you open a file by
double clicking on the node in the project explorer and the file doesn't exist,
an error dialog comes up with the message: Document could not be opened. Ivan
says he didn't get an error or anything.

The 'fix' in this case would be to remove the .h files from the project as they
shouln't have been added. Pls note that the project shouldn't automatically
remove files that don't exist so that is not a solution.

Vladimir, pls change your warning message to INFORMATIONAL. Similar situations
are not that uncommon and should be flaged with a less severe message. 

Will close...
Comment 3 ivan 2007-05-25 20:25:36 UTC
On this step:

- project was Cleaned from IDE => temp files were deleted, but remained in
Project explorer, while removed from Files explorer

A more likely explanation is that the .h files were removed _outside_
of the IDE. 
I also have rouble with your use of "temp file". What exactly
is the definition of tmp files and even if we had a good definition why should
they be treated differently?


Comment 4 Thomas Preisler 2007-05-25 20:42:07 UTC
1) You added some files to a project.
2) A clean removed them from disk
3) The files are still in the project
4) The parser complained over non-existent files

Isn't that what happend?

I don't think there is a bug here. The files should not have been added to the
project or they should have been removed again by the user. The project system
should not remove them automatically based on whether they exist or not.
Vladimir will (I think) change the error message in the log to something less
seroius.
Comment 5 ivan 2007-05-25 20:50:46 UTC
"The files should not have been added to the project"
I never added them to the project. The project scanner found them.

"they should have been removed again by the user"
The user is not interested in removing gazillions of items
that were added by a robotic scanner.

"The project system should not remove them automatically based on whether
they exist or not."

What exactly is the spec for projects wrt files having been
removed outside of the IDE? Both in the case of manage and in the
case of unmanaged projects.

The thing is here's a _lot_ of them (don't you remember the dbx testuite
thomas?) and getting ENOENTs on opens on them is costly.
If you make the error less visible then the user won't even be aware that
ther are lot of redundant failing opens happening contributing to slowdown.


Comment 6 Thomas Preisler 2007-05-25 20:53:48 UTC
In case of generated source files (lex/yacc) it is actually common to have a
file in the project system (the generated source file) that sometimes exists
(after a build) and sometime not (after a clean). Whether a generated should or
should not be part of a project is up to the user and should be based on the
logic of his project. The project system cannot guess. If your header files has
code that the code assistance needs to fully parse your files, then they should
be added to the project. In this case you will get 'errors' from the parser
right after a clean because they don't exist. Perhaps this is not fully correct.
If the code assistance don;t need your header files, they should not be added to
the project. The project system cannot make the determination for you.
Comment 7 ivan 2007-05-25 21:06:44 UTC
The way this happenned is as follows:
when project was created the top-level src directory was given to the
IDE and scanned. It found src code in over 3000*6 subdirectories called 'test'
Users realises mistake. User has two options:

- move the test directory out from under src. That is effectively removing
  the test subdirectory. If removing a file willkeep stuff in the project
  won't removing the directory keep it there?

- subtract the test subdirectory from src. But that only affects scanning
  doesn't it? Will the subtraction also subtract them from the project?

  Hmm the thing is this isn't even possible. That is, ConfigureCodeAssistanceWizard
  Only allows specifying a root, but no excluded directories. Nor does
  it provide for a list of src roots as opposed to one src root.
Comment 8 Thomas Preisler 2007-05-25 21:17:15 UTC
You can remove a folder without removing the physical files, ifthat is what you
mean. You can safely cleanup the project after all the files were added.

OK, I see two problems:

1) The code assistance wizard should provide a list of source roorts as the
regular wizard does. The user can then avoid folders with 'test' files.

2) The parser should either silently ignore non-existent files. It is not an error.

You could also go downthe path of adding logic for excluding files or folders
using regular expressions but I'm not sure it is worth it.
Comment 9 Thomas Preisler 2007-05-25 21:35:08 UTC
reassigned to Configure Code Assistance.

I will file a seperate issue regarding the parser errors for non-existent files.
Comment 10 ivan 2007-05-25 21:41:37 UTC
On (1) 
list of src roots is just one possibility. Just by itself it's
insufficient. In my case an exclude scheme would be more appropriate.

And the following needs to be clarified: If the user edits the root-set,
naturally the scanner will only scan (and/or rescan) the new root set, but
will the project proxies be adjusted?
Simplest case: if an element of the root set is eliminated will the
project folder be eliminated?
Another example: If  directory referred to by the root set is externally
deleted will the root-set element be eliminated or at least the user
be given an opportunity to edit the root set?

On (2)
My concern regarding redundant opens of gazillions of files still stands.
The opens are even costlier if the files are mounted remotely.

In my situation, and in the absence fancier root-sets or expressions,
the only choice would be to move tmp/ out of src/ as I described earlier.
This is "a user accomodating the limitations of the IDE" so the IDE should
support this users actions.

I don't think you have the choice of _not_ going down the regexp path.
Consider ant. Even the very early versions of ant had a rich way
of describing src files and directories. That colony recognized very
early on that people will organize their src in a mayriad of ways. 

I understand the the problem the IDE is trying to solve is very hard.
Adoption of regexps might seem like the right direction in this discussion
but of course it will have all kinds of other ramifications.On (1) 
list of src roots is just one possibility. Just by itself it's
insufficient. In my case an exclude scheme would be more appropriate.

Comment 11 Thomas Preisler 2007-05-25 21:46:52 UTC
You may be correct that we also need a filter of some kind. If we (Alexander)
decides to add such a filer, it should also be added to the regular wizard so
you have same funtionallity in both.
Comment 12 Quality Engineering 2009-12-21 05:36:41 UTC
This bug was reported against NetBeans IDE 6.0 or an older release, or against a non-maintained module. NetBeans team does not have enough resources to get to this issue, therefore we are closing the issue as a WONTFIX. If you are interested in providing a patch for this bug, please see our NetFIX guidelines for how to proceed. 

We apologize for any inconvenience.


Thank you.
The NetBeans Team