Skip to content

Enhance shell support in function List #2318

@mat-m

Description

@mat-m

Description of the Issue

Currently functions are well detected, but some awk scripts are messing with the patterns.

Steps to Reproduce the Issue

  1. Remove .txt extension from attachment test_npp.sh.txt
    , and open it in npp
  2. Check the function list

Expected Behavior

Only the functions are listed.

Actual Behavior

functions are listed, but awk-embedded blocks also are.
npp_function_list

My view

I think some patterns should be stricter
From bash-hackers, grammar looks like:
NAME () <COMPOUND_COMMAND> <REDIRECTIONS>
function NAME () <COMPOUND_COMMAND> <REDIRECTIONS>
function NAME <COMPOUND_COMMAND> <REDIRECTIONS>

So one point is that () should always be empty
another point is that we should exclude from functions NAME the list of reserved keywords like if, while...

Debug Information

Notepad++ v6.9.2
Build time : May 18 2016 - 00:34:05
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Admin mode : ON
Local Conf mode : OFF
OS : Windows 7
Plugins : ComparePlugin.dll mimeTools.dll NppCCompletionPlugin.dll NppConverter.dll NppExport.dll NppFTP.dll nppplugin_ofis2.dll nppplugin_solutionhub.dll nppplugin_solutionhub_ui.dll NppSaveAsAdmin.dll PluginManager.dll QuickOpenPlugin.dll XMLTools.dll

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions