Skip to content

Commit

Permalink
chore: bump intellij plugin version 0.5.0. (TabbyML#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
icycodes authored Sep 15, 2023
1 parent 635469f commit 076dff9
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 117 deletions.
12 changes: 12 additions & 0 deletions clients/intellij/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 0.5.0

### Incompatible Changes:

- Node.js version requirement is now v18+.
- System proxy environment variables are now ignored, including `http_proxy`, `https_proxy`, `all_proxy` and `no_proxy`. Before this change, proxy environment variables are processed, but requests will fail due to lack of supporting for https over http proxy and socks proxy.

### Fixes:

- Fixed a bug that causes auto-completion requests cannot be cancelled.
- Migrated Tabby cloud authorization tokens and anonymous usage tracking id from the old data directory to the new one.

## 0.4.0

### Features:
Expand Down
2 changes: 1 addition & 1 deletion clients/intellij/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## Requirements
- Tabby plugin works with all IntelliJ Platform IDEs that have build 2022.2.5 or later versions, such as Idea, PyCharm, Android Studio, and more.
- Tabby plugin requires [Node.js](https://nodejs.org) 16.0+ to be installed and added into the `PATH` environment variable.
- Tabby plugin requires [Node.js](https://nodejs.org) 18.0+ to be installed and added into the `PATH` environment variable.

## Installation
You can install Tabby plugin from the IntelliJ Platform [plugin marketplace](https://plugins.jetbrains.com/plugin/22379-tabby).
Expand Down
2 changes: 1 addition & 1 deletion clients/intellij/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "com.tabbyml"
version = "0.4.0"
version = "0.5.0"

repositories {
mavenCentral()
Expand Down
174 changes: 70 additions & 104 deletions clients/intellij/node_scripts/tabby-agent.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.tabbyml.intellijtabby.actions

import com.intellij.ide.BrowserUtil
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
Expand Down Expand Up @@ -29,7 +30,10 @@ class CheckIssueDetail : AnAction() {
}
val message = buildDetailMessage(detail, serverHealthState)
invokeLater {
Messages.showInfoMessage(message, title)
val result = Messages.showOkCancelDialog(message, title, "Dismiss", "Supported Models", Messages.getInformationIcon())
if (result == Messages.CANCEL) {
BrowserUtil.browse("https://tabby.tabbyml.com/docs/models/")
}
}
}
}
Expand Down Expand Up @@ -62,7 +66,7 @@ class CheckIssueDetail : AnAction() {
"""
Your Tabby server is running model $model on CPU.
This model is too large to run on CPU, please try a smaller model or switch to GPU.
You can find supported model list by search TabbyML on HuggingFace.
You can find supported model list in online documents.
"""
} else {
""
Expand All @@ -78,7 +82,7 @@ class CheckIssueDetail : AnAction() {
helpMessage += " - Server overload. Please contact your Tabby server administrator for assistance.\n";
if (helpMessageForRunningLargeModelOnCPU.isEmpty()) {
helpMessage += " - The running model $model is too large to run on your Tabby server. ";
helpMessage += "Please try a smaller model. You can find supported model list by search TabbyML on HuggingFace.\n";
helpMessage += "Please try a smaller model. You can find supported model list in online documents.\n";
}
return statsMessages + helpMessage
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ class Agent : ProcessAdapter() {
val process = GeneralCommandLine(node, "--version").createProcess()
val version = BufferedReader(InputStreamReader(process.inputStream)).readLine()
val regResult = Regex("v([0-9]+)\\.([0-9]+)\\.([0-9]+)").find(version)
if (regResult != null && regResult.groupValues[1].toInt() >= 16) {
if (regResult != null && regResult.groupValues[1].toInt() >= 18) {
return
} else {
throw AgentException("Node version is too old: $version. Please install Node.js v16+ and add bin path to system environment variable PATH, then restart IDE.")
throw AgentException("Node version is too old: $version. Please install Node.js v18+ and add bin path to system environment variable PATH, then restart IDE.")
}
} catch (e: Exception) {
if (e is AgentException) {
Expand Down Expand Up @@ -186,15 +186,15 @@ class Agent : ProcessAdapter() {
}

suspend fun requestAuthUrl(): AuthUrlResponse? {
return request("requestAuthUrl", listOf())
return request("requestAuthUrl", listOf(ABORT_SIGNAL_ENABLED))
}

suspend fun waitForAuthToken(code: String) {
return request("waitForAuthToken", listOf(code))
return request("waitForAuthToken", listOf(code, ABORT_SIGNAL_ENABLED))
}

suspend fun provideCompletions(request: CompletionRequest): CompletionResponse? {
return request("provideCompletions", listOf(request))
return request("provideCompletions", listOf(request, ABORT_SIGNAL_ENABLED))
}

data class LogEventRequest(
Expand All @@ -212,7 +212,7 @@ class Agent : ProcessAdapter() {
}

suspend fun postEvent(event: LogEventRequest) {
request<Any>("postEvent", listOf(event))
request<Any>("postEvent", listOf(event, ABORT_SIGNAL_ENABLED))
}

data class AuthUrlResponse(
Expand Down Expand Up @@ -331,4 +331,8 @@ class Agent : ProcessAdapter() {
}
}
}

companion object {
private val ABORT_SIGNAL_ENABLED = mapOf("signal" to true)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ class AgentService : Disposable {
INITIALIZATION_FAILED,
}
private var initResultFlow: MutableStateFlow<Boolean?> = MutableStateFlow(null)
val status get() = initResultFlow.combine(agent.status) { initResult, agentStatus ->
val status = initResultFlow.combine(agent.status) { initResult, agentStatus ->
if (initResult == null) {
Status.INITIALIZING
} else if (initResult) {
agentStatus
} else {
Status.INITIALIZATION_FAILED
}
}.stateIn(scope, SharingStarted.WhileSubscribed(), Status.INITIALIZING)
}.stateIn(scope, SharingStarted.Eagerly, Status.INITIALIZING)

val currentIssue get() = agent.currentIssue

Expand Down

0 comments on commit 076dff9

Please sign in to comment.