Skip to content

Commit f10a370

Browse files
committed
Update jdt to 1.51.0
1 parent 7895484 commit f10a370

File tree

6 files changed

+28
-58
lines changed

6 files changed

+28
-58
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
if: matrix.benchmark == false
8282
uses: actions/setup-java@v4
8383
with:
84-
java-version: 17
84+
java-version: 21
8585
distribution: 'adopt'
8686

8787
- name: Install Python
@@ -243,7 +243,7 @@ jobs:
243243
# if: matrix.benchmark == false
244244
# uses: actions/setup-java@v4
245245
# with:
246-
# java-version: 17
246+
# java-version: 21
247247
# distribution: 'temurin'
248248
# - name: Install Python
249249
# uses: actions/setup-python@v5

build.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ def Exit( self ):
8989
)$
9090
"""
9191

92-
JDTLS_MILESTONE = '1.40.0'
93-
JDTLS_BUILD_STAMP = '202409261450'
92+
JDTLS_REQUIRED_JAVA_VERSION = 21
93+
JDTLS_MILESTONE = '1.51.0'
94+
JDTLS_BUILD_STAMP = '202510022025'
9495
JDTLS_SHA256 = (
95-
'7416fc62befa450e32f06ec2b503f2eec5f22f0b1cc12f7b8ee5112bf671cf11'
96+
'8a59372117881bf5bdc0220f2254472846b88137c058f344b00a7d41427745a1'
9697
)
9798

9899
DEFAULT_RUST_TOOLCHAIN = 'stable'
@@ -1110,7 +1111,7 @@ def Print( *args, **kwargs ):
11101111
sys.stdout.write( 'Installing jdt.ls for Java support...' )
11111112
sys.stdout.flush()
11121113

1113-
CheckJavaVersion( 17 )
1114+
CheckJavaVersion( JDTLS_REQUIRED_JAVA_VERSION )
11141115

11151116
TARGET = p.join( DIR_OF_THIRD_PARTY, 'eclipse.jdt.ls', 'target', )
11161117
REPOSITORY = p.join( TARGET, 'repository' )

ycmd/completers/language_server/language_server_completer.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,19 @@ def _HandleDynamicRegistrations( self, request ):
586586
for watcher in reg[ 'registerOptions' ][ 'watchers' ]:
587587
# TODO: Take care of watcher kinds. Not everything needs
588588
# to be watched for create, modify *and* delete actions.
589-
pattern = os.path.join( self._project_directory,
590-
watcher[ 'globPattern' ] )
589+
590+
base, pattern = self._project_directory, watcher[ 'globPattern' ]
591+
if isinstance( pattern, dict ):
592+
# RelativePattern
593+
base, pattern = (
594+
watcher[ 'globPattern' ][ 'baseUri' ],
595+
watcher[ 'globPattern' ][ 'pattern' ]
596+
)
597+
if isinstance( base, dict ):
598+
# WorkspaceFolder
599+
base = base[ 'uri' ]
600+
601+
pattern = os.path.join( base, pattern )
591602
if os.path.isdir( pattern ):
592603
pattern = os.path.join( pattern, '**' )
593604
globs.append( pattern )

ycmd/tests/java/diagnostics_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
PathToTestFile,
3535
SharedYcmd,
3636
StartJavaCompleterServerInDirectory,
37+
StartJavaCompleterServerWithFile,
3738
setUpModule,
3839
tearDownModule )
3940

@@ -72,7 +73,6 @@ def ProjectPath( *args ):
7273
'Test.java' )
7374

7475
DIAG_MATCHERS_PER_FILE = {
75-
PathToTestFile( DEFAULT_PROJECT_DIR ): empty(),
7676
TestFactory: contains_inanyorder(
7777
has_entries( {
7878
'kind': 'WARNING',
@@ -321,8 +321,7 @@ def test_FileReadyToParse_Diagnostics_Simple( self, app ):
321321
@WithRetry()
322322
@IsolatedYcmd()
323323
def test_Poll_Diagnostics_ProjectWide_Eclipse( self, app ):
324-
StartJavaCompleterServerInDirectory( app,
325-
PathToTestFile( DEFAULT_PROJECT_DIR ) )
324+
StartJavaCompleterServerWithFile( app, TestFactory )
326325

327326
filepath = TestLauncher
328327
contents = ReadFile( filepath )

ycmd/tests/java/subcommands_test.py

Lines changed: 5 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def RunFixItTest( app,
184184
result = RunTest( app, test )
185185
if result[ 'fixits' ]:
186186
resolved_fixits[ 'fixits' ].append( result[ 'fixits' ][ 0 ] )
187-
print( 'completer response: ', json.dumps( resolved_fixits ) )
187+
print( 'completer response: ', json.dumps( resolved_fixits, indent = 2 ) )
188188
assert_that( resolved_fixits, fixits_for_line )
189189

190190

@@ -1266,21 +1266,12 @@ def test_Subcommands_FixIt_SingleDiag_SingleOption_Modify( self, app ):
12661266

12671267
fixits = has_entries( {
12681268
'fixits': contains_inanyorder(
1269-
has_entries( {
1270-
'text': "Change type of 'test' to 'boolean'",
1271-
'kind': 'quickfix',
1272-
'chunks': contains_exactly(
1273-
ChunkMatcher( 'boolean',
1274-
LocationMatcher( filepath, 14, 12 ),
1275-
LocationMatcher( filepath, 14, 15 ) ),
1276-
),
1277-
} ),
12781269
has_entries( {
12791270
'text': 'Generate toString()',
12801271
'kind': 'source.generate.toString',
12811272
'chunks': contains_exactly(
1282-
ChunkMatcher( '\n\n@Override\npublic String toString() {'
1283-
'\n return "TestFactory []";\n}',
1273+
ChunkMatcher( '\n\n @Override\n public String toString() {'
1274+
'\n return "TestFactory []";\n }',
12841275
LocationMatcher( filepath, 32, 4 ),
12851276
LocationMatcher( filepath, 32, 4 ) ),
12861277
),
@@ -1294,19 +1285,6 @@ def test_Subcommands_FixIt_SingleDiag_SingleOption_Modify( self, app ):
12941285
LocationMatcher( filepath, 3, 1 ) ),
12951286
),
12961287
} ),
1297-
has_entries( {
1298-
'text': 'Change modifiers to final where possible',
1299-
'kind': 'source.generate.finalModifiers',
1300-
'chunks': contains_exactly(
1301-
ChunkMatcher(
1302-
'final Wibble w ) {\n if ( w == Wibble.CUTHBERT ) {'
1303-
'\n }\n }\n\n public AbstractTestWidget getWidget'
1304-
'( final String info ) {\n final AbstractTestWidget'
1305-
' w = new TestWidgetImpl( info );\n final ',
1306-
LocationMatcher( filepath, 18, 24 ),
1307-
LocationMatcher( filepath, 25, 5 ) ),
1308-
),
1309-
} ),
13101288
has_entries( {
13111289
'text': "Add Javadoc comment"
13121290
} ),
@@ -1465,10 +1443,6 @@ def test_Subcommands_FixIt_MultipleDiags( self, app ):
14651443
'text': "Organize imports",
14661444
'chunks': instance_of( list ),
14671445
} ),
1468-
has_entries( {
1469-
'text': 'Change modifiers to final where possible',
1470-
'chunks': instance_of( list ),
1471-
} ),
14721446
has_entries( {
14731447
'text': "Add Javadoc comment",
14741448
'chunks': instance_of( list ),
@@ -1740,27 +1714,12 @@ def test_Subcommands_FixIt_InvalidURI( self, app ):
17401714
LocationMatcher( '', 3, 1 ) ),
17411715
),
17421716
} ),
1743-
has_entries( {
1744-
'text': 'Change modifiers to final where possible',
1745-
'kind': 'source.generate.finalModifiers',
1746-
'chunks': contains_exactly(
1747-
ChunkMatcher( "final Wibble w ) {\n "
1748-
"if ( w == Wibble.CUTHBERT ) {"
1749-
"\n }\n }\n\n public "
1750-
"AbstractTestWidget getWidget"
1751-
"( final String info ) {\n final "
1752-
"AbstractTestWidget w = new TestWidgetImpl( info );"
1753-
"\n final ",
1754-
LocationMatcher( '', 18, 24 ),
1755-
LocationMatcher( '', 25, 5 ) ),
1756-
),
1757-
} ),
17581717
has_entries( {
17591718
'text': 'Generate toString()',
17601719
'kind': 'source.generate.toString',
17611720
'chunks': contains_exactly(
1762-
ChunkMatcher( '\n\n@Override\npublic String toString() {'
1763-
'\n return "TestFactory []";\n}',
1721+
ChunkMatcher( '\n\n @Override\n public String toString() {'
1722+
'\n return "TestFactory []";\n }',
17641723
LocationMatcher( '', 32, 4 ),
17651724
LocationMatcher( '', 32, 4 ) ),
17661725
),

ycmd/tests/java/testdata/gradle-init/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)