History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RUBY-720
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Roman Chernyatchik
Reporter: Toli Kuznets
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Ruby

Autoscroll to source is not working on .rhtml files

Created: 14 Jul 07 04:21   Updated: 02 Nov 07 14:03
Component/s: RHTML
Fix Version/s: 1.0

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: None
Image Attachments:

1. autoscroll from test code.jpg
(211 kb)

2. view problem _file.rhtml file that doesn't do autoscroll from source.jpg
(300 kb)
Environment: Selena 7051, Ruby rev 9426

Build: 9,426


 Description  « Hide
Autoscroll to source seems to be broken for .rhtml files.
Works fine for .rb and .css files, but doesn't scroll to views when you switch to an RHTML file tab.

 All   Comments   Work Log   Change History      Sort Order:
Roman Chernyatchik - 20 Jul 07 19:41
Toli, please explain in more detail what you mean.

Toli Kuznets - 20 Jul 07 19:57
Sorry i wasn't clearer.

I have "autoscoll to source" button pressed on the project view.
When i open a .rb file with Ctrl-N or Ctrl-Shift-N, the file opens in the editor and the project view scrolls to the location of the file and that .rb file is selected.

However, if i do the same with a Ctrl-Shift-N and .rhtml file, the project view selection stays on the previous file and the .rhtml file is not selected.

That was the behaviour i saw in rev 9426

I just tried reproducing it now with rev 9467, and it seems to work for regular filename.rhtml files.
However, when i open _file_name.rhtml (common name for all partials in Rails) the Auto-scroll to source doesn't work on that.

as soon as i switch tabs to a different file the project view follows them, but when i come back to another _file_name.rhtml it stays with previous.

so it seems that only _file.rhtml files don't work.

Screenshot attached. the problem files i the right-most in the list of file tabs, is currently active but the project view did not sync.


Roman Chernyatchik - 20 Jul 07 22:31
>and the project view scrolls to the location of the file and that .rb file is selected.

There are two autoscrolls:

  • "to source" : from Project View to Editor, i.e. if you select node in project view, it will be opened in the editor automatically
  • "from source" : from Editor to Project View, i.e. when you select file or some construction in Editor, Idea will scroll to location and select corresponding element in Project View.

(on the screenshot both autoscrolls are enabled)

I've just check our current version:

  • "Autoscroll to source" works in Standart and Rails Project View
  • "Autoscroll from source" isn't completed yet thus it works incorrectly in Standart Project View and is disabled in Rails View.

We will fix "Autoscroll from source" in future.

P.S: I noticed(on screenshot), that you don't use our "Rails Project View", is it uncomfortable for your project?


Roman Chernyatchik - 26 Aug 07 21:33
"Autoscroll from source" is fixed for RailsView, see rev. 10300. It still sometimes doesn't work in Standart Project View( I suppose it's IDEA bug), but always works with Alt+F1 (select in ..)

Toli Kuznets - 05 Sep 07 18:29
Didn't know there was a Rails project view - now using it, looks awesome, thank you very much. Autoscroll for controllers/models seems to work great.
However, i noticed that if you open a test (such as IdRepositoryControllerTest in the sample screenshot) the atuoscroll from source opens the first controller in the test, but not the actual test.

It's not a big deal since it's essentially in the same file, but thought you may want to know.

Screenshot attached. The cursor is within the xxxTest module, but the overridden controller is scrolled to instead.


Toli Kuznets - 05 Sep 07 18:31
See how the cursor is in the xxxTest class but the controller class above is scrolled-to instead.

Roman Chernyatchik - 06 Sep 07 12:40
Yes, you are right. At current moment Idea Plugin API (for autoscroll from source) doesn't allow us to get information about current position in ruby script, thus we had to navigate to the first class in current file.

Roman Chernyatchik - 02 Nov 07 14:03
done. rev. 12091