Author Topic: right-click open #include files (sublime text style)?  (Read 7401 times)

jamesson

  • Junior Community Member
  • Posts: 9
  • Hero Points: 0
right-click open #include files (sublime text style)?
« on: June 26, 2012, 04:14:12 am »
Howdy folks

Just got my hands on this thing a couple days ago. Great package overall, but...

One thing I miss from sublime text is the ability to right-click an #include /foo/bar.c statement and be able to pop /foo/bar.c open in another pane. Is this perhaps one of the optional commands in the right-click context menu?

Many thanks in advance

Joe

Graeme

  • Senior Community Member
  • Posts: 2246
  • Hero Points: 287
Re: right-click open #include files (sublime text style)?
« Reply #1 on: June 26, 2012, 05:01:29 am »
You could try right click -> go to definition (Ctrl+dot)

Ctrl+comma to return.
Slickedit will need to know how to find the file so it will either need to be in your project or found through the path settings in your project - or maybe in the current folder, or be an absolute path.
It's easy to customise the right click menu to add an entry with a more intuitive name if you wanted to.


jamesson

  • Junior Community Member
  • Posts: 9
  • Hero Points: 0
Re: right-click open #include files (sublime text style)?
« Reply #2 on: June 26, 2012, 02:31:55 pm »
Graeme

Many thakns for your answer, it confirms my own suspicions

However

In all cases, this returns symbol not found!

example statement;

#include "swirly/playback/swirly_time.js" - it's there, I checked.

I can imagine the possibility that this is formatted incorrectly, but if why does sublime text find it?

Thanks again

Joe

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2238
  • Hero Points: 123
Re: right-click open #include files (sublime text style)?
« Reply #3 on: June 26, 2012, 02:55:05 pm »
I can think of a couple of possibilities:

* The current working directory of the editor is different (you can check this on the File menu, or type "cd" on the SlickEdit command line)

* I don't know how projects work in your other editor, but you might need to add this to the include paths for your project in your SlickEdit project.  This is on the Project Properties dialog.

jamesson

  • Junior Community Member
  • Posts: 9
  • Hero Points: 0
Re: right-click open #include files (sublime text style)?
« Reply #4 on: June 26, 2012, 06:23:57 pm »
Tried both, same result

Thanks again

Joe

Graeme

  • Senior Community Member
  • Posts: 2246
  • Hero Points: 287
Re: right-click open #include files (sublime text style)?
« Reply #5 on: June 27, 2012, 11:31:56 am »
I assume you mean it still doesn't work.

Slickedit needs a leading / to treat this as an absolute path
Quote
#include "swirly/playback/swirly_time.js" - it's there, I checked.

How does your compiler find this and what type of file is doing the #include ?

I don't get "symbol not found" for a relative path that slick can't find  - instead I get a dialog that asks me to enter the path where the file can be found ??


jamesson

  • Junior Community Member
  • Posts: 9
  • Hero Points: 0
Re: right-click open #include files (sublime text style)?
« Reply #6 on: June 27, 2012, 01:41:19 pm »
The include is handled by make - it's a weird system that uses make to assemble javascripts, don't think about it too hard :).

Re symbol not found, I am in 2011 - maybe your version is different?

And it's not an absolute path (assuming you mean path from root directory) - it's local relative to the open file

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2238
  • Hero Points: 123
Re: right-click open #include files (sublime text style)?
« Reply #7 on: June 27, 2012, 01:43:14 pm »
But you did try adding the include path to the SlickEdit project, correct?

jamesson

  • Junior Community Member
  • Posts: 9
  • Hero Points: 0
Re: right-click open #include files (sublime text style)?
« Reply #8 on: June 27, 2012, 02:31:58 pm »
Yep, sure

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2238
  • Hero Points: 123
Re: right-click open #include files (sublime text style)?
« Reply #9 on: June 27, 2012, 02:33:29 pm »
OK, I had to double check.

Does this work for a simple path?  #include "a.h", where a.h is in the same path as the file you are editing?

jamesson

  • Junior Community Member
  • Posts: 9
  • Hero Points: 0
Re: right-click open #include files (sublime text style)?
« Reply #10 on: June 27, 2012, 03:17:34 pm »

Same deal
Specifically it says "tag not found". I suspect this is a js issue, wherein SE cannot comprehend the existence of a make include within a jscript file. If so, it is forgiven.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2238
  • Hero Points: 123
Re: right-click open #include files (sublime text style)?
« Reply #11 on: June 27, 2012, 03:21:04 pm »
Sorry, your last answer confused me a little bit.  What sort of file are you including, and what sort of file are you including it from?

jamesson

  • Junior Community Member
  • Posts: 9
  • Hero Points: 0
Re: right-click open #include files (sublime text style)?
« Reply #12 on: June 27, 2012, 03:33:07 pm »
As I mentioned, this is a kludge that uses make to combine ("include") javascript files. All the files are javascript. Make is supposed to take a bunch of them and make a bigger one out of them. Sorry if I was unclear.

Graeme

  • Senior Community Member
  • Posts: 2246
  • Hero Points: 287
Re: right-click open #include files (sublime text style)?
« Reply #13 on: June 28, 2012, 11:51:11 am »
Javascript doesn't support #include so slick doesn't recognize the text as a filename.  That's why you get symbol not found.  It's not hard to write a macro to do what you want.  I'll see if I can do it sometime.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2238
  • Hero Points: 123
Re: right-click open #include files (sublime text style)?
« Reply #14 on: June 28, 2012, 12:23:18 pm »
You might try running the "cursor-error" command.  It may be bound to a key already, but it is a different command from what that menu item uses.