Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-72482

Development option to open source file and line references in your IDE using $CFG->debugideurlscheme

    XMLWordPrintable

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • Future Dev
    • None
    • Administration
    • MDL-72482-ideurlscheme-config-php
    • Hide

      Preconditions:

      Note that xdebug can add its own stack trace debugging, if that is on then you do not get the moodle stack traces. xdebug has an equivalent feature to this here:

      https://2.xdebug.org/docs/stack_trace#file_link_format

       

      1. Set $CFG->debugdisplay = 1;
      2. Temp edit lib/classes/userfeedback.php on line 99 and 'throw new Excption('test')
      3. Visit /my/
      4. Confirm you see a stack trace
      5. Set $CFG->debugideurlscheme according to the IDE you are using. 
      6. Reload /report/upgradelog/index.php
      7. Confirm you see a stack trace with linked paths
      8. Test some links and Confirm they open in your IDE at the right file and line number (this assumes your code is at the same path, eg apache / nginx running directly on the host OS)
      9. Copy the source code files to a second directory which is different to $CFG->dirroot
      10. Set $CFG->srcdirroot to match to the new directory
      11. Reload the page again, click the links and confirm your IDE is opening the files from the new location

      Note: I've tested VScode but would like assistance confirming the url schemes for other IDE's

      Show
      Preconditions: Note that xdebug can add its own stack trace debugging, if that is on then you do not get the moodle stack traces. xdebug has an equivalent feature to this here: https://2.xdebug.org/docs/stack_trace#file_link_format   Set $CFG->debugdisplay = 1; Temp edit lib/classes/userfeedback.php on line 99 and 'throw new Excption('test') Visit /my/ Confirm you see a stack trace Set $CFG->debugideurlscheme according to the IDE you are using.  Reload /report/upgradelog/index.php Confirm you see a stack trace with linked paths Test some links and Confirm they open in your IDE at the right file and line number (this assumes your code is at the same path, eg apache / nginx running directly on the host OS) Copy the source code files to a second directory which is different to $CFG->dirroot Set $CFG->srcdirroot to match to the new directory Reload the page again, click the links and confirm your IDE is opening the files from the new location Note: I've tested VScode but would like assistance confirming the url schemes for other IDE's

    Description

      Saw a neat demo today which linked stacktraces in web output into your IDE and thought that was be a neat idea and its simple to make work...

      VSCode
      https://janostlund.com/2018-07-12/url-schemes

      Atom
      https://atom.io/packages/open

      Textmate
      https://macromates.com/blog/2007/the-textmate-url-scheme/

       

      Places to update dev docs:

      https://docs.moodle.org/dev/Setting_up_development_environment#IDE

      https://docs.moodle.org/dev/Moodle_IDE and each ide page

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            brendanheywood Brendan Heywood
            Dmitrii Metelkin Dmitrii Metelkin
            Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: