包搜索功能 EAP 版本发布服务器
Introducing Package Search EAPapp
Hadi Hariri 发布于 2019 年 10 月 22 日ide
_Posted on October 22, 2019 by Hadi Hariri_ 工具
咱们很高兴宣布 IntelliJ IDEA 的一个新插件,它将在您的 JVM 项目中发现和管理依赖项时为您提供更好的体验。若是你是 Kotlin 开发者,你还会获得额外的功能!post
We’re happy to announce a new plugin for IntelliJ IDEA that will provide you a better experience when it comes to finding and managing dependencies in your JVM projects. And if you’re a Kotlin developer, you’ll be getting an additional bonus! ui
找到合适的包this
Finding the right packagelua
当你正在启动一个新的项目,或者在现有的项目上工做,你想作一些HTTP 调用…插件
You’re starting a new project, or working on an existing one, and you want to make some HTTP calls… code
嗯。哪一个库是大多数人使用的?让我谷歌一下。好吧,有不少。
Hmm. Which library is the one that most folks are using? Let me Google it. Well there’s a bunch of them.
Stackoverflow 告诉我这是最好的。不知道它是否还有人维护。让我看看 Star 和 Fork 数字。
StackOverflow tells me this is the best and greatest. Wonder if it’s still maintained. Let me look at the Stars and Forks.
好吧,我就用这个了。让我在 Maven Central 找找看。
OK, I’m going with this one. Right. Let me find it on Maven Central.
复制/粘贴。
Copy/Paste.
搞定
Done
咱们之前都这么干。即便咱们知道咱们要使用的库,咱们仍然会查找并在项目中引用最新版本。
We’ve all been there. Even if we know the library we want to use, we still go through the process of finding the latest version and referencing it in our project.
欢迎使用包搜索
Welcome to Package Search
有了包搜索,如今就简单多了。您能够直接在 IDE 中搜索、评估和管理全部的依赖。
With Package Search this is now much simpler. From within the IDE, you can search, evaluate and manage all your dependencies.
打开 Packages 工具窗口,或者调用 Package dependency 操做来搜索新的包。
Pull up the Packages tool window or simply invoke the Package dependency action to search for new packages.
Package Manager 窗口提供了诸如源代码连接、StackOverflow 活动、GitHub 等信息,而且全部这些信息均可以经过条目中的连接直接访问。此外,它还提供了当前安装的全部软件包的列表。您能够直接在列表中添加、删除和更新包。
The Package Manager Window provides information such as the source code links, activity on StackOverflow, GitHub, and all accessible directly with links from the entry. In addition it provides a list of all currently installed packages. From here you can add, remove, and update packages.
咱们目前只支持 Maven 和 Gradle,可是系统是彻底插件化的,咱们将在将来增长对其余构建工具的支持。
We currently support Maven and Gradle, although the system is completely pluggable and we’ll be adding support for other build tools in the future.
代码补全功能
Code Completion Functionality
若是您喜欢直接在构建文件中添加依赖项,那么您将很高兴地知道,从 2019.2 开始,您已经在使用包搜索了。IntelliJ IDEA 最新版本的代码补全功能就是基于包搜索服务器的,这使得它不只更加完整,并且在速度更快。
If you prefer adding dependencies directly yourself in your build files, you’ll be pleased to know that for starting with the 2019.2 IDE, you’ve already been using Package Search. The code completion that IntelliJ IDEA provides since the latest version is based on the Package Search Server, making it not only more complete but faster in terms of performance also. Code Completion
Kotlin 和多平台包查找
Kotlin and Multiplatform discovery
若是您是 Kotlin 用户,您可能遇到过一个特定的场景,您正在寻找一个库,但不肯定它支持哪些平台。或者在开发多平台应用程序的状况下,须要一个支持全部目标平台的库。
If you’re a Kotlin user, you may have come across a certain scenario where you’re looking for a library and not sure which platforms it supports. Or in the case of developing multiplatform applications, you’d want something that supports all your target platforms.
包搜索经过提供有关库的目标平台的附加信息来知足这一需求。下面的示例显示了 assertk 的状况,这是一个支持多种目标平台的跨平台库。在右侧窗格中,您能够看到特定的标记。
Package Search caters to this need by providing you additional information about target platforms for libraries. The example below shows the case of assertk, a multiplatform library with support for a variety of targets. On the right pane you can see the specific ones as tags.
试试看
Trying it out
要得到 Package Window 和可视化界面,您须要安装市场上提供的包搜索插件。
To get the Package Window and visual interface, you need to install the Package Search plugin that is available on the marketplace.
若是您在使用 IntelliJ IDEA 2019.2 或更高版本,那么您已经在依赖包信息补全上用过这个功能了。
If you’re using IntelliJ IDEA 2019.2 or later, you’re already using this functionality when it comes to code completion for packages.
还有哪些功能
What’s in store
咱们为包搜索计划了大量的功能,其中包括
We have a ton of functionality planned for Package Search, amongst other things
对于那些有使用 nuget 经验并正在使用咱们的 .NET IDE Rider 的用户来讲,这些都是很熟悉的功能。可是,在以前的基础上,咱们如今还增长了本身的包索引和附加的元数据。
For those of you who have experience with NuGet and are using our .NET IDE Rider, this will definitely be familiar to you. The enhancements however are that we now have our own package index with additional metadata.
可是包搜索的目的是使发现和依赖关系管理更容易,避免您花费时间搜索、收集信息和复制/粘贴代码。你的时间是宝贵的,因此咱们最不但愿你读长篇博客文章。
But Package Search is all about making discovery and dependency management easier, avoiding you having to spend time searching, collecting information and copy/pasting code. Your time is valuable, so that last thing we want is for you to read long blog posts.
试试看,若是你有任何反馈,请告诉咱们。
Try it out and and let us know if you have any feedback.