Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev' into chore/change-login-action-text
Browse files Browse the repository at this point in the history
  • Loading branch information
Esteban Dalel R authored Oct 31, 2023
2 parents 0dea109 + dfea562 commit 233c00f
Show file tree
Hide file tree
Showing 26 changed files with 533 additions and 119 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
[![Discord](https://img.shields.io/discord/933846506438541492?style=flat-square)](https://discord.com/invite/H4AE6b9442)

<!-- Plugin description -->
**Watermelon is a Passive Documentation Search Engine** serving both our GitHub app and IDE extensions. Our set of plug-ins help developers understand code context, improve their coding velocity and merge PRs like a breeze.
**Watermelon is an Open Source Copilot For Code Review**. Our GitHub application allows developers to pre-review GitHub Pull Requests by tracing their code context and performing static code analysis. Using LLMs to detect errors, compare intent to implementation, and give the PR a first health check.

We've built a search algorithm that indexes the most relevant [passive documentation](https://www.watermelontools.com/post/what-is-passive-code-documentation-why-is-it-hard-to-scale-what-to-do-about-it) for a given block of code.
We've built a search algorithm that indexes the most relevant [code context](https://www.watermelontools.com/post/what-is-passive-code-documentation-why-is-it-hard-to-scale-what-to-do-about-it) for a given block of code.

To obtain business context in your IDE, use this extension.
To obtain code context in your IDE, use this extension.

To obtain business context in your CI/CD, take a look at our [GitHub Application](https://github.com/watermelontools/watermelon)
To obtain code context in your CI/CD, take a look at our [GitHub Application](https://github.com/watermelontools/watermelon)
<!-- Plugin description end -->

## Integrations
Expand All @@ -26,9 +26,10 @@ We currently support the following integrations

| Watermelon Product | Git | Project Management | Messaging | Documentation |
|:-------------------|:----------------------------------------| :----------------- | :-------- | :----------- |
| IntelliJ | GitHub (Alpha) | | | |
| IntelliJ | GitHub, GitLab (Beta), Bitbucket (Beta) | Jira | Slack | Notion, Confluence |
| VS Code | GitHub, GitLab (Beta), Bitbucket (Beta) | Jira | Slack | |
| GitHub App | GitHub. | Jira, Linear | Slack | Notion, Confluence |

## Features

Watermelon's IntelliJ plugin allows you to obtain business context for a file or block of code via:
Expand All @@ -45,11 +46,13 @@ Watermelon's IntelliJ plugin allows you to obtain business context for a file or
- If you build the plugin and it fails, it will be common that running `gradle clean` on your CLI will be the solution
- To publish the plugin to the JetBrains marketplace: Run the Gradle build task that generates a .zip of the build, then go to https://plugins.jetbrains.com/plugin/add#intellij and upload

![watermelon-intellij-plugin](https://i.ibb.co/9mDzctP/watermelonintellij.png)

## Requirements
- You must have Git locally installed (try `git --version` or [install it now](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git))

## Installation
Download from the [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/22251-watermelon-intellij-template).
Download from the [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/22720-watermelon-context).

## Contributing
Check out [Contributing.md](CONTRIBUTING.md) and be aware of the [Code of Conduct](CODE_OF_CONDUCT.md)!
Expand Down
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ repositories {
//maven { url = uri(urlEncode("https://jitpack.io")) }
}

dependencies {
implementation("com.posthog.java:posthog:1.1.0")
}

// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
kotlin {
jvmToolchain(17)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pluginGroup=com.watermelon.context
pluginName=watermelon-context
pluginRepositoryUrl=https://github.com/watermelontools/watermelon-intellij
# SemVer format -> https://semver.org
pluginVersion=0.0.1
pluginVersion=0.0.3
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild=222
pluginUntilBuild=232.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.wm.ToolWindow
import com.intellij.openapi.wm.ToolWindowManager
import com.watermelon.context.toolWindow.MyToolWindowFactory
import com.watermelon.context.utils.PostHog
import com.intellij.openapi.application.PermanentInstallationID

class ContextMenuButton : AnAction() {
override fun actionPerformed(e: AnActionEvent) {
Expand All @@ -27,6 +29,10 @@ class ContextMenuButton : AnAction() {
}
}

val uuid = PermanentInstallationID.get();
PostHog.posthog.capture(uuid,
"intelliJ:GetCodeContext");

toolWindow?.show {}
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/main/kotlin/com/watermelon/context/actions/LoginAction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import com.intellij.ide.BrowserUtil
import com.intellij.ide.passwordSafe.PasswordSafe
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.application.PermanentInstallationID
import com.intellij.openapi.ui.Messages
import com.watermelon.context.utils.PostHog
import kotlinx.serialization.json.*
import java.net.HttpURLConnection
import java.net.URL
Expand Down Expand Up @@ -54,6 +56,11 @@ class LoginAction : AnAction() {
}

override fun actionPerformed(e: AnActionEvent) {
// Capture telemetry event
val uuid = PermanentInstallationID.get();
PostHog.posthog.capture(uuid,
"intelliJ:login");

// Open webpage
BrowserUtil.browse("$backendUrl/intellij")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package com.watermelon.context.listeners

import com.intellij.openapi.application.ApplicationActivationListener
import com.intellij.openapi.application.PermanentInstallationID
import com.intellij.openapi.wm.IdeFrame
import com.watermelon.context.utils.PostHog

internal class MyApplicationActivationListener : ApplicationActivationListener {

override fun applicationActivated(ideFrame: IdeFrame) {
val uuid = PermanentInstallationID.get();
PostHog.posthog.capture(uuid,
"intelliJ:appActivated");
}
}
Loading

0 comments on commit 233c00f

Please sign in to comment.