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

feat(semantic/jsdoc): Add Span for JSDoc, JSDocTag #2815

Merged
merged 17 commits into from
Mar 26, 2024
Merged

feat(semantic/jsdoc): Add Span for JSDoc, JSDocTag #2815

merged 17 commits into from
Mar 26, 2024

Conversation

leaysgur
Copy link
Contributor

@leaysgur leaysgur commented Mar 26, 2024

  • Refactor comment trimming
  • Pass comment span to JSDoc
  • BTreeMap<tag.span, JSDocTag>
  • Consider kind_span => Use tag.kind span instead of tag.span
  • Wait upstream CI issue resolved?

@github-actions github-actions bot added the A-semantic Area - Semantic label Mar 26, 2024
@leaysgur
Copy link
Contributor Author

leaysgur commented Mar 26, 2024

Consider kind_span

In this case:

/**
 * @kind1 bar
 * baz...
 * @kind2
 */

tag.span for @kind1 is @kind1 bar\n * baz...\n * , for @kind2 is @kind2\n .

It is too verbose and may not fit for diagnostic span.

So,

  • introduce kind_span as props?
  • Via helper?
    • kind_span.end = kind_span.start + 1 + u32::try_from(tag.kind.len()).unwrap_or_default();
  • Use kind_span instead of tag.span as default?

👉🏻 Use kind_span instead of tag.span as default.

@leaysgur leaysgur marked this pull request as ready for review March 26, 2024 08:38
Copy link

codspeed-hq bot commented Mar 26, 2024

CodSpeed Performance Report

Merging #2815 will not alter performance

Comparing jsdoc_span (9ebfd83) with main (56493bd)

Summary

✅ 34 untouched benchmarks

@Boshen Boshen merged commit df744b2 into main Mar 26, 2024
31 checks passed
@Boshen Boshen deleted the jsdoc_span branch March 26, 2024 10:40
Boshen pushed a commit that referenced this pull request Apr 4, 2024
Part of #1170, Finally... 🗻 

Some preparation PRs may be needed in advance.

- [x] settings.jsdoc #2706 
- [x] new struct design #2765
- [x] handle `Span` for diagnostics #2815

Implement plugin itself.

-
https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-access.md
-
https://github.com/gajus/eslint-plugin-jsdoc/blob/main/src/rules/checkAccess.js

I'll send a PR to make this plugin public after confirming that a few
more rules can be implemented without any problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-semantic Area - Semantic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants