Skip to content

Commit

Permalink
Merge pull request #1655 from puremourning/update-jdtls
Browse files Browse the repository at this point in the history
Update to jdt.ls 1.14.0
  • Loading branch information
mergify[bot] authored Aug 29, 2022
2 parents 2ee4100 + 00179cf commit d3ae555
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
if: matrix.benchmark == false
uses: actions/setup-java@v2
with:
java-version: 11
java-version: 17
distribution: 'adopt'
- name: Install Python
uses: actions/setup-python@v2
Expand Down Expand Up @@ -231,7 +231,7 @@ jobs:
if: matrix.benchmark == false
uses: actions/setup-java@v2
with:
java-version: 11
java-version: 17
distribution: 'adopt'
- name: Install Python
uses: actions/setup-python@v2
Expand Down
2 changes: 1 addition & 1 deletion CORE_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
45
46
8 changes: 4 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ def Exit( self ):
)$
"""

JDTLS_MILESTONE = '1.6.0'
JDTLS_BUILD_STAMP = '202110200520'
JDTLS_MILESTONE = '1.14.0'
JDTLS_BUILD_STAMP = '202207211651'
JDTLS_SHA256 = (
'09650af5c9dc39f0b40981bcdaa2170cbbc5bb003ac90cdb07fbb57381ac47b2'
'4978ee235049ecba9c65b180b69ef982eedd2f79dc4fd1781610f17939ecd159'
)

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

CheckJavaVersion( 11 )
CheckJavaVersion( 17 )

TARGET = p.join( DIR_OF_THIRD_PARTY, 'eclipse.jdt.ls', 'target', )
REPOSITORY = p.join( TARGET, 'repository' )
Expand Down
2 changes: 1 addition & 1 deletion third_party/mrab-regex
Submodule mrab-regex updated from fa9def to bf5e23
2 changes: 1 addition & 1 deletion third_party/watchdog_deps/watchdog
Submodule watchdog updated 44 files
+14 −11 .cirrus.yml
+11 −1 .github/workflows/build-and-publish.yml
+26 −2 .github/workflows/tests.yml
+3 −1 .gitignore
+5 −5 AUTHORS
+27 −27 README.rst
+151 −26 changelog.rst
+1 −1 docs/source/conf.py
+31 −32 docs/source/global.rst.inc
+1 −1 docs/source/hacking.rst
+17 −19 docs/source/installation.rst
+1 −1 docs/source/quickstart.rst
+7 −0 setup.cfg
+3 −2 setup.py
+2 −0 src/watchdog/events.py
+2 −3 src/watchdog/observers/__init__.py
+24 −15 src/watchdog/observers/api.py
+60 −29 src/watchdog/observers/fsevents.py
+5 −5 src/watchdog/observers/fsevents2.py
+4 −7 src/watchdog/observers/inotify.py
+8 −1 src/watchdog/observers/inotify_buffer.py
+4 −35 src/watchdog/observers/inotify_c.py
+6 −8 src/watchdog/observers/kqueue.py
+3 −3 src/watchdog/observers/polling.py
+9 −3 src/watchdog/observers/read_directory_changes.py
+46 −10 src/watchdog/tricks/__init__.py
+1 −1 src/watchdog/utils/bricks.py
+25 −0 src/watchdog/utils/process_watcher.py
+2 −2 src/watchdog/version.py
+353 −261 src/watchdog/watchmedo.py
+21 −9 src/watchdog_fsevents.c
+2 −1 tests/conftest.py
+8 −0 tests/shell.py
+209 −0 tests/test_0_watchmedo.py
+48 −3 tests/test_emitter.py
+162 −6 tests/test_fsevents.py
+40 −3 tests/test_inotify_buffer.py
+61 −52 tests/test_inotify_c.py
+25 −11 tests/test_observer.py
+7 −0 tests/test_regex_matching_event_handler.py
+13 −0 tests/test_skip_repeats_queue.py
+27 −29 tests/test_snapshot_diff.py
+0 −50 tests/test_watchmedo.py
+8 −2 tox.ini
3 changes: 1 addition & 2 deletions ycmd/completers/completer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Must not import ycm_core here! Vim imports completer, which imports this file.
# We don't want ycm_core inside Vim.
from collections import defaultdict
from ycmd.utils import LOGGER, ToUnicode, re, ReadFile, SplitLines
from ycmd.utils import ToUnicode, re, ReadFile, SplitLines


class PreparedTriggers:
Expand Down Expand Up @@ -227,7 +227,6 @@ def GetFileContents( request_data, filename ):
try:
return ToUnicode( ReadFile( filename ) )
except ( OSError, UnicodeError ):
LOGGER.warning( 'Error reading file "%s"', filename )
return ''


Expand Down
3 changes: 2 additions & 1 deletion ycmd/completers/language_server/language_server_completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2023,7 +2023,8 @@ def HandleNotificationInPollThread( self, notification ):
uri = lsp.FilePathToUri( lsp.UriToFilePath( params[ 'uri' ] ) )
except lsp.InvalidUriException:
# Ignore diagnostics for URIs we don't recognise
LOGGER.debug( f'Ignoring diagnostics for unrecognized URI: { uri }' )
LOGGER.debug(
f'Ignoring diagnostics for unrecognized URI: { params[ "uri" ] }' )
return
with self._latest_diagnostics_mutex:
self._latest_diagnostics[ uri ] = params[ 'diagnostics' ]
Expand Down
4 changes: 2 additions & 2 deletions ycmd/tests/java/get_completions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ def test_GetCompletions_MoreThan10ForceSemantic( self, app ):


@WithRetry()
@SharedYcmd
@IsolatedYcmd
def test_GetCompletions_ForceAtTopLevel_NoImport( self, app ):
RunTest( app, {
'description': 'When forcing semantic completion, '
Expand Down Expand Up @@ -845,7 +845,7 @@ def test_GetCompletions_NoForceAtTopLevel_NoImport( self, app ):


@WithRetry()
@SharedYcmd
@IsolatedYcmd
def test_GetCompletions_ForceAtTopLevel_WithImport( self, app ):
filepath = ProjectPath( 'TestWidgetImpl.java' )
RunTest( app, {
Expand Down
103 changes: 78 additions & 25 deletions ycmd/tests/java/subcommands_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
equal_to,
has_entries,
has_entry,
has_items,
instance_of,
is_not,
matches_regexp )
from pprint import pformat
import itertools
import requests
import json
Expand Down Expand Up @@ -107,15 +107,16 @@ def RunTest( app, test, contents = None ):
expect_errors = True
)

print( f'completer response: { pformat( response.json ) }' )

assert_that( response.status_code,
equal_to( test[ 'expect' ][ 'response' ] ) )

assert_that( response.json, test[ 'expect' ][ 'data' ] )
break
except AssertionError:
if time.time() > expiry:
print( 'completer response: '
f'{ json.dumps( response.json, indent=2 ) }' )

raise

time.sleep( 0.25 )
Expand Down Expand Up @@ -1088,6 +1089,10 @@ def test_Subcommands_FixIt_SingleDiag_MultipleOption_Insertion( self, app ):
LocationMatcher( filepath, 25, 5 ) ),
),
} ),
has_entries( {
'kind': 'quickassist',
'text': "Add Javadoc for 'Wimble'"
} ),
)
} )

Expand Down Expand Up @@ -1146,6 +1151,9 @@ def test_Subcommands_FixIt_SingleDiag_SingleOption_Modify( self, app ):
LocationMatcher( filepath, 25, 5 ) ),
),
} ),
has_entries( {
'text': "Add Javadoc for 'getWidget'"
} ),
)
} )

Expand Down Expand Up @@ -1178,21 +1186,42 @@ def test_Subcommands_FixIt_SingleDiag_MultiOption_Delete( self, app ):
# FixIt (and nonetheless, the previous tests ensure that we correctly
# populate the chunks list; the contents all come from jdt.ls)
has_entries( {
'text': "Create getter and setter for 'testString'",
'text': "Organize imports",
'chunks': instance_of( list )
} ),
has_entries( {
'text': "Organize imports",
'text': "Generate Getter and Setter for 'testString'",
'chunks': instance_of( list )
} ),
has_entries( {
'text': "Generate Getters and Setters",
'chunks': instance_of( list )
} ),
has_entries( {
'text': "Generate Getters",
'chunks': instance_of( list )
} ),
has_entries( {
'text': "Generate Setters",
'chunks': instance_of( list )
} ),
has_entries( {
'text': "Generate Getter for 'testString'",
'chunks': instance_of( list )
} ),
has_entries( {
'text': "Generate Setter for 'testString'",
'chunks': instance_of( list )
} ),
has_entries( {
'text': 'Change modifiers to final where possible',
'chunks': instance_of( list )
} ),
has_entries( {
'kind': 'quickassist',
'text': "Add Javadoc for 'testString'",
'chunks': instance_of( list )
} ),
)
} )

Expand Down Expand Up @@ -1271,6 +1300,10 @@ def test_Subcommands_FixIt_MultipleDiags( self, app ):
'text': 'Change modifiers to final where possible',
'chunks': instance_of( list ),
} ),
has_entries( {
'text': "Add Javadoc for 'getWidget'",
'chunks': instance_of( list ),
} ),
]

FIXITS = {
Expand Down Expand Up @@ -1395,6 +1428,10 @@ def test_Subcommands_FixIt_Range( self, app ):
'text': 'Change modifiers to final where possible',
'chunks': instance_of( list ),
} ),
has_entries( {
'text': "Add Javadoc for 'launch'",
'chunks': instance_of( list ),
} ),
)
} )
}
Expand Down Expand Up @@ -1459,10 +1496,19 @@ def test_Subcommands_FixIt_Unicode( self, app ):
'text': 'Change modifiers to final where possible',
'chunks': instance_of( list ),
} ),
has_entries( {
'text': "Generate Getters",
} ),
has_entries( {
'text': "Generate Setters",
} ),
has_entries( {
'text': "Generate Getters and Setters",
'chunks': instance_of( list ),
} ),
has_entries( {
'text': "Add Javadoc for 'DoWhatever'"
} ),
)
} )

Expand Down Expand Up @@ -1524,6 +1570,9 @@ def test_Subcommands_FixIt_InvalidURI( self, app ):
LocationMatcher( '', 32, 4 ) ),
),
} ),
has_entries( {
'text': "Add Javadoc for 'getWidget'"
} ),
)
} )

Expand Down Expand Up @@ -1637,6 +1686,9 @@ def test_Subcommands_Format_WholeFile_Spaces( self, app ):
ChunkMatcher( '\n ',
LocationMatcher( TEST_JAVA, 24, 27 ),
LocationMatcher( TEST_JAVA, 25, 3 ) ),
ChunkMatcher( '\n',
LocationMatcher( TEST_JAVA, 26, 2 ),
LocationMatcher( TEST_JAVA, 28, 1 ) ),
)
} ) )
} )
Expand Down Expand Up @@ -1723,6 +1775,9 @@ def test_Subcommands_Format_WholeFile_Tabs( self, app ):
ChunkMatcher( '\n\t',
LocationMatcher( TEST_JAVA, 24, 27 ),
LocationMatcher( TEST_JAVA, 25, 3 ) ),
ChunkMatcher( '\n',
LocationMatcher( TEST_JAVA, 26, 2 ),
LocationMatcher( TEST_JAVA, 28, 1 ) ),
)
} ) )
} )
Expand Down Expand Up @@ -2116,13 +2171,9 @@ def test_Subcommands_IndexOutOfRange( self, app ):
'filepath': TEST_JAVA,
},
'expect': {
'response': requests.codes.ok,
'data': has_entries( { 'fixits': contains_exactly(
has_entries( { 'text': 'Generate Getters and Setters',
'chunks': instance_of( list ) } ),
has_entries( { 'text': 'Change modifiers to final where possible',
'chunks': instance_of( list ) } ),
) } ),
# THough, now, jdt.ls just throws an Internal error.
'response': requests.codes.internal_server_error,
'data': ErrorMatcher( ResponseFailedException )
}
} )

Expand Down Expand Up @@ -2162,8 +2213,8 @@ def test_Subcommands_DifferentFileTypesUpdate( self, app ):
'description': 'Request error handles the error',
'request': {
'command': 'FixIt',
'line_num': 99,
'column_num': 99,
'line_num': 27,
'column_num': 1,
'filepath': TEST_JAVA,
'file_data': {
'!/bin/sh': {
Expand All @@ -2177,21 +2228,23 @@ def test_Subcommands_DifferentFileTypesUpdate( self, app ):
TESTLAUNCHER_JAVA: {
'filetypes': [ 'some', 'java', 'junk', 'also' ],
'contents': ReadFile( TESTLAUNCHER_JAVA ),
},
'!/usr/bin/sh': {
'filetypes': [ 'java' ],
'contents': '\n',
},
}
}
},
'expect': {
'response': requests.codes.ok,
'data': has_entries( { 'fixits': contains_exactly(
has_entries( { 'text': 'Generate Getters and Setters',
'chunks': instance_of( list ) } ),
has_entries( { 'text': 'Change modifiers to final where possible',
'chunks': instance_of( list ) } ),
) } ),
'data': has_entries(
{
'fixits': has_items(
has_entries( {
'text': 'Generate Getters and Setters',
'chunks': instance_of( list ) } ),
has_entries( {
'text': 'Change modifiers to final where possible',
'chunks': instance_of( list ) } )
)
}
),
}
} )

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ public class TéstClass {
public boolean åtest;
}
}

0 comments on commit d3ae555

Please sign in to comment.