Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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@v4
with:
java-version: 17
java-version: 21
distribution: 'adopt'

- name: Install Python
Expand Down Expand Up @@ -243,7 +243,7 @@ jobs:
# if: matrix.benchmark == false
# uses: actions/setup-java@v4
# with:
# java-version: 17
# java-version: 21
# distribution: 'temurin'
# - name: Install Python
# uses: actions/setup-python@v5
Expand Down
9 changes: 5 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ def Exit( self ):
)$
"""

JDTLS_MILESTONE = '1.40.0'
JDTLS_BUILD_STAMP = '202409261450'
JDTLS_REQUIRED_JAVA_VERSION = 21
JDTLS_MILESTONE = '1.51.0'
JDTLS_BUILD_STAMP = '202510022025'
JDTLS_SHA256 = (
'7416fc62befa450e32f06ec2b503f2eec5f22f0b1cc12f7b8ee5112bf671cf11'
'8a59372117881bf5bdc0220f2254472846b88137c058f344b00a7d41427745a1'
)

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

CheckJavaVersion( 17 )
CheckJavaVersion( JDTLS_REQUIRED_JAVA_VERSION )

TARGET = p.join( DIR_OF_THIRD_PARTY, 'eclipse.jdt.ls', 'target', )
REPOSITORY = p.join( TARGET, 'repository' )
Expand Down
15 changes: 13 additions & 2 deletions ycmd/completers/language_server/language_server_completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,19 @@ def _HandleDynamicRegistrations( self, request ):
for watcher in reg[ 'registerOptions' ][ 'watchers' ]:
# TODO: Take care of watcher kinds. Not everything needs
# to be watched for create, modify *and* delete actions.
pattern = os.path.join( self._project_directory,
watcher[ 'globPattern' ] )

base, pattern = self._project_directory, watcher[ 'globPattern' ]
if isinstance( pattern, dict ):
# RelativePattern
base, pattern = (
watcher[ 'globPattern' ][ 'baseUri' ],
watcher[ 'globPattern' ][ 'pattern' ]
)
if isinstance( base, dict ):
# WorkspaceFolder
base = base[ 'uri' ]

pattern = os.path.join( base, pattern )
if os.path.isdir( pattern ):
pattern = os.path.join( pattern, '**' )
globs.append( pattern )
Expand Down
5 changes: 2 additions & 3 deletions ycmd/tests/java/diagnostics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
PathToTestFile,
SharedYcmd,
StartJavaCompleterServerInDirectory,
StartJavaCompleterServerWithFile,
setUpModule,
tearDownModule )

Expand Down Expand Up @@ -72,7 +73,6 @@ def ProjectPath( *args ):
'Test.java' )

DIAG_MATCHERS_PER_FILE = {
PathToTestFile( DEFAULT_PROJECT_DIR ): empty(),
TestFactory: contains_inanyorder(
has_entries( {
'kind': 'WARNING',
Expand Down Expand Up @@ -321,8 +321,7 @@ def test_FileReadyToParse_Diagnostics_Simple( self, app ):
@WithRetry()
@IsolatedYcmd()
def test_Poll_Diagnostics_ProjectWide_Eclipse( self, app ):
StartJavaCompleterServerInDirectory( app,
PathToTestFile( DEFAULT_PROJECT_DIR ) )
StartJavaCompleterServerWithFile( app, TestFactory )

filepath = TestLauncher
contents = ReadFile( filepath )
Expand Down
51 changes: 5 additions & 46 deletions ycmd/tests/java/subcommands_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def RunFixItTest( app,
result = RunTest( app, test )
if result[ 'fixits' ]:
resolved_fixits[ 'fixits' ].append( result[ 'fixits' ][ 0 ] )
print( 'completer response: ', json.dumps( resolved_fixits ) )
print( 'completer response: ', json.dumps( resolved_fixits, indent = 2 ) )
assert_that( resolved_fixits, fixits_for_line )


Expand Down Expand Up @@ -1266,21 +1266,12 @@ def test_Subcommands_FixIt_SingleDiag_SingleOption_Modify( self, app ):

fixits = has_entries( {
'fixits': contains_inanyorder(
has_entries( {
'text': "Change type of 'test' to 'boolean'",
'kind': 'quickfix',
'chunks': contains_exactly(
ChunkMatcher( 'boolean',
LocationMatcher( filepath, 14, 12 ),
LocationMatcher( filepath, 14, 15 ) ),
),
} ),
has_entries( {
'text': 'Generate toString()',
'kind': 'source.generate.toString',
'chunks': contains_exactly(
ChunkMatcher( '\n\n@Override\npublic String toString() {'
'\n return "TestFactory []";\n}',
ChunkMatcher( '\n\n @Override\n public String toString() {'
'\n return "TestFactory []";\n }',
LocationMatcher( filepath, 32, 4 ),
LocationMatcher( filepath, 32, 4 ) ),
),
Expand All @@ -1294,19 +1285,6 @@ def test_Subcommands_FixIt_SingleDiag_SingleOption_Modify( self, app ):
LocationMatcher( filepath, 3, 1 ) ),
),
} ),
has_entries( {
'text': 'Change modifiers to final where possible',
'kind': 'source.generate.finalModifiers',
'chunks': contains_exactly(
ChunkMatcher(
'final Wibble w ) {\n if ( w == Wibble.CUTHBERT ) {'
'\n }\n }\n\n public AbstractTestWidget getWidget'
'( final String info ) {\n final AbstractTestWidget'
' w = new TestWidgetImpl( info );\n final ',
LocationMatcher( filepath, 18, 24 ),
LocationMatcher( filepath, 25, 5 ) ),
),
} ),
has_entries( {
'text': "Add Javadoc comment"
} ),
Expand Down Expand Up @@ -1465,10 +1443,6 @@ def test_Subcommands_FixIt_MultipleDiags( self, app ):
'text': "Organize imports",
'chunks': instance_of( list ),
} ),
has_entries( {
'text': 'Change modifiers to final where possible',
'chunks': instance_of( list ),
} ),
has_entries( {
'text': "Add Javadoc comment",
'chunks': instance_of( list ),
Expand Down Expand Up @@ -1740,27 +1714,12 @@ def test_Subcommands_FixIt_InvalidURI( self, app ):
LocationMatcher( '', 3, 1 ) ),
),
} ),
has_entries( {
'text': 'Change modifiers to final where possible',
'kind': 'source.generate.finalModifiers',
'chunks': contains_exactly(
ChunkMatcher( "final Wibble w ) {\n "
"if ( w == Wibble.CUTHBERT ) {"
"\n }\n }\n\n public "
"AbstractTestWidget getWidget"
"( final String info ) {\n final "
"AbstractTestWidget w = new TestWidgetImpl( info );"
"\n final ",
LocationMatcher( '', 18, 24 ),
LocationMatcher( '', 25, 5 ) ),
),
} ),
has_entries( {
'text': 'Generate toString()',
'kind': 'source.generate.toString',
'chunks': contains_exactly(
ChunkMatcher( '\n\n@Override\npublic String toString() {'
'\n return "TestFactory []";\n}',
ChunkMatcher( '\n\n @Override\n public String toString() {'
'\n return "TestFactory []";\n }',
LocationMatcher( '', 32, 4 ),
LocationMatcher( '', 32, 4 ) ),
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading