Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump to included file does not work for relative path #69

Open
feekApp opened this issue Feb 11, 2016 · 4 comments
Open

Jump to included file does not work for relative path #69

feekApp opened this issue Feb 11, 2016 · 4 comments

Comments

@feekApp
Copy link

feekApp commented Feb 11, 2016

Hi,

When pressing CMD-SHIFT-D (Jump to Included File), only files with an absolute path to the file are recognized.

// active file in ~/Desktop/Test
// does not work:
include 'untitled.php';
// does work:
include '/Users/UserName/Desktop/Test/untitled.php';

Tooltip error: file not found.

Also when pressing ESC when the CMD-SHIFT-D pop-up tooltip is active, the following error occurs:
Failure running "Jump to include File"
Command return status code 1

I'am using TM 2.0 beta 8.6 and OSX 10.11.3n (also happens with TM beta 8.5)

regards,
Feek

@feekApp
Copy link
Author

feekApp commented Feb 11, 2016

Hi,
solved it!

Added the current working directory (Environment Variable: TM_DIRECTORY) to PHP_INCLUDE_PATH variable in my main .tm_properties file (note the closing /):

# Add PHP Completion support
PHP_INCLUDE_PATH   = /usr/bin/php:$TM_DIRECTORY/

regards,
Feek

@feekApp feekApp closed this as completed Feb 11, 2016
infininight added a commit that referenced this issue Feb 12, 2016
This is needed as the active file's directory is no longer the default working directory when running commands. Fixes #69.
@infininight
Copy link
Member

This was actually a regression due to a change in how TextMate runs commands. I've pushed a change to correct the issue without needing to set the variable. Thanks for pointing this out. :)

@feekApp
Copy link
Author

feekApp commented Feb 12, 2016

Hi Infininight,

Thnx for fixing the path-issue.

Sorry I was to I was too quick closing this issue :(

The issue regarding pressing ESC when the CMD-SHIFT-D pop-up tooltip is active for selecting a file, still persists. The following error code is showing:

 Failure running "Jump to include File"
 Command return status code 1

regards,
feek

@feekApp feekApp reopened this Feb 12, 2016
@feekApp
Copy link
Author

feekApp commented Feb 12, 2016

Additional to the above:

paths = []
  if ENV['PHP_INCLUDE_PATH']
    paths = ENV['PHP_INCLUDE_PATH'].split(':')
  else
    paths = [ENV['TM_DIRECTORY']]
  end

you have to add the TM_DIRECTORY also to the path if the I statement is true! When the PHP_INCLUDE_PATH is set (needed cf. the plugin help), now no search is done in the current folder.

regards,
feek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants