Skip to content

Commit

Permalink
chore(intellij): prepare intellij plugin for ci signing and publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissimon-au committed Mar 10, 2024
1 parent ea1085c commit a588fbd
Show file tree
Hide file tree
Showing 4 changed files with 406 additions and 14 deletions.
Binary file added docs/wiki/images/hover_intellij.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions src/intellij/contextive/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Contextive README

Contextive is an IntelliJ Platform Plugin to assist developers in environments with a complex domain or project specific language, where words have a special meaning in the context of the project.

It should help new team members get up to speed more quickly in understanding domain-specific terms. By storing the term definitions in your repository, and surfacing the definitions as you work on the code, it encourages the use of the domain-specific terms in your code, and regularly updating the definitions as the team's understanding evolves.

![Example of Contextive in action.](https://raw.githubusercontent.com/dev-cycles/contextive/main/docs/wiki/images/hover_intellij.png)

## Getting Started

Create a folder in your project root called `.contextive`. Create a file in that folder called `definitions.yml`.

Start defining your definitions following the schema specified in our [usage guide](https://github.com/dev-cycles/contextive/blob/main/docs/wiki/USAGE.md). You might like to start by copying our [default definitions](https://github.com/dev-cycles/contextive/blob/main/src/language-server/Contextive.LanguageServer.Tests/DefinitionsInitializationTests.Default%20Definitions.verified.txt) file that defines the terms used in the definitions file itself.

## Supported IDEs

The plugin uses the IntelliJ Language Server Protocol support, so it's only available in the IDEs where that feature is offered. See the [JetBrains LSP Documentation](https://plugins.jetbrains.com/docs/intellij/language-server-protocol.html#supported-ides) for the latest list.

At time of writing, it includes:

* IntelliJ IDEA Ultimate
* WebStorm
* PhpStorm
* PyCharm Professional
* DataSpell
* RubyMine
* CLion
* Aqua
* DataGrip
* GoLand
* Rider
* RustRover

## Usage Guide

See our [usage guide](https://github.com/dev-cycles/contextive/blob/main/docs/wiki/USAGE.md) for details on the definitions file format and available options.

## Features

* [Auto-complete](https://github.com/dev-cycles/contextive/blob/main/docs/wiki/USAGE.md#smart-auto-complete) from your Contextive Definitions
* Shows definitions in auto-complete details
* Hover to show definitions from your Contextive Definitions
* Hover over elements with [suffixes & prefixes](https://github.com/dev-cycles/contextive/blob/main/docs/wiki/USAGE.md#suffixes-and-prefixes)
* Hover over usage of [multiple terms](https://github.com/dev-cycles/contextive/blob/main/docs/wiki/USAGE.md#combining-two-or-more-terms) combined using camelCase, PascalCase and snake_case
* Hover over [multi-word](https://github.com/dev-cycles/contextive/blob/main/docs/wiki/USAGE.md#multi-word-terms) terms
* Hover over [plural](https://github.com/dev-cycles/contextive/blob/main/docs/wiki/USAGE.md#plural-words) of defined terms
* Hover over [aliases](https://github.com/dev-cycles/contextive/blob/main/docs/wiki/USAGE.md#term-aliases) of defined terms
* Supported Repository Layouts:
* A [repository per context](https://github.com/dev-cycles/contextive/blob/main/docs/wiki/USAGE.md#multiple-bounded-contexts-repository-per-context)
* [Multiple contexts in the same repository](https://github.com/dev-cycles/contextive/blob/main/docs/wiki/USAGE.md#multiple-bounded-contexts-single-repository-single-root-monorepo) (monorepo) (identified by path globs)
* Context distributed over [multiple repositories](https://github.com/dev-cycles/contextive/blob/main/docs/wiki/USAGE.md#single-bounded-context-multiple-repositories) (#36)
* [Multi-root workspaces](https://github.com/dev-cycles/contextive/blob/main/docs/wiki/USAGE.md#multiple-bounded-contexts-multi-root-shared-definitions-file)
* Works in all files

### Coming Soon

* IDE command to initialize the definitions file
* Configure different location for the definitions file
* UI to edit/manage Contextive Definitions
* Internationalization support
* Support for multiple contexts in separate repositories
* Better support for key word identification in different languages (e.g. different syntax delimiters)

## Plugin Configuration

The plugin does not currently support configuration. The definitions file _must_ be in `./contextive/definitions.yml` in your current project folder.

This is pending IntelliJ support for the LSP `workspace/configuration` feature.

## Known Issues

* Not configurable - see [Plugin Configuration](#plugin-configuration)
11 changes: 8 additions & 3 deletions src/intellij/contextive/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,17 @@ tasks {

patchPluginXml {
sinceBuild.set("233")
untilBuild.set("233.*")
untilBuild.set("241.*")
}

signPlugin {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
certificateChain.set(
System.getenv("CERTIFICATE_CHAIN") ?:
File(System.getenv("CERTIFICATE_CHAIN_PATH")).readText(Charsets.UTF_8)
)
privateKey.set(System.getenv("PRIVATE_KEY") ?:
File(System.getenv("PRIVATE_KEY_PATH")).readText(Charsets.UTF_8)
)
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}

Expand Down
Loading

0 comments on commit a588fbd

Please sign in to comment.