File tree Expand file tree Collapse file tree 4 files changed +29
-2
lines changed
Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 11# functorcoder
2- Open source AI coding assistant " ** functorcoder** " is a AI coding assistant utilizing LLM (Large Language Model) with algebraic and modular design.
2+ ** functorcoder** is an open source AI coding assistant utilizing LLM (Large Language Model) with algebraic and modular design.
33
44features:
55- code generation: completion, documentation
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import vscextension.facade.vscodeUtils.showMessageAndLog
1313import functorcoder .types .editorCtx .codeActionParam
1414import functorcoder .llm .llmMain .llmAgent
1515import functorcoder .algo .treeParse
16+ import vscextension .statusBar
1617
1718/** Commands are actions that a user can invoke in the vscode extension with command palette (ctrl+shift+p).
1819 */
@@ -45,6 +46,9 @@ object Commands {
4546 val param =
4647 arg.asInstanceOf [codeActionParam[Future [String ]]]
4748 val llmResponse = param.param
49+
50+ statusBar.showSpininngStatusBarItem(" functorcoder" , llmResponse)
51+
4852 llmResponse.foreach { response =>
4953 showMessageAndLog(" add doc: " + s " ${param.documentUri}, ${param.range}, ${response}" )
5054 // apply the changes to the document
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ object inlineCompletions {
4646 )
4747 }.toJSPromise
4848
49+ statusBar.showSpininngStatusBarItem(" functorcoder" , providerResultF)
4950 providerResultF.asInstanceOf [typings.vscode.mod.ProviderResult [
5051 scala.scalajs.js.Array [typings.vscode.mod.InlineCompletionItem ] | typings.vscode.mod.InlineCompletionList
5152 ]]
Original file line number Diff line number Diff line change 11package vscextension
2+ import scala .scalajs .js
23import typings .vscode .mod as vscode
34
45import vscextension .facade .vscodeUtils .*
5-
66import functorcoder .actions .Commands
7+ import scala .concurrent .Future
8+ import scala .scalajs .js .JSConverters .JSRichFutureNonThenable
9+ import scala .concurrent .ExecutionContext .Implicits .global
10+
711object statusBar {
812
913 def createStatusBarItem (context : vscode.ExtensionContext ) = {
@@ -19,4 +23,22 @@ object statusBar {
1923 context.pushDisposable(statusBarItem.asInstanceOf [vscode.Disposable ])
2024 statusBarItem
2125 }
26+
27+ /** Show a spinning status bar item while loading
28+ * @param text
29+ * the text to show
30+ * @param promise
31+ * the promise to wait for
32+ */
33+ def showSpininngStatusBarItem (text : String , promise : js.Promise [Any ]): vscode.Disposable = {
34+ // show a spinner while loading
35+ vscode.window.setStatusBarMessage(
36+ " $(sync~spin)" + text,
37+ hideWhenDone = promise.asInstanceOf [typings.std.PromiseLike [Any ]]
38+ )
39+ }
40+
41+ def showSpininngStatusBarItem (text : String , future : Future [Any ]): vscode.Disposable = {
42+ showSpininngStatusBarItem(text, future.toJSPromise)
43+ }
2244}
You can’t perform that action at this time.
0 commit comments