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

Improved the order of completions provided for resource access paths #41663

Merged
merged 4 commits into from
Nov 24, 2023

Conversation

nipunayf
Copy link
Contributor

@nipunayf nipunayf commented Nov 8, 2023

Purpose

When multiple resource access methods share the same sortText, the VS Code plugin sorts them alphabetically, thus dividing completions with named and computed resource segments into two sets. This arrangement reduces the developer experience, with computed resource segments moved to the bottom.

Fixes #41636

Approach

The current approach assigns a unique sortText to each completion item based on the position generated by the LS, ensuring that the order is not disrupted by the VS Code plugin.

Samples

Grouped completions with both named resource segments and computed resource segments are now as shown below.

image

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

@nipunayf nipunayf requested a review from mohanvive as a code owner November 8, 2023 04:47
@nipunayf nipunayf added the Team/LanguageServer Language Server Implementation related issues. #Compiler label Nov 8, 2023
@nipunayf nipunayf force-pushed the fix-path-resource branch 3 times, most recently from 892e9a2 to b88e2eb Compare November 20, 2023 11:32
Copy link

codecov bot commented Nov 20, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (a33bee3) 76.70% compared to head (09e995d) 76.73%.
Report is 8 commits behind head on master.

Files Patch % Lines
...oviders/context/InvocationNodeContextProvider.java 94.11% 1 Missing and 1 partial ⚠️
...ompletions/builder/ResourcePathCompletionUtil.java 50.00% 0 Missing and 1 partial ⚠️
...context/ClientResourceAccessActionNodeContext.java 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #41663      +/-   ##
============================================
+ Coverage     76.70%   76.73%   +0.03%     
- Complexity    52716    52724       +8     
============================================
  Files          2878     2878              
  Lines        198708   198735      +27     
  Branches      25825    25832       +7     
============================================
+ Hits         152410   152501      +91     
+ Misses        37882    37804      -78     
- Partials       8416     8430      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KavinduZoysa KavinduZoysa merged commit 75f1758 into ballerina-platform:master Nov 24, 2023
17 checks passed
@nipunayf nipunayf added this to the 2201.9.0 milestone Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/LanguageServer Language Server Implementation related issues. #Compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement]: Revamp the completions provided for resource access methods
2 participants