Bug 249156 - remote editor is used for local files
Summary: remote editor is used for local files
Status: CLOSED WONTFIX
Alias: None
Product: PTP
Classification: Tools
Component: RDT (show other bugs)
Version: 2.1M4   Edit
Hardware: All All
: P4 minor (vote)
Target Milestone: Future   Edit
Assignee: Chris Recoskie CLA
QA Contact: Greg Watson CLA
URL:
Whiteboard:
Keywords:
: 251453 (view as bug list)
Depends on: 251776
Blocks:
  Show dependency tree
 
Reported: 2008-09-30 14:01 EDT by Mike Kucera CLA
Modified: 2014-05-29 14:42 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kucera CLA 2008-09-30 14:01:23 EDT
Local files in regular CDT projects are being opened in the RDT remote editor. This causes ProjectNotConfiguredExceptions whenever you try to do anything.
Comment 1 Chris Recoskie CLA 2008-10-01 10:12:40 EDT
There is really nothing we can do about this.  Both editors are registered against the same content types, and there is no way to express any additional conditions on when one editor should be preferred over another.  The current Eclipse behaviour is that the last editor contributed wins.

As a workaround, we should perhaps make it so that if the exception happens, we fall back to selecting the local provider.  It still won't bring up the actual CDT editor, but at least things will largely work by default, and hence the user may not really notice a difference.

Also, if we can make the remote editor visually look different than the regular CDT one in some subtle way (a different icon or something), then perhaps users would be able to notice that the wrong editor is being used and go in and select the one they prefer.
Comment 2 Beth Tibbitts CLA 2008-10-08 07:33:04 EDT
I noticed this too and meant to file a bug a couple of weeks ago. It's very disconcerting.

So as soon as you make a project a remote project, the editor that opens for it is the remote editor, then  if you create or open a file in a local project, it too gets opened in the remote C/C++ editor ( you can see that title flash in the title tab as it's opening).  That's the behavior I thought I saw.

How do you determine to use the remote editor for that first file?
Something different is happening there. Could you reset the 'last type of editor used' after using this editor? 

So if you 'open with...' to get the local editor back as the last one used, local files will get opened with that one after that, right?   
Comment 3 Chris Recoskie CLA 2008-10-08 09:16:17 EDT
Another thought we had was putting some code in the RDT editor to check if the project was remote or not, and if not open the other editor and close itself.  This is rather a hack though, and doesn't cover the case where you have an external file open (because it has no project).
Comment 4 Chris Recoskie CLA 2008-10-14 14:41:32 EDT
I've put in a request for a new icon for the editor.  That will be a start at least.
Comment 5 Chris Recoskie CLA 2008-10-15 12:54:42 EDT
I have made it so that the Remote C/C++ Editor now always shows a unique icon.  The icon I used is temporary until we get a hopefully better one from the Media Department.

Any further ideas we've had on getting the proper editor to show have not panned out thus far.
Comment 6 Chris Recoskie CLA 2008-10-20 10:26:17 EDT
I tried a hare-brained scheme involving creating a set of new, remote content types that extended from the CDT types.  The idea with this is that there is a mechanism that allows you to map content types to project natures, so if you say had the remote nature, we could express that our new content type should be used.  The problem though is that for the rest of CDT to work, our new content types had to extend from the old ones, in which case Eclipse seemed to think our new content type and the editor association for it were so redundant that they weren't even listed as options unless you went to open a file with "Other editors..." (or whatever it was called).

So for now, I declare defeat on this bug.  I think the only way to get this to work is by getting the Platform to provide an update to the content type system.  I'll open a bug against the platform for this if there isn't one already.
Comment 7 Chris Recoskie CLA 2008-10-20 15:07:45 EDT
*** Bug 251453 has been marked as a duplicate of this bug. ***
Comment 8 Greg Watson CLA 2008-10-27 09:34:23 EDT
Why not just have the remote editor work properly on local projects, since it's meant to be the same as the CEditor anyway? That way it wouldn't matter which editor was opened. If the icon was the same, then no-one would even notice.
Comment 9 Chris Recoskie CLA 2008-10-27 09:52:13 EDT
(In reply to comment #8)
> Why not just have the remote editor work properly on local projects, since it's
> meant to be the same as the CEditor anyway? That way it wouldn't matter which
> editor was opened. If the icon was the same, then no-one would even notice.

This is a bit tricky...

On a regular CDT project, there is no service model.  So there's no real way to get at the local providers this way (the local providers are currently incomplete to boot...)
Comment 10 Greg Watson CLA 2008-10-27 10:00:09 EDT
If it was possible to hard-code some default local service providers, it might be a acceptable work around for this problem though. As long as the behavior is the same, I don't think people would object to using the RDT editor on local projects when RDT was installed.
Comment 11 Chris Recoskie CLA 2008-11-21 08:15:56 EST
With the fix in bug 244839, the remote editor can now handle local content.  As a result I'm going to downgrade this.
Comment 12 Greg Watson CLA 2014-05-29 14:42:04 EDT
Assuming this will not be fixed.