Bug 81555 - CDT changes behavior of Java editor
Summary: CDT changes behavior of Java editor
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 2.0.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1   Edit
Assignee: Doug Schaefer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 80090 (view as bug list)
Depends on: 72796
Blocks: 78330 81898
  Show dependency tree
 
Reported: 2004-12-17 14:22 EST by Paul Elder CLA
Modified: 2014-01-29 13:17 EST (History)
8 users (show)

See Also:


Attachments
Patch against CDT 3.1 (HEAD) (8.12 KB, patch)
2006-03-30 08:32 EST, Anton Leherbauer CLA
cdtdoug: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Elder CLA 2004-12-17 14:22:38 EST
The CDT installs the C/C++ document partitioner in Java documents. (In fact, it
appears to install its document partitioner in every document.)

This prevents MarkerResolutions extension (see extension point
org.eclipse.ui.ide.markerResolution) that work against markers in Javadoc
comments from working. Disabling the CDT resolves the issue.

With regard the this problem, there are a number of areas where CDT code is
questionable:

* the use of extensions="*" in the org.eclipse.core.filebuffers.documentSetup
and org.eclipse.core.filebuffers.documentCreation extensions obligates the CDT
to ensure its actions are appropriate - currently, the code assumes installing
CDT behavior is always appropriate (hence the presence of a C++ document
partitioner in Java documents).

* The C++ document partitioner is installed as
IDocumentExtension3.DEFAULT_PARTITIONING (See
CTextTools.setCDocumentPartitioner()). In comparition, the Java document
partitioner is installed under a unique name (__java_partitioning). Changing the
CDT to use a unique partition name allows my MarkerResolutions to run. I'm not
sure what impact this has on the C++ editor, though.
Comment 1 Alain Magloire CLA 2004-12-17 14:48:04 EST
> * the use of extensions="*" in the org.eclipse.core.filebuffers.documentSetup
Correct, we can not fix this until 72796:
  https://bugs.eclipse.org/bugs/show_bug.cgi?id=72796
is fixed

> * The C++ document partitioner is installed as
> IDocumentExtension3.DEFAULT_PARTITIONING

We would need to do some refactoring but that sounds good to me

Definitive 3.0 material
Comment 2 Alain Magloire CLA 2004-12-21 16:11:29 EST
*** Bug 80090 has been marked as a duplicate of this bug. ***
Comment 3 Nitin Dahyabhai CLA 2004-12-29 15:54:54 EST
The partitioner being installed is breaking any and all partitioning-dependent
behavior in the WTP SSE editors.  Text frameworks in Eclipse and elsewhere not
aware of IDocumentExtension3 are left using the CDT partitioner by default even
in SSE documents.  SSE has its own IDocument implementation which must be used
by our editors and has corresponding document factories installed for its
content types.  By overriding the default partitioner, the CDT *just by being
present* disables our syntax highlighting and content assist.
Comment 4 Alain Magloire CLA 2005-02-21 22:04:18 EST
This PR covers two things:
- The use of the "*" wildcard to set the document

This is now fix in the head, we use the content-type attribute
to restrict the document setup.

The second part is a suggestion to use a uniq partition name.

Not implemented yet,  bug remains open  but no longer a blocker.
Comment 5 David Daoust CLA 2005-06-06 06:51:12 EDT
At the monthly CDT conference call (June 2005). We agreed that it is invalid to
have a defect assigned to a inbox owner AND set to a valid release (they should
be  assigned to future).  The June 3/2005 deadline for triaging these defects
has passes, so I am moving all the remaining ones to future.
Comment 6 John Camelon CLA 2005-06-06 09:48:08 EDT
(In reply to comment #1)
> > * the use of extensions="*" in the org.eclipse.core.filebuffers.documentSetup
> Correct, we can not fix this until 72796:
>   https://bugs.eclipse.org/bugs/show_bug.cgi?id=72796
> is fixed

Is this still an issue in 3.0?
All the blocked & depending defects are closed.
Comment 7 John Camelon CLA 2005-07-04 01:38:25 EDT
(In reply to comment #6)
> Is this still an issue in 3.0?
> All the blocked & depending defects are closed.

Comment 8 Dani Megert CLA 2006-01-04 11:52:33 EST
>Text frameworks in Eclipse and elsewhere not
>aware of IDocumentExtension3 are left using the CDT partitioner by default even
>in SSE documents. 
Can you give pointers which parts of the text framework do not support IDocumentExtension3?

NOTE: if SSE switches to use IDocumentExtension3 plus its own partitioning (ID) SSE should be fine and no longer be broken by other plug-ins that modify the default partitioning. Of course things like code assist, reconciler etc. must have the correct partitioning set (see SourceViewerConfiguration.getConfiguredDocumentPartitioning(ISourceViewer)).
Comment 9 Dani Megert CLA 2006-01-04 12:20:15 EST
>The second part is a suggestion to use a uniq partition name.
>Not implemented yet,  bug remains open  but no longer a blocker.
Note that for 3.2 Platform Text will detect extensions that do not use IDocumentExtension3 for setting the partitioner and write a log entry for each document setup.

Comment 10 Anton Leherbauer CLA 2006-03-30 08:32:03 EST
Created attachment 37317 [details]
Patch against CDT 3.1 (HEAD)

Use a CDT specific partitioning for (almost) all C documents.
See also bug 132702 (duplicate).
Comment 11 Doug Schaefer CLA 2006-03-30 17:00:42 EST
Excellent. Thanks. The patch looks good. I'll have to give it a run to make sure it doesn't break anything.
Comment 12 Doug Schaefer CLA 2006-03-30 17:02:39 EST
*** Bug 132702 has been marked as a duplicate of this bug. ***
Comment 13 Doug Schaefer CLA 2006-04-04 14:54:11 EDT
I have applied the patch. The warning that Eclipse 3.2 was giving about the CDT registering as a default partitioner (or something) has gone away.