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: add support for parsing, inspecting and autocompleting in a sort stage written using Spring Data MongoDB INTELLIJ-174 #123

Merged
merged 6 commits into from
Jan 21, 2025

Conversation

himanshusinghs
Copy link
Contributor

@himanshusinghs himanshusinghs commented Jan 21, 2025

Description

This PR adds support for parsing a sort stage and the commonly used variants / chains / overloads to define a sort stage and sort criteria. To check the list of supported variants please take a look at the covered test cases here.

Checklist

Open Questions

Following overloads are included:
1. .sort(Sort criteria)
2. .sort(Direction direction, String... fields)
@github-actions github-actions bot added the feat label Jan 21, 2025
@github-actions github-actions bot added feat and removed feat labels Jan 21, 2025
Copy link

github-actions bot commented Jan 21, 2025

Coverage Report

Overall Project 79.76% -0.12%
Files changed 94%

File Coverage
SortStageParser.kt 94.37% -5.63%
ProjectStageParser.kt 92.03%
SpringCriteriaDialectParser.kt 88.61%

Copy link

🤖 Benchmark Comparison for feat: add support for AC in sort helpers

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,670,773,996.66 ops/s 2,607,131,215.10 ops/s -2.38%

Copy link

🤖 Benchmark Comparison for Merge remote-tracking branch 'origin/main' into INTELLIJ-174-spring-sort

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,670,773,996.66 ops/s 2,614,624,553.76 ops/s -2.10%

@github-actions github-actions bot added feat and removed feat labels Jan 21, 2025
Copy link

🤖 Benchmark Comparison for chore: added a few more docs

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,670,773,996.66 ops/s 2,622,054,937.19 ops/s -1.82%

@@ -319,10 +320,10 @@ fun Node<PsiElement>.stageN(
if (name != null) {
val stageName = stage!!.component<Named>()
assertNotEquals(null, stageName) {
"Expected a stage with name $name but null found."
"Expected a stage with name $name but null found at index $n."
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

Copy link
Contributor

@kmruiz kmruiz left a comment

Choose a reason for hiding this comment

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

What an amazing work, great job!

@himanshusinghs himanshusinghs merged commit 0c8164e into main Jan 21, 2025
11 checks passed
@himanshusinghs himanshusinghs deleted the INTELLIJ-174-spring-sort branch January 21, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants