Skip to content

Instantly share code, notes, and snippets.

@D0zee
Created August 24, 2023 12:37
Show Gist options
  • Save D0zee/90b63a9cfd2edb7a039f111e2406f5b8 to your computer and use it in GitHub Desktop.
Save D0zee/90b63a9cfd2edb7a039f111e2406f5b8 to your computer and use it in GitHub Desktop.
Google Summer of Code, Kotlin Foundation

Project Purposes

  • Add Kotlin DSL support to the Eclipse IDE.
  • Improve the user experience of using Eclipse for Java/Kotlin projects.
  • Save users from needing to use multiple IDEs during development.

What Has Been Done

  • Added support for gradle.properties files inside the Eclipse IDE.

    • This was an onboarding task to become familiar with the development of Eclipse plugins, learn the principles of the Language Server Protocol in practice, and write a language server from scratch.
    • Added: syntax highlighting, content assist for static Gradle properties, and diagnostic reports.
  • UI test for a new plugin

    • The test was written over several days, and a Pull Request was created. However, the test did not work correctly when run through the console. Later, the mentor informed me about the reason why the test behaved incorrectly through the console. After that, they remade the Pull Request, creating another PR. I reviewed it, approved it, and this test was published.
  • Syntax highlighting for KTS files.

  • Kotlin DSL (KTS) Language Server

    • I found the kotlin-language-server, where the developer wrote that their plugin works with Kotlin DSL files. I decided to connect this plugin to Eclipse, set up tooling, and everything would be good. However, during the connection stage, I found out that this language server doesn't work correctly with KTS files.
    • Created a fork and work started within it.
    • Added the following features to the Eclipse IDE: content assist, go-to-definition, signature help, hover, and diagnostic reports.
  • Eclipse Plugin for KTS files.

About the KTS Language Server

  • The compilation system for Kotlin build scripts has been completely redesigned. This took a lot of time because the server initially broke on almost every .gradle.kts file.
  • Custom scripts for determining project dependencies have been replaced with Gradle tooling API calls.
  • If the user encounters a build configuration error, the server no longer crashes as it did before but displays an error with a readable description of the problem.
  • Many improvements connected with Gradle API calls.

Current State

Both plugins have been published and can now be used by Eclipse end users by installing them as options. The only task remaining is to maintain and improve the performance of the Kotlin DSL plugin.

Important Lessons I Learned

If you're unable to make progress for an extended period, consider seeking help from knowledgeable individuals instead of repeatedly trying to solve the problem on your own.

I encountered several situations during the project when neither I nor the mentor knew how to solve a particular problem or fix an error. I realized that reaching out to developers directly through forums is very useful, as both situations were resolved through advice from the forum or personal correspondence. This is the beauty of open-source, where anyone can help you if you're stuck.

I would like to express special thanks to my mentor, Donát Csikós, because without their guidance, I would not have achieved the results I obtained by the end of the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment