Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently store documentation when reopening #4908

Merged
merged 2 commits into from Aug 31, 2017

Conversation

oprypin
Copy link
Member

@oprypin oprypin commented Aug 31, 2017

Use the documentation comments from the latest definition, but only if it's not empty

For this example Docs generated
# M 1
module M
  # f 1
  def f
  end
end

# M 2
module M
  # f 2
  def f
  end
end

module M
  def f
  end
end
Before After
  • module M
    "M 1"
  • def f
    ""
  • module M
    "M 2"
  • def f
    "f 2"

Use the documentation comments from the latest definition,
but only if it's not empty
@@ -985,6 +981,15 @@ class Crystal::TopLevelVisitor < Crystal::SemanticVisitor
{extern, extern_union, packed}
end

def lookup_existing_type_def(node : ASTNode)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just lookup_type_def?

Copy link
Member

@asterite asterite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Just a small rename suggestion.

@RX14
Copy link
Contributor

RX14 commented Aug 31, 2017

This is a good change, independent of #4906.

@RX14 RX14 merged commit 7daf14b into crystal-lang:master Aug 31, 2017
@RX14 RX14 added this to the Next milestone Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants