Lets say we have a Paket model and this model has members like id, name, password etc..
Let's declare a block:
Paket.new do |pk|
pk. # < I expect autocomplete for the member sof Paket here. Instead none given.
end
However, If I explicitly give param yard doc, then all works:
# @param [Paket]
Paket.new do |pk|
pk.na # < name is given as autocomplete suggestion.
end
The autocomplete suggestions will only be available with a @param tag on the call or a @yieldparam tag on the initialize function. Example:
class Paket
# @yieldparam [self]
def initialize; end
end
Paket.new do |p|
p. # < recognized as a Paket
end
I assume, in your example, Paket is a subclass of ActiveRecord::Base. A more practical solution would be to add an @!override ActiveRecord::Base#initialize to supply the @yieldparam. Unfortunately, @!override doesn't work correctly with initialize methods. I'll work on a fix for it.
Fred, you were right. It is how you said was.
I checked two different projects. It seems I've added yieldparam as you said for the initialize. That's why it is not working on current project because this project seems have older rake task I wrote recent year.
Sorry for the confusion. I will leave this issue open as you said about override issue. Please feel free to close if you think you can track this down on your own.
Gencer.
This is what I have added to other project which works:

Rake task:
data += '' "
# @yieldparam [#{prefix}#{cleaned_table}]
def initialize
yield self if block_given?
end\n\n
" ''
Most helpful comment
The autocomplete suggestions will only be available with a
@paramtag on the call or a@yieldparamtag on theinitializefunction. Example:I assume, in your example,
Paketis a subclass ofActiveRecord::Base. A more practical solution would be to add an@!override ActiveRecord::Base#initializeto supply the@yieldparam. Unfortunately,@!overridedoesn't work correctly withinitializemethods. I'll work on a fix for it.