YouCompleteMe icon indicating copy to clipboard operation
YouCompleteMe copied to clipboard

jdt.ls: properly handle URI by showing contents

Open christolis opened this issue 6 months ago • 1 comments

PR Prelude

  • [x] I have read and understood YCM's CONTRIBUTING document.
  • [x] I have read and understood YCM's CODE_OF_CONDUCT document.
  • [x] I have included tests for the changes in my PR. If not, I have included a rationale for why I haven't.
  • [x] I understand my PR may be closed if it becomes obvious I didn't actually perform all of these steps.

Why this change is necessary and useful

This pull request introduces proper handling of jdt:// URIs in YCM when using GoTo commands (e.g., :YcmCompleter GoTo) with the Java Development Tools Language Server (jdt.ls). Previously, these URIs, which are commonly returned by jdt.ls for navigation to class files or members, were not fully supported in YCM, leading to incomplete or incorrect buffer handling.

Building on the recent changes that I have made in the ycmd repository (specifically commit ad64e63b from 2025-07-07, which added support for jumping to jdt:// URIs with GoTo), this change ensures YCM can display the contents of these URIs directly in a temporary Vim buffer without creating or relying on temporary files.

Note! This PR should be merged alongside #1788 on the ycmd repository.

Original Behavior

https://github.com/user-attachments/assets/e3365d18-4522-4cf4-b03c-36b4d3b23787

https://github.com/user-attachments/assets/d2d54db8-e60f-4f5c-a900-788082393dfe


This change is Reviewable

christolis avatar Jul 12 '25 17:07 christolis

Codecov Report

Attention: Patch coverage is 45.00000% with 22 lines in your changes missing coverage. Please review.

Project coverage is 74.88%. Comparing base (05f688c) to head (3502247). Report is 1 commits behind head on master.

:exclamation: There is a different number of reports uploaded between BASE (05f688c) and HEAD (3502247). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (05f688c) HEAD (3502247)
6 2
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #4302       +/-   ##
===========================================
- Coverage   89.88%   74.88%   -15.00%     
===========================================
  Files          37       30        -7     
  Lines        4763     2938     -1825     
===========================================
- Hits         4281     2200     -2081     
- Misses        482      738      +256     
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Jul 14 '25 19:07 codecov[bot]