Skip to content

Nodoc implementation details - #265

Merged
schneems merged 1 commit into
ruby:mainfrom
Earlopain:nodoc-stuff
Sep 15, 2026
Merged

schneems merged 1 commit into
ruby:mainfrom
Earlopain:nodoc-stuff

Conversation

@Earlopain

Copy link
Copy Markdown
Collaborator

Just leaves SyntaxSuggest.handle_error and SyntaxSuggest::VERSION visible. Removes some public/private annotations since ony public stuff is now documented.

I occasionally get some syntax-suggest recommendations when searching on https://docs.ruby-lang.org/. They are always irrelevant and not supposed to be used outside of syntax-suggest itself.

[skip changelog]

require_relative "left_right_token_count"

module SyntaxSuggest
class GetParseErrors

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Still around from when ripper was used. Instead of doing nodoc I took the oportunity and just inlined it

Comment thread spec/unit/explain_syntax_spec.rb Outdated

expect(explain.missing).to eq([])
expect(explain.errors).to eq(GetParseErrors.errors(source))
expect(explain.errors).to include(/unexpected 'end'/)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not sure what this test tests anymore, since ripper is now gone.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is asserting that we fallback to the parser error when we couldn't diagnose it via unbalanced tokens i.e. ( missing ).

@Earlopain
Earlopain force-pushed the nodoc-stuff branch 2 times, most recently from bef0ef5 to de76e3b Compare September 15, 2026 17:59
Just leaves `SyntaxSuggest.handle_error` and `SyntaxSuggest::VERSION` visible.

Removes some public/private annotations since ony public stuff is now documented.
@schneems
schneems merged commit 20a947c into ruby:main Sep 15, 2026
24 checks passed
@schneems

Copy link
Copy Markdown
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants