4
头图

who are we

We are from the Alibaba Cloud Yunxiao Code Team. In order to find a more comfortable development (more) development (early) body (lower) experience (class), we created the Alibaba Cloud Smart Coding Plug-in for Java programmers, aka Alibaba Cloud AI Coding Assistant ( Nickname Cosy) .

image.png

(Currently on the IntelliJ IDEA plugin market⬆️ )

Cosy integrates two major development assistance functions, code completion and code search. It can not only help us reduce fencing 🤺 keystrokes accurately and intelligently through deep learning models and program analysis technology, but also based on massive code snippets and community question-and-answer data. We can search wherever we can, and immerse ourselves in the IDE and develop happily.

Today, I will show you the code sample search function dedicated to creating an immersive development experience~

More comfortable development posture

Everyone imagines that the working state of developers should be that the code words fly like flying water, but in reality, it is often Baidu Google in the left hand, Stack Overflow in the right hand, jumping back and forth between the IDE and the browser (🤪. To be honest, we used to be too so~

During the development process, we often use some unfamiliar interfaces, or implement some less commonly used functions. It is difficult to write the full text in one step. The time spent facing the browser every day is more than the IDE window. Much longer. If you think about it carefully, the efficiency of this process is quite low. Not only do you need to search different websites in different ways for different reference information, but also filter out a lot of invalid and low-quality information. If you are not careful, the browser window will be stacked with Tab lists. Densely packed.

In order to make this process easier and cooler, in addition to intelligent code completion, we also carefully built a code sample search function in Cosy, let us say goodbye to the days of "jumping between IDE and browser" 👋

1. Multi-API precise search: how to use this interface

The name sounds cool, but it's actually: I clearly remember what method I'm going to use, but I don't remember the specific way of using it, such as input and output parameters, exception handling, etc.

At this time, we can directly place the cursor on the class or method that we want to view the reference example, and call out a large number of reference example fragments with one key shortcut ( also supports shortcut key triggering and right-click menu bar selection ).

image.png

👆 For example, I am happily coding, and suddenly want to read the configuration file from the local, I just remember that I can use FileInputStream but forgot the specific writing method of upstream and downstream processing, I can first type FileInputStream and then directly press a shortcut key, it will pop up a lot of use in one second Going to the open source high-quality example of FileInputStream, I can directly compare the rest of the code logic.

image.png

In addition, API precise search also supports scenarios where multiple APIs are used at the same time. For example, if I need to use not only FileInputStream but also reference fragments of BufferedReader, I can add BufferedReader to my search criteria to see more exact search results.

2. Natural language search: How is this function implemented?

The second gesture is natural language search, where we can search by describing our intent when we know exactly what we want to do, but not how to do it.

image.png

👆 During our description process, Cosy will also automatically associate our query.

image.png

In addition to GitHub open source code snippets, we also include a large amount of high-quality StackOverflow community Q&A data. Through code snippet semantic analysis and contextual description, we support natural language descriptive search for code snippets.

3. Combination skills: only children make choices, I want them all!

The last scenario is our combo. When we make it clear what we want to do, for example, we want to read Excel, but we also want to use the third-party component library EasyExcel to achieve this, then you can add the precise API search criteria of EasyExcel to the back of the function description, Like this:

image.png

More friendly Chinese support

image.png

Maybe you will ask: But Chinese is my destiny, what should I do if I can't describe my problem in English?

do not worry!

We have thoughtfully provided better localization support for natural language search~ Not only can you complete Lenovo Chinese search sentences, but you can also use Chinese to search for Chinese and English code fragments~

I no longer have to sift through massive amounts of information. Quick verification is available in the IDE. Where I can’t check where I can’t, the boss no longer has to worry about my progress ( *`ω´)

next notice

We have not forgotten our original intention. In order to find the most comfortable development experience (the earliest time to leave work!) After fiddling with the code sample snippet search function, we further want to do community Q&A and community document search.

Imagine that my local debug stack is abnormal, directly select the error message, search for relevant solutions with one click, and solve the problem directly in the IDE!

Isn't it cool, do you really want to use it~

🤫 This month, the 0.9.8-beta version will be launched with new functions. Dear Java developers, we will see you soon!

about Us

To learn more about the latest developments of Yunxiao DevOps, you can search on WeChat and follow the [Cloud Effect] public account;

Welfare: Reply to [Guide] in the background of the official account, you can get "Alibaba DevOps Practice Guide" & "10 Times R&D Efficiency Improvement Case Collection";

Don't forget to like, bookmark and follow after reading it and think it is helpful to you;


云效DevOps平台
38 声望21 粉丝

阿里云云效,[链接]体验云原生时代新DevOps平台,支持公共云、专有云和混合云多种部署形态,通过云原生新技术和研发新模式,助力创新创业和数字化转型企业快速实现研发敏捷和组织敏捷,打造“双敏”组织,实现多倍...