Custom Fleet Plugins for Your Kotlin Codebase | Vitaly Bragilevsky

Kotlin by JetBrains
14 Jul 202414:58

Summary

TLDRVitali Brail from JetBrains introduces the concept of custom Fleet plugins for coding projects. Fleet, a multi-language code editor, offers built-in tools for remote development and collaboration. However, for specific needs like custom views or external tool integration, custom plugins are essential. Brail demonstrates creating a simple 'count functions' plugin, emphasizing the importance of understanding Fleet's database and structured concurrency. He highlights the ease of developing plugins with just 100 lines of code and encourages developers to look forward to the public preview of Fleet plugins.

Takeaways

  • πŸ˜€ Vitali Brail from JetBrains is introducing custom Fleet plugins for coding bases.
  • πŸ” Fleet is a multi-language code editor designed for remote development and collaboration.
  • πŸ›  Sometimes, out-of-the-box features aren't enough, and custom plugins are needed for specific tasks.
  • πŸ“š Custom plugins can provide additional insights, like code base size or cyclomatic complexity.
  • πŸ’‘ Creating a custom Fleet plugin involves writing code, running it in development, and publishing it on the marketplace.
  • 🚧 Fleet plugins are a work in progress and not yet available to everyone, but a public preview is coming.
  • 🌐 The architecture of Fleet centers around a workspace that manages projects and communicates with other components.
  • πŸ”§ Plugins for Fleet involve implementing components for the front end, workspace, and backend (which is an IntelliJ IDEA plugin).
  • πŸ“ The script provides a simple example of a 'count functions' plugin that updates a notification based on the number of functions in a code base.
  • πŸ”‘ Two key principles for coding with Fleet are using transactions for changes and embracing Kotlin's structured concurrency.
  • πŸ“ˆ The 'count functions' plugin is a concise example, implemented in under 100 lines of code, demonstrating the potential for more complex plugins.

Q & A

  • Who is Vitali Brailo, and what is his role at JetBrains?

    -Vitali Brailo is a Developer Advocate at JetBrains, where he works with the Fleet team to make Fleet plugins a reality.

  • What is Fleet, and what is its primary purpose?

    -Fleet is a code editor designed to support many programming languages simultaneously. It is aimed at providing a pleasant remote development experience and implementing collaboration scenarios.

  • Why might someone need to create a custom Fleet plugin?

    -One might need a custom Fleet plugin for various reasons, such as using unique resources in their codebase, integrating with external tools not available out of the box, or obtaining additional information about their codebase like total size or cyclomatic complexity.

  • How easy is it to create a custom Fleet plugin according to the transcript?

    -Creating a custom Fleet plugin is described as very easy. It involves writing code for the plugin, running Fleet with the plugin in development, and then publishing it on the marketplace for easy installation.

  • What is the current status of Fleet plugins according to the talk?

    -As of the talk, Fleet plugins are a work in progress and are not yet available to everyone. The team is working towards making them available for public preview.

  • Can you explain the 'count functions' plugin example mentioned in the script?

    -The 'count functions' plugin is a simple example that counts the number of top-level functions in a codebase. It updates a notification to reflect the current number of functions whenever changes are made to the code.

  • What are the two basic principles of coding when developing plugins for Fleet?

    -The two principles are: 1) Fleet is a distributed database with reactive queries, where every change is made through transactions, and 2) Fleet embraces Kotlin's structured concurrency, requiring developers to be proficient in its use.

  • How does the 'count functions' plugin interact with the Fleet database?

    -The plugin uses reactive queries to monitor changes in the abstract syntax tree of the file loaded into the editor. It performs a transaction to create and update a notification reflecting the current count of functions in the codebase.

  • What is the significance of the 'L' function in the context of the plugin?

    -The 'L' function is crucial as it is executed when the plugin is loaded into Fleet. It is where all the functionality of the plugin, such as registering actions and notifications, is registered.

  • How does the plugin manage notifications and actions?

    -The plugin registers a notification category and creates notifications within a transaction block. Actions are defined using a DSL (Domain-Specific Language) in Fleet, which specifies conditions for the action's availability and the function to execute when the action is triggered.

  • What is the role of structured concurrency in the plugin's coroutine execution?

    -Structured concurrency ensures that every coroutine is executed within a specific scope. If the plugin is unloaded, all coroutines within that scope are automatically cancelled, providing control over the plugin's functionality.

Outlines

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Mindmap

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Keywords

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Highlights

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Transcripts

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now
Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Fleet PluginsCode EditorCustomizationRemote DevelopmentCollaboration ToolsAbstract Syntax TreeStructured ConcurrencyDatabase TransactionsPlugin DevelopmentCoding Enhancements