Giter Club home page Giter Club logo

bitoai's Introduction

🚀 Bito AI – Bring ChatGPT to your IDE to 10x your dev abilities!


Note: Bito code is not public. This repository contains document and intended to be used for the Bito users to report the issues. Please report any issue/feature request by opening a new issue, or send an e-mail to [email protected].


🔑 What does Bito AI do?

Bito's AI Assistant uses the same AI as ChatGPT in your IDE and Chrome to help developers dramatically accelerate their impact. Bito AI makes it easy to write code, understand syntax, write test cases, explain code, comment code, check security, and even explain high level concepts. Trained on billions of lines of code and technical knowledge, it’s pretty incredible what we can help you do without having to search the web or waste time on tedious stuff.

😊 What does Bito’s AI Assistant help with? Ask any technical question

  1. Generate Code: Examples: “code in java to convert a number from one base to another”, “code to implement a simple REST API in GO”
  2. Command Syntax: “how to set git config variables”, “create an encrypted s3 bucket using the AWS cli”
  3. Test Cases: “Generate test cases for this code < insert your code here >"
  4. Explain code: “explain this code < insert your code here >”
  5. Comment Method: “Explain this code and explain the parameters < insert your code here >”
  6. Improve Performance: “how can I improve performance of this code? < insert your code here >”
  7. Check Security: “Is this code secure? < insert your code here >”
  8. Explain concepts: "explain B+ trees, give an example with code", “explain banker’s algorithm”

This tool is far from perfect. Compile and verify before using! 😊

Examples:


Ask any technical question.

code in java to convert a number from one base to another how to set git config

Choose a selection of code, and right click to explain it, ir automatically generate the test cases.

explain this code generate unit test case

How to get started with Bito?

Just follow the steps below:

  1. Download the extension from this page or your IDE marketplace.
  2. If you are the first user for your organization, Bito will ask you to create a workspace. You can set it so that everyone with the same domain can automatically join or you can add teammate(s) to your workspace to collaborate. Bito works best when you have a few teammates to collaborate with.
  3. Check out our guide for more detailed instructions at Installing Bito Extension
  4. If you have any questions, please join our user group at Slack or email us at [email protected]

Here’s what people are saying:

“I feel like I’m saving 1-2 hours a day to get things done so much faster.” – Rohan Bankar, Principal Architect, PubMatic

“This is amazing. It helped me write test cases, write code, and it gave me a detailed summary of Scala and Java code.” – Prashant Mahajan, Co-founder & CTO, Privado

FAQ

  1. What is the cost of Bito? Bito is currently in alpha and is free to use.
  2. Does Bito store my code? Security and privacy were foremost on our mind when building Bito.Bito does not store any of your code, we only store metadata including file name, and line numbers.All messages and metadata are encrypted in transit and encrypted at rest. Contact us at [email protected] if you would like to provide your own keys for encryption or discuss other options.
  3. What security measures does Bito employ? Security and privacy were foremost on our mind when building Bito. We do not store or view any of your code ever. All messages and metadata are encrypted in transit and encrypted at rest. Contact us at [email protected] if you would like to provide your own keys for encryption or discuss other options.
  4. How to manually re-load in case VS Code does not prompt to re-load IDE after installing BITO extension? Sometimes while installing/re-installing the same version of Bito extension (*.vsix-1.x.x) which was already in use, VS Code may not prompt to re-load the VS Code editor. To manually solve for this do the following:
    • Open the command palette ( Ctrl + Shift + P ) and execute the command: >Reload Window.
    • OR Use command key Alt+F4 to close window Or, Select Close Window from File menu and re-open VS Code editor

bitoai's People

Contributors

amargoel98 avatar bitomukesh avatar nisha-bito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bitoai's Issues

PyCharm Plugins page shows broken image links

When I went to install this, the image links are all broken. I don't know if the missing information is important or not.

Please update or suggest a fix for this problem.

Thank you.

image

Does bitoai support VsCodium?

I did not find the extension "Bito" for VSCodium 1.76.2 but only "Bito-vscode-staging".
That extension does not seem to have the tab "Bito AI".

image

image

一个扩展使用问题 | An extension usage issue

扩展视图左上角显示的语言是否影响ai的接受和输出?我不确定这是否影响ai的表达,如果它不影响AI的表达,那么这个扩展视图左上角的编程语言显示是否可以去掉?因为我没有发现它有什么隐藏特性,也无法修改。它甚至不能标识当前工作区的主要编程语言,当然这个功能,也可能尚未创建?亦或者是我没有掌握正确的使用方法?这是一个扩展使用问题,我希望可以得到回复,感谢

Does the language displayed in the upper left corner of the extended view affect the acceptance and output of AI? I'm not sure if this affects the expression of AI, and if it doesn't affect the expression of AI, then the programming language display in the upper left corner of this extended view can be removed? Because I didn't find any hidden features in it, and I can't modify it. It doesn't even identify the primary programming language for the current workspace, and of course this feature may not have been created yet? Or maybe I didn't know how to use it correctly? This is an extension usage issue and I hope to get a reply, thanks

Is any plan to support Neovim ?

Describe as title, this product is very good, but is doesn't support vim/nvim.
So Is any plan to write plugin to support Neovim or expose some api ?

Bug on using shortcut

Checked that Bito is functional by replying a "hi" command.
After clicking "explain the code" as figure below.
image

It shows
image

I have no idea what task <-> main.py is for. But it is not expected behavior.

Doesn't work in Android Studio Electric Eel | 2022.1.1 Patch 1

Exception in plugin Bito AI - Use ChatGPT to write code, fix bugs, create test cases (1.0.129)

com.intellij.diagnostic.PluginException: Cannot init toolwindow co.bito.intellij.webview.BitoWindowFactory@64b70df9 [Plugin: co.bito.bito-intellij]
at com.intellij.toolWindow.ToolWindowSetInitializer.createAndLayoutToolWindows(ToolWindowSetInitializer.kt:194)
at com.intellij.toolWindow.ToolWindowSetInitializer.access$createAndLayoutToolWindows(ToolWindowSetInitializer.kt:83)
at com.intellij.toolWindow.ToolWindowSetInitializer$initUi$1.accept(ToolWindowSetInitializer.kt:147)
at com.intellij.toolWindow.ToolWindowSetInitializer$initUi$1.accept(ToolWindowSetInitializer.kt:83)
at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)
at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
at com.intellij.toolWindow.ToolWindowSetInitializer$initUi$2.execute(ToolWindowSetInitializer.kt:156)
at java.base/java.util.concurrent.CompletableFuture.uniAcceptNow(CompletableFuture.java:750)
at java.base/java.util.concurrent.CompletableFuture.uniAcceptStage(CompletableFuture.java:731)
at java.base/java.util.concurrent.CompletableFuture.thenAcceptAsync(CompletableFuture.java:2117)
at com.intellij.toolWindow.ToolWindowSetInitializer.initUi(ToolWindowSetInitializer.kt:141)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.doInit(ToolWindowManagerImpl.kt:446)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.init(ToolWindowManagerImpl.kt:419)
at com.intellij.toolWindow.InitToolWindowSetActivity$runActivity$2.run(ToolWindowSetInitializer.kt:72)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:215)
at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:197)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:511)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:69)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:112)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:42)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:898)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:746)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:803)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Caused by: java.lang.IllegalStateException: JCEF is not supported in this env or failed to initialize
at com.intellij.ui.jcef.JBCefApp.getInstance(JBCefApp.java:252)
at com.intellij.ui.jcef.JBCefBrowserBase.lambda$new$3(JBCefBrowserBase.java:152)
at com.intellij.util.ObjectUtils.notNull(ObjectUtils.java:127)
at com.intellij.ui.jcef.JBCefBrowserBase.(JBCefBrowserBase.java:152)
at com.intellij.ui.jcef.JBCefBrowser.(JBCefBrowser.java:190)
at com.intellij.ui.jcef.JBCefBrowser.(JBCefBrowser.java:150)
at co.bito.intellij.windows.BitoWindow.webViewLazy(BitoWindow.java:33)
at co.bito.intellij.windows.BitoWindow.webView(BitoWindow.java:51)
at co.bito.intellij.windows.BitoWindow.content(BitoWindow.java:55)
at co.bito.intellij.webview.BitoWindowFactory.createToolWindowContent(BitoWindowFactory.java:29)
at com.intellij.openapi.wm.impl.ToolWindowImpl.createContentIfNeeded$intellij_platform_ide_impl(ToolWindowImpl.kt:529)
at com.intellij.openapi.wm.impl.ToolWindowImpl.scheduleContentInitializationIfNeeded$intellij_platform_ide_impl(ToolWindowImpl.kt:508)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.doShowWindow(ToolWindowManagerImpl.kt:921)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.showToolWindowImpl(ToolWindowManagerImpl.kt:861)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.showToolWindowImpl$default(ToolWindowManagerImpl.kt:850)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.registerToolWindow$intellij_platform_ide_impl(ToolWindowManagerImpl.kt:1025)
at com.intellij.toolWindow.ToolWindowSetInitializer.createAndLayoutToolWindows(ToolWindowSetInitializer.kt:188)
... 44 more
image

Can you add a feature to select language?

Can you add a feature to select language?

if i select "explain the code",it's answer is english. but I want to default to another language.

I would be very grateful if this could be resolved

Suggestion

Please add more keyboard shortcuts to end input

Auto loop around tabs, like someone pressing ctrl+tab, on vscode start

Type: Bug

With this extension enable, this happened all the time when a workspace have multiple tabs opened previously.

Extension version: 1.0.130
VS Code version: Code 1.76.0 (92da9481c0904c6adfe372c12da3b7748d74bdcb, 2023-03-01T10:23:45.993Z)
OS version: Darwin x64 22.3.0
Modes:
Sandboxed: No

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 5, 5, 4
Memory (System) 16.00GB (1.73GB free)
Process Argv --crash-reporter-id 01181e41-ddad-4852-9321-689a284c434e
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
pynewext54:30669237
azure-dev_surveyone:30548225
vscccc:30610679
pyindex848:30662994
nodejswelcome1:30587005
3biah626:30602489
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
2i9eh265:30646982
6233i204:30672705
vsctsb:30662444
pythonb192:30669360

register fail

i got six-digit code, but plugin always show 'Please enter a valid 6 digit code.'
image

Unable to login in 2023.1

Hi. First, thanks for your great product.
I am opening this issue because I am unable to prompt in my e-mail in Bito window. I am using IntelliJ IDEA Ultimate 2023.1 on Linux Mint (with new UI).
Steps to reproduce:

  1. open Bito plugin;
  2. set the focus on the e-mail input;
  3. try to digit something... Nothing happens.
    Let me know if I can give you further details. I am not writing a negative review for this, anyway.

The latest version of Android Studio and java 17 doesn't work

The latest version of Android Studio and java 17 doesn't work
received error:
Please enable JCEF browser by enabling settings as per below.

  1. Go to Help -> Find action
  2. Type -> 'Choose Boot Java Runtime for the IDE'.
  3. From the dropdown 'New', select a Boot runtime which support JCEF browser.
  4. Select ok and restart.

Making textbox in bito resizable

Sometimes I need to get Bito to generate a function to meet my requirements, and I need a lot of words to describe my requirements and test cases, but the text box in the Bito interface is too small (only about 2 to 5 lines of visible space, and you can't scroll with the mouse, only with the arrow keys), so I usually create a file, write the requirements, select them all and copy them, then paste them into the Bito text box. I don't think it's that efficient in some ways.

It would be easier (for me to write requirements in Bito) if the text box was resizable, or if I could add a 'maximize' button so that the text box takes up the full size of the Bito window when clicked.

text box is too small

Custom shortcut commands

Why not let developers customize shortcut commands in the settings

I need to Chinese comments but bito only has English comments by default, and when I modify ask it doesn't call pycharm's comparison view
image
image
image

Cannot type Chinese in the input field

After updating PyCharm, I can't type Chinese in the input field,only can English.
MacBook Pro M1 macOS :ventura 13.0.1
PyCharm: PyCharm 2023.1 (Professional Edition)
Bito: 1.0.133
Looking forward to you answer!

好用

作为一个免费插件, 真的是完爆别的插件, 当然, 除了龟速和频繁的超时
但是它免费啊, 还要什么自行车?而且还有上下文关联, 我用的某些收费的垃圾都没这功能

启动时页面不断刷新

Type: Bug

启动vscode的时候,恢复之前打开的文件(有多个)会一直按顺序切换,到最后一个会从第一个重新开始切换,速度很快,导致界面一直在闪动

Extension version: 1.0.130
VS Code version: Code 1.74.1 (1ad8d514439d5077d2b0b7ee64d2ce82a9308e5a, 2022-12-14T10:30:51.966Z)
OS version: Windows_NT x64 10.0.19042
Modes:
Sandboxed: No

System Info
Item Value
CPUs 12th Gen Intel(R) Core(TM) i7-12700K (20 x 3610)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 63.81GB (39.01GB free)
Process Argv --crash-reporter-id 6143b345-6d8a-464f-8e76-e0b392c41d8b
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30669237
azure-dev_surveyone:30548225
vscccc:30610679
pyindex848:30662994
nodejswelcome1:30587005
2e4cg342:30602488
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
a9j8j154:30646983
vscodeenable:30660116
pythonb192:30669360

Keep flash between tabs

Type: Bug

Again

Extension version: 1.0.130
VS Code version: Code 1.76.1 (5e805b79fcb6ba4c2d23712967df89a089da575b, 2023-03-08T16:32:09.831Z)
OS version: Darwin x64 22.3.0
Modes:
Sandboxed: Yes

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 7, 6, 4
Memory (System) 16.00GB (0.91GB free)
Process Argv --crash-reporter-id 01181e41-ddad-4852-9321-689a284c434e
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
pynewext54:30669237
azure-dev_surveyone:30548225
vscccc:30610679
pyindex848:30662994
nodejswelcome1:30587005
3biah626:30602489
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
2i9eh265:30646982
6233i204:30672705
vsctsb:30662444
pythonb192:30669360

Allow Custom Questions in addition to predefined shortcuts for selected code.

Currently I only have limited amount of predefined options available to perform an operation on selected code.

jgPh7ellI6RKKzCn

From what I can see all of what these shortcuts do is: copying the code, insert a hardcoded question into chat gpt, then pasting the code.
It would be nice to have a way to alter that hardcoded question either on the fly with an input field prompt (what I would prefer) or by allowing to add custom questions.

Clarify data flow and data protection policy

If I send a query with bitoai, is the data then passed on to openai.com?

OpenAI is allowed to combine the personal data with the queries and us that for many purposes. The amount of privilages is that high that one should users should expect that their data will be publicly available.

Is this the same when using bitoai? Where can I find the data protection policy of bitoai?

Suggestion: add some customization settings

Some suggestions that can enhance the enjoyment of using Bito AI.

Dark and light color modes

Bito AI uses a dark background by default, which looks good when the IDE is using a dark theme.

When the IDE uses a light theme (which I'm sure some people would prefer), Bito AI still has a dark background, which is slightly less 'integrated'.

See VSCode's "Light+" theme for the color scheme.

Example

Dark

Light

Theme: Vim VSCode Theme 😊

Customising the accent color

Blue is great, of course, but it would be even better if there were more color options available. (e.g. red, orange, yellow (with black text), green, aqua, purple, pink 😊)

translation

The comments can be translated into other language by using Bit AI

"Bito AI replies are chopped off" Confirmed

Similar to this issue: #10

When I asked Bito AI the following question:

你能帮我将这个C++代码重写为PHP语言的吗? 
 
/* 
B+树是一种常用的多路搜索树,常被用于数据库索引系统中。B+树的特点是能够保持数据稳定有序,并且通过链表相连的叶子节点便于区间查找。 
*/ 
//定义B+树节点结构体 
struct BplusTreeNode { 
    int key[N]; 
    int child[N+1]; 
    int total; 
    bool is_leaf; 
}; 
 //定义B+树类 
class BplusTree { 
public: 
    BplusTree() { 
        root = NULL; 
    } 
     //查询key是否在B+树中 
    bool search(int key) { 
        if (root == NULL) 
            return false; 
        else { 
            int index = search_index(key, root); 
            if (index == root->total) 
                return false; 
            else if (key == root->key[index]) 
                return true; 
            else if (root->is_leaf) 
                return false; 
            else 
                return search(key, root->child[index]); 
        } 
    } 
     //插入key到B+树中 
    void insert(int key) { 
        if (root == NULL) 
            root = new BplusTreeNode(); 
        if (root->total == 2*N-1) { 
            BplusTreeNode *new_root = new BplusTreeNode(); 
            new_root->is_leaf = false; 
            new_root->child[0] = root; 
            root = new_root; 
            split_child(root, 0); 
        } 
        insert_nonfull(key, root); 
    } 
 private: 
    BplusTreeNode *root; 
     //查找key的插入位置 
    int search_index(int key, BplusTreeNode *node) { 
        int low = 0, high = node->total-1; 
        while (low <= high) { 
            int mid = (low+high) / 2; 
            if (node->key[mid] == key) 
                return mid; 
            else if (node->key[mid] > key) 
                high = mid-1; 
            else 
                low = mid+1; 
        } 
        return low; 
    } 
     //递归查找key是否在B+树中 
    bool search(int key, BplusTreeNode *node) { 
        int index = search_index(key, node); 
        if (index == node->total || key < node->key[index]) 
            return false; 
        else if (key == node->key[index]) 
            return true; 
        else if (node->is_leaf) 
            return false; 
        else 
            return search(key, node->child[index]); 
    } 
     //将节点node中的child[index]子树分裂成两个子树 
    void split_child(BplusTreeNode *node, int index) { 
        BplusTreeNode *child_node = node->child[index]; 
        BplusTreeNode *new_node = new BplusTreeNode(); 
        new_node->is_leaf = child_node->is_leaf; 
        new_node->total = N-1; 
        for (int i = 0; i < N-1; i++) 
            new_node->key[i] = child_node->key[i+N]; 
        if (!child_node->is_leaf) { 
            for (int i = 0; i < N; i++) 
                new_node->child[i] = child_node->child[i+N]; 
        } 
        child_node->total = N-1; 
        for (int i = node->total; i >= index+1; i--) 
            node->child[i+1] = node->child[i]; 
        node->child[index+1] = new_node; 
        for (int i = node->total-1; i >= index; i--) 
            node->key[i+1] = node->key[i]; 
        node->key[index] = child_node->key[N-1]; 
        node->total++; 
    } 
     //将key插入非满节点node中 
    void insert_nonfull(int key, BplusTreeNode *node) { 
        int index = search_index(key, node); 
        if (node->is_leaf) { 
            for (int i = node->total-1; i >= index; i--) 
                node->key[i+1] = node->key[i]; 
            node->key[index] = key; 
            node->total++; 
        } else { 
            BplusTreeNode *child_node = node->child[index]; 
            if (child_node->total == 2*N-1) { 
                split_child(node, index); 
                if (key > node->key[index]) 
                    index++; 
            } 
            insert_nonfull(key, node->child[index]); 
        } 
    } 
}; 
 //测试代码 
int main() { 
    BplusTree tree; 
    for (int i = 1; i <= 10; i++) 
        tree.insert(i); 
    if (tree.search(5)) 
        cout << "5 is in B+ tree" << endl; 
    else 
        cout << "5 is not in B+ tree" << endl; 
    return 0; 
}

The reply received was:

//定义B+树节点结构体
class BplusTreeNode {
    public $key = array();
    public $child = array();
    public $total;
    public $is_leaf;
}
  //定义B+树类
class BplusTree {
    private $root;
     public function __construct() {
        $this->root = NULL;
    }
      //查询key是否在B+树中
    public function search($key) {
        if ($this->root == NULL)
            return false;
        else {
            $index = $this->search_index($key, $this->root);
            if ($index == $this->root->total)
                return false;
            else if ($key == $this->root->key[$index])
                return true;
            else if ($this->root->is_leaf)
                return false;
            else
                return $this->search($key, $this->root->child[$index]);
        }
    }
      //插入key到B+树中
    public function insert($key) {
        if ($this->root == NULL)
            $this->root = new BplusTreeNode();
        if ($this->root->total == 2*N-1) {
            $new_root = new BplusTreeNode();
            $new_root->is_leaf = false;
            $new_root->child[0] = $this->root;
            $this->root = $new_root;
            $this->split_child($this->root, 0);
        }
        $this->insert_nonfull($key, $this->root);
    }
      //查找key的插入位置
    private function search_index($key, $node) {
        $low = 0;
        $high = $node->total-1;
        while ($low <= $high) {
            $mid = intval(($low+$high) / 2);
            if ($node->key[$mid] == $key)
                return $mid;
            else if ($node->key[$mid] > $key)
                $high = $mid-1;
            else
                $low = $mid+1;
        }
        return $low;
    }
      //递归查找key是否在B+树中
    private function search($key, $node) {
        $index = $this->search_index($key, $node);
        if ($index == $node->total || $key < $node->key[$index])
            return false;
        else if ($key == $node->key[$index])
            return true;

...then chopped off.

The above content has 2010 characters. Putting the above into MS Word, there are about 229 words.

There is a certain probability that more than this will be generated when the "regenerate" button is clicked, but there will only be a few more lines and it will not be possible to write out the whole code.


Extension version: 1.0.131
VS Code version: 1.74.3
OS version: Windows 10 (1809)

CAN NOT RUN IN IDEA 2021.1.2

Cannot init toolwindow co.bito.intellij.webview.BitoWindowFactory@a20fa85

java.lang.NoSuchMethodError: 'com.intellij.openapi.extensions.PluginId com.intellij.openapi.extensions.PluginId.findId(java.lang.String)'
	at co.bito.intellij.setting.Constant.<clinit>(Constant.java:12)
	at co.bito.intellij.utils.GenericUtils.getBasicInfoForLogin(GenericUtils.java:174)
	at co.bito.intellij.windows.BitoWindow.webViewLazy(BitoWindow.java:64)
	at co.bito.intellij.windows.BitoWindow.webView(BitoWindow.java:92)
	at co.bito.intellij.windows.BitoWindow.content(BitoWindow.java:96)
	at co.bito.intellij.webview.BitoWindowFactory.createToolWindowContent(BitoWindowFactory.java:24)
	at com.intellij.openapi.wm.impl.ToolWindowImpl.createContentIfNeeded$intellij_platform_ide_impl(ToolWindowImpl.kt:525)
	at com.intellij.openapi.wm.impl.ToolWindowImpl.scheduleContentInitializationIfNeeded$intellij_platform_ide_impl(ToolWindowImpl.kt:504)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.doShowWindow(ToolWindowManagerImpl.kt:1022)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.showToolWindowImpl(ToolWindowManagerImpl.kt:968)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.showToolWindowImpl$default(ToolWindowManagerImpl.kt:957)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.doRegisterToolWindow(ToolWindowManagerImpl.kt:1098)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.initToolWindows(ToolWindowManagerImpl.kt:519)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.access$initToolWindows(ToolWindowManagerImpl.kt:94)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl$beforeProjectOpenedTask$1.run(ToolWindowManagerImpl.kt:436)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:218)
	at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:200)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:319)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:133)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
	at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:189)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:969)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:839)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:449)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:808)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:496)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
java.lang.NoClassDefFoundError: Could not initialize class co.bito.intellij.setting.Constant
	at co.bito.intellij.utils.GenericUtils.getBasicInfoForLogin(GenericUtils.java:174)
	at co.bito.intellij.windows.BitoWindow.webViewLazy(BitoWindow.java:64)
	at co.bito.intellij.windows.BitoWindow.webView(BitoWindow.java:92)
	at co.bito.intellij.windows.BitoWindow.content(BitoWindow.java:96)
	at co.bito.intellij.webview.BitoWindowFactory.createToolWindowContent(BitoWindowFactory.java:24)
	at com.intellij.openapi.wm.impl.ToolWindowImpl.createContentIfNeeded$intellij_platform_ide_impl(ToolWindowImpl.kt:525)
	at com.intellij.openapi.wm.impl.ToolWindowImpl.scheduleContentInitializationIfNeeded$intellij_platform_ide_impl(ToolWindowImpl.kt:504)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.doShowWindow(ToolWindowManagerImpl.kt:1022)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.showToolWindowImpl(ToolWindowManagerImpl.kt:968)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.activateToolWindow(ToolWindowManagerImpl.kt:668)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.activateToolWindow$default(ToolWindowManagerImpl.kt:646)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.activated$intellij_platform_ide_impl(ToolWindowManagerImpl.kt:1985)
	at com.intellij.openapi.wm.impl.StripeButton.lambda$new$0(StripeButton.java:67)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:401)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:270)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6652)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
	at com.intellij.openapi.wm.impl.StripeButton.processMouseEvent(StripeButton.java:315)
	at java.desktop/java.awt.Component.processEvent(Component.java:6417)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2784)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:969)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:906)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:836)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:449)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:808)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

[Enhancement] Create custom shortcuts

It will be really helpful for me to create my custom shortcuts to use in the code.

For example:

"Comment this code following Dart best practices for documentation"

Shortcuts do not work on IntelliJ IDEA Ultimate 2022.3.2

Using IntelliJ IDEA Ultimate 2022.3.2.

Upon trying to use any shortcuts in the right-click menu, I receive an error. This occurs with any shortcut.

Here is the stacktrace for trying to use "Generate Comment" shortcut.

java.lang.StringIndexOutOfBoundsException: begin 32, end -1, length 43 at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4604) at java.base/java.lang.String.substring(String.java:2707) at co.bito.intellij.services.GitUtilService.updateRepoInfoForGivenFile(GitUtilService.java:313) at co.bito.intellij.actions.GenerateComment$2.run(GenerateComment.java:79) at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:429) at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:480) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:833)

it always redirect to the login page

when i login on it first time,it guide me to create my workspace,then it goes to the login page , or when i join the
workspace i created before,it redirect to the login page again ,wtf?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.