Methods aren't parsed as syntactic elements #206
Description
Description
The names of many class methods and instance methods aren't parsed as syntactic elements where they are invoked, and so can't be given their own colours.
Steps to Reproduce
- Create the following Ruby code in Atom editor:
class MyClass
def self.class_method
puts 'Class'
end
def inst_method(i)
puts i
end
end
MyClass.class_method
an_instance = MyClass.new
an_instance.inst_method(99)
'abc'.length
- Open Atom's dev tools and inspect the HTML that displays the code, especially for the line
an_instance.inst_method(99)
:
<span class="syntax--source syntax--ruby">
<span class="invisible-character leading-whitespace indent-guide">····</span>
an_instance
<span class="syntax--punctuation syntax--separator syntax--method syntax--ruby">.</span>
inst_method
<span class="syntax--punctuation syntax--section syntax--function syntax--ruby">(</span>
<span class="syntax--constant syntax--numeric syntax--ruby">99</span>
<span class="syntax--punctuation syntax--section syntax--function syntax--ruby">)</span>
<span class="invisible-character eol">¤¬</span>
</span>
Expected behavior:
The names of all methods being invoked should have HTML <span>
elements with syntax--
classes indicating what they are.
Actual behavior:
The method names are bare text in the enclosing <span class="syntax--source syntax--ruby">
so cannot be distinguished from other Ruby source code.
Reproduces how often:
Every time, for all types of method invocation tested, for all methods apart from new
and some other built in ones.
e.g. string.chomp
=> <span class="syntax--support syntax--function syntax--kernel syntax--ruby">chomp</span>
but string.length
=> bare text length
Versions
Atom : 1.18.0
Electron: 1.3.15
Chrome : 52.0.2743.82
Node : 6.5.0
apm 1.18.1
npm 3.10.10
node 6.9.5 x64
python
git
visual studio
language-ruby : 0.71.0
Windows 7 Pro x64
Additional Information
It doesn't parse the method names correctly even though it parses the .
s that precedes them as method separators and any parentheses that follow them as function separators.