Method List in Visual Studio Code

前端 未结 17 1827
醉话见心
醉话见心 2021-01-29 19:10

I\'ve recently started using the Visual Studio Code editor. I\'m really loving it, but there\'s one critical feature (for me) that I haven\'t been able to find. Is there a met

相关标签:
17条回答
  • 2021-01-29 19:12
    ctrl+shift+o // This should work for javascript files by default
    

    For PHP install the extension PHP SYMBOLS

    FOR PYTHON install the extension PYTHON

    On Reload, this will work fine

    0 讨论(0)
  • 2021-01-29 19:16

    Update: As stated in the comments by @jeff-xiao this extension is Deprecated and it's now a built in feature of Visual Studio code. It should be available at the bottom of file explorer as "Outline" view.

    Previous text: There is now an Extension that supports this. Code Outline creates a panel in the "Explorer" section and for JavaScript, will list variables and functions in a file. I've been using this for a while now and it scratches the itch I had. Other commenters have mentioned it supports Python and PHP well.

    It still seems to be in development but I haven't had any issues. Development version available on GitHub. If you're the author reading this - thanks!

    This is how it looks:

    If Code Outline is not visible, you can show it by:

    0 讨论(0)
  • 2021-01-29 19:19

    For find method in all files you can press CTRL + P and then start search with #

    example : #signin

    0 讨论(0)
  • 2021-01-29 19:20

    Yes, there is the workbench.action.gotoSymbol command. On Windows and Linux it's set to CTRL+Shift+O by default.

    If this command isn't available for the file types you are working with then you should take a look at the VSCode extensions. Not all languages support this feature.

    0 讨论(0)
  • 2021-01-29 19:21

    Take a look at Show Functions plugin. It can list functions, symbols, bookmarks by configurable regular expressions. Regular expressions are a real saver, expecially when you're not using a mainstream language and when CodeOutline doesn't do the job. It's ugly to see a split window with these functions (CodeOutline seems to be better integrated) but at least there's something to use

    0 讨论(0)
  • 2021-01-29 19:23

    There's no such feature today, the CTRL+SHIFT+O == CTRL+P @ doesn't work for all languages.

    As a last resort you can use the search panel - although it is not so fast an easy to use as you'd like - you can enter this regex in the search panel to find all functions:

    function\s([_A-Za-z0-9]+)\s*\(
    
    0 讨论(0)
提交回复
热议问题