Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#205 Ruby Syntax

open
None
5
2007-12-16
2007-11-29
Daniel
No

I reported this first to the developers of Geany, but they said they use ctags for this, so I'll just repeat the bug as I reported it to them.

Examples:

Ruby code:
class RootLevelClass
class EmbeddedClass1
end
end
module RootLevelModule
def module_method
end
class EmbeddedClass2
class EmbeddedSubClass < RootLevelClass::EmbeddedClass1
CLASS_CONSTANT_1='We\'re constants'
Class_Constant_2=:because_we_start_with_a_capital_letter
i="am just a variable, don't mind me"
def self.class_method_1
end
def EmbeddedSubClass.class_method_2
end
def instance_method_1
end
end
def EmbeddedSubClass.class_method_3
end
end
end
obj=RootLevelModule::EmbeddedClass2::EmbeddedSubClass.new
def obj.instance_method_2
end
class RootLevelModule::EmbeddedClass3
end

produces:
Classes
RootLevelClass
RootLevelClass.EmbeddedClass1
RootLevelModule.EmbeddedClass2
RootLevelModule.EmbeddedClass2.EmbeddedSubClass
Methods
RootLevelModule.EmbeddedClass2.EmbeddedSubClass.instance_method_1
RootLevelModule.module_method

This is incorrect syntax.
Correct result:
Modules
RootLevelModule
Classes
RootLevelClass
RootLevelClass::EmbeddedClass1
RootLevelModule::EmbeddedClass2
RootLevelModule::EmbeddedClass2::EmbeddedSubClass
RootLevelModule::EmbeddedClass3
Methods
RootLevelModule.module_method
RootLevelModule::EmbeddedClass2::EmbeddedSubClass.class_method_1
RootLevelModule::EmbeddedClass2::EmbeddedSubClass.class_method_2
RootLevelModule::EmbeddedClass2::EmbeddedSubClass#instance_method_1
RootLevelModule::EmbeddedClass2::EmbeddedSubClass.class_method_3
obj.instance_method_2

Discussion

  • Elliott Hughes
    Elliott Hughes
    2007-12-16

    • assigned_to: nobody --> elliotth