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 168230 - Disambiguate *.pro files
Summary: Disambiguate *.pro files
Status: RESOLVED WONTFIX
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-07 14:25 UTC by Peter Nabbefeld
Modified: 2009-07-17 15:41 UTC (History)
0 users

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 Peter Nabbefeld 2009-07-07 14:25:57 UTC
Please disambiguate Qt project files from Prolog files. The Qt files take precedence over Prolog files, so editor
support by plugin does only work with C++ support installed. I guess it isn't possible by XML mime resolvers, it seems
You've to look for the first valid (non-comment, non-whitespace) line containing "TEMPLATE=": If the first valid line
starts with this phrase, it seems to be a valid Qt project file, otherwise not.
Comment 1 Alexander Simon 2009-07-07 16:14:54 UTC
I would suggest to resolve problem from Prolog side.
You can:
- put Prolog mime resolver before CND mime resolver
- do not accept files that do not contain ":-" in firs 512 bytes.
Is it possible?
Comment 2 Peter Nabbefeld 2009-07-07 17:06:38 UTC
While it's not my module (it's in main/contib), it shouldn't cause too many problems, as it mainly consists of a NBS
file. However, don't know how to place it before CND module (and, is it possible and acceptable, to place an external
module before an IDE one?).
Comment 3 Peter Nabbefeld 2009-07-07 17:24:42 UTC
BTW, IMHO the Qt project file is some very special thing, so it should not interfere so easily with other file types
using the same extension, i.e. detection should be as specific as possible.
Comment 4 Peter Nabbefeld 2009-07-07 19:46:44 UTC
After all, I've now found the CND mime resolvers positions - some look strange (especially 138), do they have a special
meaning?
Comment 5 Alexander Simon 2009-07-07 19:57:29 UTC
Yes, before/after another resolver to prevent conflict of files without extension.
You can look at resolvers' order in layer file.
Comment 6 Peter Nabbefeld 2009-07-07 20:05:15 UTC
Hm, but seems I can only look at the position in the physical layer files, cannot find the position numbers within
system filesystem browser (probably looking at the wrong place?) ...
Comment 7 Alexander Simon 2009-07-08 07:17:28 UTC
"Important files->XML Layer->this layer in context->Services->MIMEResolver" shows
all resolvers sorted by position.
You can open any resolver or open contained layer by popup menu.
Comment 8 Peter Nabbefeld 2009-07-08 13:13:46 UTC
While I can see all the mime resolvers, I cannot see the position numbers nor open the related layers :-(
Nevertheless, I still think a special file should not be assigned a mime type without any narrowing specs, so IMO the
bug is related to CND, not Prolog. OTOH, Your proposed change to Prolog is, IMHO, adventurous because a list of facts
might be longer than 512 characters, so it's like a lottery play. The only other chance would be to add a line starting
with  "#!/bin/bash/pl" as the first line. The description of xml mime resolvers is incomplete - if You have a better one
(probably on an internal server), please ask for permission to place it into NB wiki (DevFaq), as I don't know how to do
the fix. However, as the Prolog module is not mine (only want to use it), so this would be a private change - probably
You know the author (Caoyuan Deng)? BTW, the module is a bout 2 years old ...
Comment 9 Vladimir Voskresensky 2009-07-17 15:41:00 UTC
I think, prolog module should just declare it's sniffy resolver before our resolver (we have positions 215). 
We can not add something like "skip all with pro ext and having "bla-bla" in text", because it will cause opening file
and reading content, which is slower than simple file ext check. 
+ NB performance team will ask as to remove such check anyway.

The current position 215 is also has a meaning, because even resolving by file extensions is ordered in the
language-popularity order, so we can not move it back or forward. 
Sorry for inconvienience.
Thanks for understanding.
Vladimir.