onflow / flip-fest

A backlog of all the available tasks to complete for Flow's FLIP Fest.
50 stars 39 forks source link

New Tool: Add Cadence support for IntelliJ Platform - Milestone 2-3-4 #112

Closed NikitasKotsolakos closed 3 years ago

NikitasKotsolakos commented 3 years ago

New Tool: Add Cadence support for IntelliJ Platform - Milestone 2-3-4

Description

This PR is for issue #19

Submission Links & Documents

Requirements Check

The Minimum Feature Set (Acceptance Criteria) section of the issue #19 defines:

Syntax highlighting: The Cadence Visual Studio Code extension defines a grammar for the Cadence language, which is used to support syntax highlighting. You will need to port this grammar to IntelliJ.

This has been achieved as seen on the screenshot below (or by installing the extension and opening .cdc files): plugin-screenshot

Semantic analysis and error checking: The Cadence language includes an implementation of the Language Server Protocol (LSP), defined in the Cadence repository. LSP servers are used by code editors and IDEs, most notably Visual Studio Code, to implement language-specific editor features. You can find a full list of LSP implementations on the Microsoft website. The Cadence Visual Studio Code extension uses the LSP to report syntax problems and semantic errors (e.g. type errors) back to the developer. You will need to integrate IntelliJ with the Cadence language server to report these same errors inside IntelliJ. IntelliJ does not support the LSP out of the box; you will need to use a plugin such as this: https://github.com/ballerina-platform/lsp4intellij

This has been achieved as seen on the GIF below (or by installing the extension and editing .cdc files): LSP support usage

The Milestone Requirements include:

  1. Implement syntax highlighting for Cadence in IntelliJ.
  2. Implement semantic error checking using the Cadence language server in IntelliJ.
  3. Expand your plugin so that is compatible with at least one other IntelliJ Platform-based editors (e.g. Goland). The more the better!
  4. Finalize your submission and publish it to the JetBrains marketplace.

We showed before that 1 and 2 have been achieved. Milestones 3 and 4 have also been achieved, as we showed before and as is visible in this screenshot from the Jetbrains Market place:

cadence-plugin-marketplace

The Software Requirements include:

Your submission should be implemented in Java as an IntelliJ plugin using this guide: https://plugins.jetbrains.com/docs/intellij/getting-started.html     **Done**

The plugin should be installable from the JetBrains marketplace.    **Done (shown before)**

The source code for your plugin should be available in a public repository.  **Done. [link](https://github.com/cadence-tools/cadence-for-intellij-platform)**

The Other Requirements include

Documentation: The following pieces of documentation need to be completed alongside the code for a successful submission: Installation guide Done, in the README

Code standards or guidelines Follow the general contribution guidelines. DONE

Extensions / additional work done

Include a payout structure by percentage for each team member (ie. Bob: 20%, Alice: 80%).

@NikitasKotsolakos 100% (In the end, the 2nd team member, @Roronnoazoro) didn't have the time to participate)

Other Details

MaxStalker commented 3 years ago

Amazing work, @NikitasKotsolakos ! Thank you so much for making it real - now I can finally write Cadence code in WebStorm! šŸ™‡

We can mark this as šŸŽ‰ Milestones Achieved šŸŽ‰ Congratulations!

NikitasKotsolakos commented 3 years ago

Thank you very much @MaxStalker , hope it is helpful, and also thank you for the feedback during the development!

I also did quick update to the documentation with the instructions I had given you in the task to make it more clear for people in the future, and included these instructions links in the plugin description itself for people who just find the plugin through Intellij.

I will be monitoring Github and Discord to see the next steps now that the flip-fest is over

kerrywei commented 3 years ago

update: clarifying usage with the author in https://github.com/cadence-tools/cadence-for-intellij-platform/issues/16

kerrywei commented 3 years ago

unblocked by a workaround from the author. confirmed it works on Mac OS X. merging in this PR as milestones have been achieved