Skip to content

server: deduplicate RST definition normalization - #564

Merged
deribaucourt merged 1 commit into
yoctoproject:stagingfrom
gcomneno:refactor-doc-scanner-rst-normalization
Sep 29, 2026
Merged

deribaucourt merged 1 commit into
yoctoproject:stagingfrom
gcomneno:refactor-doc-scanner-rst-normalization

Conversation

@gcomneno

Copy link
Copy Markdown
Collaborator

Summary

Extract the repeated RST definition normalization in BitBakeDocScanner into a local helper.

The helper is reused by:

  • BitBake variable documentation parsing
  • Yocto variable documentation parsing
  • BitBake assignment-operator documentation parsing

This is a behavior-preserving refactoring: it removes three copies of the same normalization pipeline without changing the public API or generalizing the document parsers.

Validation

  • npm run compile
  • npm run jest -- server/src/__tests__/completions.test.ts server/src/__tests__/hover.test.ts — 40/40 passed
  • npm run lint
  • git diff --check

The existing broader TODO about generalizing the parsing functions is intentionally left unchanged; this PR only extracts the duplicated normalization step.

Extract the repeated RST definition normalization into a local helper and
reuse it for BitBake variables, Yocto variables, and assignment operators.

This keeps the parsing behavior unchanged while removing three copies of the
same conversion pipeline.

AI-Generated: OpenAI ChatGPT assisted with the refactoring.
Signed-off-by: Giancarlo Cicellyn Comneno <126195429+gcomneno@users.noreply.github.com>

@deribaucourt deribaucourt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great!

@deribaucourt
deribaucourt merged commit 39ad10b into yoctoproject:staging Sep 29, 2026
5 checks passed
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