Bug 480756 - Symbols viewer fails to list many Ruby functions
Summary: Symbols viewer fails to list many Ruby functions
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: part (other bugs)
Version First Reported In: 22.12.3
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-03 00:40 UTC by dtrusty
Modified: 2024-05-16 19:24 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dtrusty 2024-02-03 00:40:23 UTC
SUMMARY
Symbols viewer misses Ruby functions without parenthesis in their definition line.

STEPS TO REPRODUCE
In Ruby, function definitions don't require parenthesis.  The symbol viewer omits these function names.
For example, 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Gtest

  def initialize()
  end

  def test2(p1, p2)
  end

  def no_paren_function
    puts 'aaaaa'
  end

end
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The symbol viewer will show 'initialize' and 'test2' but not 'no_paren_function'.

OBSERVED RESULT
The  'no_paren_function' will not be shown in the Symbols pane.

EXPECTED RESULT
The  'no_paren_function' should be shown in the Symbols pane.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: OpenSUSE 15.5 
(available in About System)
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
In previous versions of Kate, the symbol viewer worked correctly for this case.
Comment 1 dtrusty 2024-02-03 02:12:11 UTC
Also, function/method names ending in a question mark are not shown in the Symbols list.

And class-level method names (which contain a dot) are also not shown in the Symbols list.
Comment 2 Waqar Ahmed 2024-05-16 19:24:49 UTC
Git commit 8008e395c314f2bdf6b07b26f060a1d81920c5dc by Waqar Ahmed.
Committed on 16/05/2024 at 18:08.
Pushed by cullmann into branch 'master'.

Fix ruby method parsing and nested classes parsing

support
 - self.function
 - nested classes
 - functions with parens

M  +2    -2    addons/symbolviewer/ruby_parser.cpp
M  +9    -0    addons/symbolviewer/samples/testfile.rb

https://invent.kde.org/utilities/kate/-/commit/8008e395c314f2bdf6b07b26f060a1d81920c5dc