Skip to content

Commit d3ae555

Browse files
authored
Merge pull request #1655 from puremourning/update-jdtls
Update to jdt.ls 1.14.0
2 parents 2ee4100 + 00179cf commit d3ae555

File tree

10 files changed

+93
-39
lines changed

10 files changed

+93
-39
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
if: matrix.benchmark == false
8282
uses: actions/setup-java@v2
8383
with:
84-
java-version: 11
84+
java-version: 17
8585
distribution: 'adopt'
8686
- name: Install Python
8787
uses: actions/setup-python@v2
@@ -231,7 +231,7 @@ jobs:
231231
if: matrix.benchmark == false
232232
uses: actions/setup-java@v2
233233
with:
234-
java-version: 11
234+
java-version: 17
235235
distribution: 'adopt'
236236
- name: Install Python
237237
uses: actions/setup-python@v2

CORE_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
45
1+
46

build.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ def Exit( self ):
8989
)$
9090
"""
9191

92-
JDTLS_MILESTONE = '1.6.0'
93-
JDTLS_BUILD_STAMP = '202110200520'
92+
JDTLS_MILESTONE = '1.14.0'
93+
JDTLS_BUILD_STAMP = '202207211651'
9494
JDTLS_SHA256 = (
95-
'09650af5c9dc39f0b40981bcdaa2170cbbc5bb003ac90cdb07fbb57381ac47b2'
95+
'4978ee235049ecba9c65b180b69ef982eedd2f79dc4fd1781610f17939ecd159'
9696
)
9797

9898
RUST_TOOLCHAIN = 'nightly-2022-08-17'
@@ -1069,7 +1069,7 @@ def Print( *args, **kwargs ):
10691069
sys.stdout.write( 'Installing jdt.ls for Java support...' )
10701070
sys.stdout.flush()
10711071

1072-
CheckJavaVersion( 11 )
1072+
CheckJavaVersion( 17 )
10731073

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

third_party/mrab-regex

Submodule mrab-regex updated from fa9def5 to bf5e239

ycmd/completers/completer_utils.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Must not import ycm_core here! Vim imports completer, which imports this file.
1919
# We don't want ycm_core inside Vim.
2020
from collections import defaultdict
21-
from ycmd.utils import LOGGER, ToUnicode, re, ReadFile, SplitLines
21+
from ycmd.utils import ToUnicode, re, ReadFile, SplitLines
2222

2323

2424
class PreparedTriggers:
@@ -227,7 +227,6 @@ def GetFileContents( request_data, filename ):
227227
try:
228228
return ToUnicode( ReadFile( filename ) )
229229
except ( OSError, UnicodeError ):
230-
LOGGER.warning( 'Error reading file "%s"', filename )
231230
return ''
232231

233232

ycmd/completers/language_server/language_server_completer.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2023,7 +2023,8 @@ def HandleNotificationInPollThread( self, notification ):
20232023
uri = lsp.FilePathToUri( lsp.UriToFilePath( params[ 'uri' ] ) )
20242024
except lsp.InvalidUriException:
20252025
# Ignore diagnostics for URIs we don't recognise
2026-
LOGGER.debug( f'Ignoring diagnostics for unrecognized URI: { uri }' )
2026+
LOGGER.debug(
2027+
f'Ignoring diagnostics for unrecognized URI: { params[ "uri" ] }' )
20272028
return
20282029
with self._latest_diagnostics_mutex:
20292030
self._latest_diagnostics[ uri ] = params[ 'diagnostics' ]

ycmd/tests/java/get_completions_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ def test_GetCompletions_MoreThan10ForceSemantic( self, app ):
791791

792792

793793
@WithRetry()
794-
@SharedYcmd
794+
@IsolatedYcmd
795795
def test_GetCompletions_ForceAtTopLevel_NoImport( self, app ):
796796
RunTest( app, {
797797
'description': 'When forcing semantic completion, '
@@ -845,7 +845,7 @@ def test_GetCompletions_NoForceAtTopLevel_NoImport( self, app ):
845845

846846

847847
@WithRetry()
848-
@SharedYcmd
848+
@IsolatedYcmd
849849
def test_GetCompletions_ForceAtTopLevel_WithImport( self, app ):
850850
filepath = ProjectPath( 'TestWidgetImpl.java' )
851851
RunTest( app, {

ycmd/tests/java/subcommands_test.py

+78-25
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
equal_to,
2424
has_entries,
2525
has_entry,
26+
has_items,
2627
instance_of,
2728
is_not,
2829
matches_regexp )
29-
from pprint import pformat
3030
import itertools
3131
import requests
3232
import json
@@ -107,15 +107,16 @@ def RunTest( app, test, contents = None ):
107107
expect_errors = True
108108
)
109109

110-
print( f'completer response: { pformat( response.json ) }' )
111-
112110
assert_that( response.status_code,
113111
equal_to( test[ 'expect' ][ 'response' ] ) )
114112

115113
assert_that( response.json, test[ 'expect' ][ 'data' ] )
116114
break
117115
except AssertionError:
118116
if time.time() > expiry:
117+
print( 'completer response: '
118+
f'{ json.dumps( response.json, indent=2 ) }' )
119+
119120
raise
120121

121122
time.sleep( 0.25 )
@@ -1088,6 +1089,10 @@ def test_Subcommands_FixIt_SingleDiag_MultipleOption_Insertion( self, app ):
10881089
LocationMatcher( filepath, 25, 5 ) ),
10891090
),
10901091
} ),
1092+
has_entries( {
1093+
'kind': 'quickassist',
1094+
'text': "Add Javadoc for 'Wimble'"
1095+
} ),
10911096
)
10921097
} )
10931098

@@ -1146,6 +1151,9 @@ def test_Subcommands_FixIt_SingleDiag_SingleOption_Modify( self, app ):
11461151
LocationMatcher( filepath, 25, 5 ) ),
11471152
),
11481153
} ),
1154+
has_entries( {
1155+
'text': "Add Javadoc for 'getWidget'"
1156+
} ),
11491157
)
11501158
} )
11511159

@@ -1178,21 +1186,42 @@ def test_Subcommands_FixIt_SingleDiag_MultiOption_Delete( self, app ):
11781186
# FixIt (and nonetheless, the previous tests ensure that we correctly
11791187
# populate the chunks list; the contents all come from jdt.ls)
11801188
has_entries( {
1181-
'text': "Create getter and setter for 'testString'",
1189+
'text': "Organize imports",
11821190
'chunks': instance_of( list )
11831191
} ),
11841192
has_entries( {
1185-
'text': "Organize imports",
1193+
'text': "Generate Getter and Setter for 'testString'",
11861194
'chunks': instance_of( list )
11871195
} ),
11881196
has_entries( {
11891197
'text': "Generate Getters and Setters",
11901198
'chunks': instance_of( list )
11911199
} ),
1200+
has_entries( {
1201+
'text': "Generate Getters",
1202+
'chunks': instance_of( list )
1203+
} ),
1204+
has_entries( {
1205+
'text': "Generate Setters",
1206+
'chunks': instance_of( list )
1207+
} ),
1208+
has_entries( {
1209+
'text': "Generate Getter for 'testString'",
1210+
'chunks': instance_of( list )
1211+
} ),
1212+
has_entries( {
1213+
'text': "Generate Setter for 'testString'",
1214+
'chunks': instance_of( list )
1215+
} ),
11921216
has_entries( {
11931217
'text': 'Change modifiers to final where possible',
11941218
'chunks': instance_of( list )
11951219
} ),
1220+
has_entries( {
1221+
'kind': 'quickassist',
1222+
'text': "Add Javadoc for 'testString'",
1223+
'chunks': instance_of( list )
1224+
} ),
11961225
)
11971226
} )
11981227

@@ -1271,6 +1300,10 @@ def test_Subcommands_FixIt_MultipleDiags( self, app ):
12711300
'text': 'Change modifiers to final where possible',
12721301
'chunks': instance_of( list ),
12731302
} ),
1303+
has_entries( {
1304+
'text': "Add Javadoc for 'getWidget'",
1305+
'chunks': instance_of( list ),
1306+
} ),
12741307
]
12751308

12761309
FIXITS = {
@@ -1395,6 +1428,10 @@ def test_Subcommands_FixIt_Range( self, app ):
13951428
'text': 'Change modifiers to final where possible',
13961429
'chunks': instance_of( list ),
13971430
} ),
1431+
has_entries( {
1432+
'text': "Add Javadoc for 'launch'",
1433+
'chunks': instance_of( list ),
1434+
} ),
13981435
)
13991436
} )
14001437
}
@@ -1459,10 +1496,19 @@ def test_Subcommands_FixIt_Unicode( self, app ):
14591496
'text': 'Change modifiers to final where possible',
14601497
'chunks': instance_of( list ),
14611498
} ),
1499+
has_entries( {
1500+
'text': "Generate Getters",
1501+
} ),
1502+
has_entries( {
1503+
'text': "Generate Setters",
1504+
} ),
14621505
has_entries( {
14631506
'text': "Generate Getters and Setters",
14641507
'chunks': instance_of( list ),
14651508
} ),
1509+
has_entries( {
1510+
'text': "Add Javadoc for 'DoWhatever'"
1511+
} ),
14661512
)
14671513
} )
14681514

@@ -1524,6 +1570,9 @@ def test_Subcommands_FixIt_InvalidURI( self, app ):
15241570
LocationMatcher( '', 32, 4 ) ),
15251571
),
15261572
} ),
1573+
has_entries( {
1574+
'text': "Add Javadoc for 'getWidget'"
1575+
} ),
15271576
)
15281577
} )
15291578

@@ -1637,6 +1686,9 @@ def test_Subcommands_Format_WholeFile_Spaces( self, app ):
16371686
ChunkMatcher( '\n ',
16381687
LocationMatcher( TEST_JAVA, 24, 27 ),
16391688
LocationMatcher( TEST_JAVA, 25, 3 ) ),
1689+
ChunkMatcher( '\n',
1690+
LocationMatcher( TEST_JAVA, 26, 2 ),
1691+
LocationMatcher( TEST_JAVA, 28, 1 ) ),
16401692
)
16411693
} ) )
16421694
} )
@@ -1723,6 +1775,9 @@ def test_Subcommands_Format_WholeFile_Tabs( self, app ):
17231775
ChunkMatcher( '\n\t',
17241776
LocationMatcher( TEST_JAVA, 24, 27 ),
17251777
LocationMatcher( TEST_JAVA, 25, 3 ) ),
1778+
ChunkMatcher( '\n',
1779+
LocationMatcher( TEST_JAVA, 26, 2 ),
1780+
LocationMatcher( TEST_JAVA, 28, 1 ) ),
17261781
)
17271782
} ) )
17281783
} )
@@ -2116,13 +2171,9 @@ def test_Subcommands_IndexOutOfRange( self, app ):
21162171
'filepath': TEST_JAVA,
21172172
},
21182173
'expect': {
2119-
'response': requests.codes.ok,
2120-
'data': has_entries( { 'fixits': contains_exactly(
2121-
has_entries( { 'text': 'Generate Getters and Setters',
2122-
'chunks': instance_of( list ) } ),
2123-
has_entries( { 'text': 'Change modifiers to final where possible',
2124-
'chunks': instance_of( list ) } ),
2125-
) } ),
2174+
# THough, now, jdt.ls just throws an Internal error.
2175+
'response': requests.codes.internal_server_error,
2176+
'data': ErrorMatcher( ResponseFailedException )
21262177
}
21272178
} )
21282179

@@ -2162,8 +2213,8 @@ def test_Subcommands_DifferentFileTypesUpdate( self, app ):
21622213
'description': 'Request error handles the error',
21632214
'request': {
21642215
'command': 'FixIt',
2165-
'line_num': 99,
2166-
'column_num': 99,
2216+
'line_num': 27,
2217+
'column_num': 1,
21672218
'filepath': TEST_JAVA,
21682219
'file_data': {
21692220
'!/bin/sh': {
@@ -2177,21 +2228,23 @@ def test_Subcommands_DifferentFileTypesUpdate( self, app ):
21772228
TESTLAUNCHER_JAVA: {
21782229
'filetypes': [ 'some', 'java', 'junk', 'also' ],
21792230
'contents': ReadFile( TESTLAUNCHER_JAVA ),
2180-
},
2181-
'!/usr/bin/sh': {
2182-
'filetypes': [ 'java' ],
2183-
'contents': '\n',
2184-
},
2231+
}
21852232
}
21862233
},
21872234
'expect': {
21882235
'response': requests.codes.ok,
2189-
'data': has_entries( { 'fixits': contains_exactly(
2190-
has_entries( { 'text': 'Generate Getters and Setters',
2191-
'chunks': instance_of( list ) } ),
2192-
has_entries( { 'text': 'Change modifiers to final where possible',
2193-
'chunks': instance_of( list ) } ),
2194-
) } ),
2236+
'data': has_entries(
2237+
{
2238+
'fixits': has_items(
2239+
has_entries( {
2240+
'text': 'Generate Getters and Setters',
2241+
'chunks': instance_of( list ) } ),
2242+
has_entries( {
2243+
'text': 'Change modifiers to final where possible',
2244+
'chunks': instance_of( list ) } )
2245+
)
2246+
}
2247+
),
21952248
}
21962249
} )
21972250

ycmd/tests/java/testdata/simple_eclipse_project/src/com/youcompleteme/Test.java

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ public class TéstClass {
2424
public boolean åtest;
2525
}
2626
}
27+

0 commit comments

Comments
 (0)