Hirse / brackets-outline-list

Extension for Brackets and Phoenix to display a list of the functions or definitions in the currently opened document.
MIT License
79 stars 30 forks source link

require_once in PHP causes outline problems #74

Closed DanielKimblad closed 7 years ago

DanielKimblad commented 7 years ago

Details about environment Windows 10 Pro 64

Other installed extensions:

Example code below

<?php
require_once('includes/conf.php');
require_once('includes/class.db.php');

define('LOGS_TABLE', 'logs');

class LogHelper{
    private $db = new DB();
    public static function LogToDB($param1, $param2, $param3, $param4){
        $data = array('column1'=>$param1, 'column2'=>$param2, 'column3'=>$param3, 'column4'=>$param4);
        return $db->insert(LOGS_TABLE, $data);
    }
}
?>

What did you expect to happen? How did you expect the Outline to look?

I expected a function list containing the member function LogToDB.

What actually happened? How did the Outline actually look?

conf::php::require_once::db::php::define:: [and much more here] ::LogHelper::LogToDB()

Developer Tools Console errors:

These may be unrelated.

3/command/Menus.js:831 Error setting menu item shortcut: 1(anonymous function) @ /command/Menus.js:831 /utils/EventDispatcher.js:231 Exception in 'activeEditorChange' listener on Object TypeError: Cannot read property 'file' of null TypeError: Cannot read property 'file' of null at file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:589:27 at t (/thirdparty/lodash.js:6:249) at Function.eval [as findIndex] (/thirdparty/lodash.js:28:324) at _addToMROFList (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:588:23) at _handleActiveEditorChange (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:785:13) at Object.trigger (/utils/EventDispatcher.js:229:40) at _notifyActiveEditorChanged (/editor/EditorManager.js:161:17) at _handleCurrentFileChange (/editor/EditorManager.js:178:9) at Object.trigger (/utils/EventDispatcher.js:229:40) at eval (/view/MainViewManager.js:1106:29)trigger @ /utils/EventDispatcher.js:231 /utils/EventDispatcher.js:232 Assertion failed:trigger @ /utils/EventDispatcher.js:232 /utils/EventDispatcher.js:231 Exception in 'currentFileChange' listener on Object TypeError: Cannot read property 'file' of null TypeError: Cannot read property 'file' of null at file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:589:27 at t (/thirdparty/lodash.js:6:249) at Function.eval [as findIndex] (/thirdparty/lodash.js:28:324) at _addToMROFList (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:588:23) at handleCurrentFileChange (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:772:10) at Object.trigger (/utils/EventDispatcher.js:229:40) at eval (/view/MainViewManager.js:1106:29) at Pane.trigger (/utils/EventDispatcher.js:229:40) at Pane._notifyCurrentViewChange (/view/Pane.js:890:14) at Pane.showView (/view/Pane.js:1202:14)trigger @ /utils/EventDispatcher.js:231 /utils/EventDispatcher.js:232 Assertion failed:trigger @ /utils/EventDispatcher.js:232 /utils/EventDispatcher.js:231 Exception in 'activeEditorChange' listener on Object TypeError: Cannot read property 'file' of null TypeError: Cannot read property 'file' of null at file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:561:27 at t (/thirdparty/lodash.js:6:249) at Function.eval [as findIndex] (/thirdparty/lodash.js:28:324) at _updateCursorPosition (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:560:23) at _handleActiveEditorChange (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:789:13) at Object.trigger (/utils/EventDispatcher.js:229:40) at _notifyActiveEditorChanged (/editor/EditorManager.js:161:17) at _handleCurrentFileChange (/editor/EditorManager.js:178:9) at Object.trigger (/utils/EventDispatcher.js:229:40) at eval (/view/MainViewManager.js:1106:29)trigger @ /utils/EventDispatcher.js:231 /utils/EventDispatcher.js:232 Assertion failed:trigger @ /utils/EventDispatcher.js:232 /utils/EventDispatcher.js:231 Exception in 'activeEditorChange' listener on Object TypeError: Cannot read property 'file' of null TypeError: Cannot read property 'file' of null at file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:589:27 at t (/thirdparty/lodash.js:6:249) at Function.eval [as findIndex] (/thirdparty/lodash.js:28:324) at _addToMROFList (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:588:23) at _handleActiveEditorChange (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:785:13) at Object.trigger (/utils/EventDispatcher.js:229:40) at _notifyActiveEditorChanged (/editor/EditorManager.js:161:17) at _handleCurrentFileChange (/editor/EditorManager.js:178:9) at Object.trigger (/utils/EventDispatcher.js:229:40) at eval (/view/MainViewManager.js:1106:29)trigger @ /utils/EventDispatcher.js:231 /utils/EventDispatcher.js:232 Assertion failed:trigger @ /utils/EventDispatcher.js:232 /utils/EventDispatcher.js:231 Exception in 'currentFileChange' listener on Object TypeError: Cannot read property 'file' of null TypeError: Cannot read property 'file' of null at file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:589:27 at t (/thirdparty/lodash.js:6:249) at Function.eval [as findIndex] (/thirdparty/lodash.js:28:324) at _addToMROFList (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:588:23) at handleCurrentFileChange (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:772:10) at Object.trigger (/utils/EventDispatcher.js:229:40) at eval (/view/MainViewManager.js:1106:29) at Pane.trigger (/utils/EventDispatcher.js:229:40) at Pane._notifyCurrentViewChange (/view/Pane.js:890:14) at Pane.showView (/view/Pane.js:1202:14)trigger @ /utils/EventDispatcher.js:231 /utils/EventDispatcher.js:232 Assertion failed:trigger @ /utils/EventDispatcher.js:232 /utils/EventDispatcher.js:231 Exception in 'activeEditorChange' listener on Object TypeError: Cannot read property 'file' of null TypeError: Cannot read property 'file' of null at file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:561:27 at t (/thirdparty/lodash.js:6:249) at Function.eval [as findIndex] (/thirdparty/lodash.js:28:324) at _updateCursorPosition (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:560:23) at _handleActiveEditorChange (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:789:13) at Object.trigger (/utils/EventDispatcher.js:229:40) at _notifyActiveEditorChanged (/editor/EditorManager.js:161:17) at _handleCurrentFileChange (/editor/EditorManager.js:178:9) at Object.trigger (/utils/EventDispatcher.js:229:40) at eval (/view/MainViewManager.js:1106:29)trigger @ /utils/EventDispatcher.js:231 /utils/EventDispatcher.js:232 Assertion failed:trigger @ /utils/EventDispatcher.js:232 /utils/EventDispatcher.js:231 Exception in 'activeEditorChange' listener on Object TypeError: Cannot read property 'file' of null TypeError: Cannot read property 'file' of null at file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:589:27 at t (/thirdparty/lodash.js:6:249) at Function.eval [as findIndex] (/thirdparty/lodash.js:28:324) at _addToMROFList (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:588:23) at _handleActiveEditorChange (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:785:13) at Object.trigger (/utils/EventDispatcher.js:229:40) at _notifyActiveEditorChanged (/editor/EditorManager.js:161:17) at _handleCurrentFileChange (/editor/EditorManager.js:178:9) at Object.trigger (/utils/EventDispatcher.js:229:40) at eval (/view/MainViewManager.js:1106:29)trigger @ /utils/EventDispatcher.js:231 /utils/EventDispatcher.js:232 Assertion failed:trigger @ /utils/EventDispatcher.js:232 /utils/EventDispatcher.js:231 Exception in 'currentFileChange' listener on Object TypeError: Cannot read property 'file' of null TypeError: Cannot read property 'file' of null at file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:589:27 at t (/thirdparty/lodash.js:6:249) at Function.eval [as findIndex] (/thirdparty/lodash.js:28:324) at _addToMROFList (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:588:23) at handleCurrentFileChange (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:772:10) at Object.trigger (/utils/EventDispatcher.js:229:40) at eval (/view/MainViewManager.js:1106:29) at Pane.trigger (/utils/EventDispatcher.js:229:40) at Pane._notifyCurrentViewChange (/view/Pane.js:890:14) at Pane.showView (/view/Pane.js:1202:14)trigger @ /utils/EventDispatcher.js:231 /utils/EventDispatcher.js:232 Assertion failed:trigger @ /utils/EventDispatcher.js:232 /utils/EventDispatcher.js:231 Exception in 'activeEditorChange' listener on Object TypeError: Cannot read property 'file' of null TypeError: Cannot read property 'file' of null at file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:561:27 at t (/thirdparty/lodash.js:6:249) at Function.eval [as findIndex] (/thirdparty/lodash.js:28:324) at _updateCursorPosition (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:560:23) at _handleActiveEditorChange (file:///C:/Program%20Files%20(x86)/Brackets/www/extensions/default/NavigationAndHistory/main.js:789:13) at Object.trigger (/utils/EventDispatcher.js:229:40) at _notifyActiveEditorChanged (/editor/EditorManager.js:161:17) at _handleCurrentFileChange (/editor/EditorManager.js:178:9) at Object.trigger (/utils/EventDispatcher.js:229:40) at eval (/view/MainViewManager.js:1106:29)trigger @ /utils/EventDispatcher.js:231 /utils/EventDispatcher.js:232 Assertion failed:trigger @ /utils/EventDispatcher.js:232

pelatx commented 7 years ago

I think the error has nothing to do with the 'require_once', but with the word 'class' in the second 'require' path.