SapphireSteel Forum
Welcome, Guest. Please login or register.
May 18, 2013, 03:45:30 PM

Login with username, password and session length
Search:     Advanced search
Welcome to the SapphireSteel forum - for discussion of the Ruby In Steel and Amethyst IDEs
3883 Posts in 799 Topics by 669 Members
Latest Member: m
* Home Help Search Login Register
+  SapphireSteel Forum
|-+  General
| |-+  Ruby In Steel
| | |-+  Goto definition doesn't
« previous next »
Pages: [1] Print
Author Topic: Goto definition doesn't  (Read 3944 times)
dat
Newbie
*
Posts: 35


« on: March 05, 2009, 04:47:04 AM »

If I write a small test class:

def testclass
   def bar
      foo
   end
   
   def foo
      bar
   end
end
      

and right-click on bar in foo I get taken to the definition off bar. So that seems to be working fine.

However in my actual code it rarely if ever works.

Either the cursor stays on the same line or I get taken to the rails.rb file

Any ideas what might be wrong?
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1005


« Reply #1 on: March 05, 2009, 04:55:38 PM »

If the GoTo Definition doesnt work, it's normally because the IntelliSense system cant figure out what it's looking at.

It's one of the things about Ruby that definitions are created dynamically - that is, the symbol doesn't come into existence until the interpreter has executed that bit of code. At design time, no code has been run, so the symbol doesn't exist. The IntelliSense system tries to figure out what's what by doing a static analysis, but it can't cover all of the bases here.

The problem is very troublesome for Rails code - which is where it would be most useful, naturally.

If you can post a small sample, I can probably tell you if the IntelliSense system can resolve it or not.

The GoTo destination can end up in some odd looking places because I have to 'pseudo-execute' Rails code to get any reasonable IntelliSense at all, and sometimes this doesn't work too well.

I'm always looking for ways to improve Rails IntelliSense, so if you think it should work, I'll enter it as a bug.

Dermot
Logged
dat
Newbie
*
Posts: 35


« Reply #2 on: March 06, 2009, 04:56:12 AM »

Well, there doesn't appear to be anything odd about the code - even trying to find a definition of a function that's in the same class (and same file) doesn't work

I was actually suprised when my test case worked - it's not that different to the real cases that are failing

Even stranger, just trying my test case again (adding to an existing file), and that fails too.

Ahh. On futher checking, it seem to work OK on my laptop (test and real cases). Only obvious difference is that I haven't built a symbol table library on the laptop

Presumably the intellisense system is building a database on the fly as files get edited? Could that have got corrupted, and if so is there a way to clear it out and get it to rebuild?
Logged
dat
Newbie
*
Posts: 35


« Reply #3 on: March 06, 2009, 05:11:19 AM »

Just tried to create a new symbol library - which gave an error (duplicate symbol - not surprising as I had many of the same files in the original library)

But now I can't see any way to remove either library from the references - right clicking in the solution explorer I only get view in object browser and property options, and can't see anything that will let me remove them.
Logged
dat
Newbie
*
Posts: 35


« Reply #4 on: March 09, 2009, 03:59:46 AM »

Spoke too soon about it working on the laptop - it seemed fine for a while, but after using it for a short while it stopped working there too.

(Actually I'm not entirely sure if it was working and then stopped, or it just happened to work on the first few definitions I tried, but I suspect the former as I can't find any that work now - they seem to mostly end up in a schema definition file...)

My suspicion is there's something in my code-base that's making the Intellisense system throw a wobbly - if you have any ideas on how I might be able to help track this down it would be greatly appreciated.

One other update  - after reloading Visual Studio I did get the remove option on the symbol table right-click - I suspect there's a conflict with AnkhSVN which I also have installed (as that also adds items to the context menu - I'm guessing it wiped out some of the options)
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1005


« Reply #5 on: March 10, 2009, 07:50:06 AM »

The symbol table files are created in the application local directory, e.g. on my PC:

F:\Users\dermot\AppData\Local\SapphireSteel Software\SymbolTables

If you clean this out, the base symbol tables base.rst and rails.rst should be rebuillt when you restart.

Try that.

Dermot
Logged
dat
Newbie
*
Posts: 35


« Reply #6 on: March 12, 2009, 04:22:30 AM »

Deleting those files didn't seem to make any difference

I did try re-creatng the Intellisense library for my code, and that seems to have improved things a bit, but most don't work, and there doesn't seem to be any consistency between what does and doesn't



Logged
Dermot
Administrator
Hero Member
*****
Posts: 1005


« Reply #7 on: March 16, 2009, 04:05:33 AM »

I'll do some more investigation on this when I come round to doing our next release.

I can't see really what's going on - but I've added the problemt anyway to our system so it doesn't get forgotten.
Logged
dat
Newbie
*
Posts: 35


« Reply #8 on: March 16, 2009, 07:16:53 AM »

Thanks,

One additional piece of information - the other day I added a call to a function, immediately did a goto definition and it worked. I then did an undo/redo in the editor (quick way of getting back to where I was), and immediately tried a goto definition again - and it failed. I was able to reproduce this a few times, by adding a call to the same function at other points in my code and then doing an undo/redo.

This is also consistent with my earlier test code, which worked when I tried it once, and failed on a subsequent attempt.

Most of the time a try to goto definition it just stays on the same line, sometimes it goes to a strange location (eg schema.db) and occasionally works ok.

I'll let you know if I can uncover any further details that might help track down the problem.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!