notepad-plus-plus / notepad-plus-plus/notepad-plus-plus
[functions list, Ruby] fix name of class methods defined as self.method
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 29.4k
- Forks
- 5.4k
- PR merge metrics
- No merged PRs in 30d
Description
Description of the Feature
Current behavior
Currently, class methods, defined with self.method, all get self as their function name.
Desired behavior
Instead of self, it would be nice if they get a proper name (in case of a method definition like def self.method: either the actual method name (method) or its definition name (self.method)).
A solution using the definition name can be accomplished by changing the following:
mainExpr="^\s*def\s+\w+"
to
mainExpr="(^\s*def\s+self\.\w+)|(^\s*def\s+\w+)"
<funcNameExpr expr="(?<=def\s)\w+" />
to
<funcNameExpr expr="(((?<=def\s)self.\w+)|((?<=def\s)\w+))" />
mainExpr="^\s*def\s+\w+"
to
mainExpr="(^\s*def\s+self\.\w+)|(^\s*def\s+\w+)"
<nameExpr expr="(?<=def\s)\w+" />
to
<nameExpr expr="(((?<=def\s)self.\w+)|((?<=def\s)\w+))" />
Platform information
Notepad++ v7.1 (32-bit) on Windows 10.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open PowerEditor/src/functionList.xml and inspect the Ruby function-list entries around the referenced lines. Update the matching expressions so definitions using self.method receive the intended name while ordinary methods remain recognized, then verify both forms in the editor's function list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100