There are scenarios where addons might need to have access to comments that are close to nodes they are interested in.
For example, for RBS inline annotations, an addon could provide completion, go to definition, hover and semantic highlighting. But currently, the listeners cannot receive any comments content, because the comments are separate from the AST in Prism's parse result.
I believe the easiest way to provide this functionality to listeners might be to create a custom dispatcher that stores the comment information and passes that along to listeners in a way that allows them to easily access it.
Scenario: imagine proper highlighting and the ability to navigate through constants in these inline RBS annotations.
class Foo
attr_reader :name # ::String
# :: (String, Integer?) -> void
def bar(a, b)
end
end
There are scenarios where addons might need to have access to comments that are close to nodes they are interested in.
For example, for RBS inline annotations, an addon could provide completion, go to definition, hover and semantic highlighting. But currently, the listeners cannot receive any comments content, because the comments are separate from the AST in Prism's parse result.
I believe the easiest way to provide this functionality to listeners might be to create a custom dispatcher that stores the comment information and passes that along to listeners in a way that allows them to easily access it.
Scenario: imagine proper highlighting and the ability to navigate through constants in these inline RBS annotations.