Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The project comprises several packages:
- [language-support](./packages/language-support/README.md) - The core library implementing the language support features.
- [language-server](./packages/language-server/README.md) - The language server wrapper for the `language-support` package.
- [vscode-extension](./packages/vscode-extension/README.md) - The Neo4j VS Code extension which bundles the `language-server`
- [intellij-extension](./packages/intellij-extension/README.md) - The Neo4j Intellij plugin which bundles the `language-server`
- [react-codemirror](./packages/react-codemirror/README.md) - A set of [codemirror6](https://codemirror.net/) cypher language support plugins and a react wrapper.
- [react-codemirror-playground](./packages/react-codemirror-playground/README.md) - A playground for the codemirror integration.
- [schema-poller](./packages/schema-poller/README.md) - An internal package we use to manage the Neo4j connection and keep the schema (procedure names, labels, database names, etc.) up to date in the language server.
Expand Down
24 changes: 0 additions & 24 deletions editor-plugin/intellij/.run/Run IDE with Plugin.run.xml

This file was deleted.

8 changes: 0 additions & 8 deletions editor-plugin/intellij/README.md

This file was deleted.

9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"prepare": "husky install",
"build": "turbo run build",
"build-vscode": "turbo run neo4j-for-vscode#build:dev",
"build-intellij": "turbo run build:intellij",
"release": "turbo run build && npx changeset publish",
"clean": "turbo run clean",
"watch": "turbowatch ./turbowatch.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.gradle
.run
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
Expand Down
37 changes: 37 additions & 0 deletions packages/intellij-extension/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Neo4j Cypher LSP support for IntelliJ

## Build and run

Run through the [prerequisites](../../CONTRIBUTING.md#building-the-project).

You can choose to build the plugin via `gradle`:

```
intellij-extension$ ./gradlew buildPlugin
```

Or you can use [`turbo`](https://turbo.build) from the project root:

```
cypher-language-support$ npx turbo build:intellij
```

## Manual testing

If you want to test the plugin during a development workflow, you can spin up a temporary copy
of IntelliJ right from within the project. Simply run either the gradle target directly:

```
intellij-extension$ ./gradlew runIde
```

Or, from the project root:

```
cypher-language-support$ npx turbo run:intellij
```

## Installing the plugin

From IntelliJ, open Settings > Plugins > (cog icon) > Install Plugin from disk, and browse to the jar file
located in `packages/intellij-extension/build/distributions`.
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,29 @@ tasks {
}
}

runIde {
dependsOn(prepareSandbox)

debugOptions {
enabled = false
port = 8000
server = true
suspend = true
}
}

prepareSandbox {
doFirst {
exec {
commandLine("bash", "-c", "cd ../.. && npm run build && cp packages/language-server/dist/cypher-language-server.js ./editor-plugin/intellij")
commandLine("bash", "-c", "cd ../.. && npx turbo build && cp packages/language-server/dist/cypher-language-server.js ./packages/intellij-extension")
}
}
from(".") {
include("*.js")
into("cypher-lsp-support")
into("neo4j-for-intellij")
}
}

patchPluginXml {
sinceBuild.set("242")
untilBuild.set("242.*")
}

signPlugin {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions packages/intellij-extension/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "neo4j-for-intellij",
"version": "1.0.0",
"description": "Highlighting, completions and more for Neo4j Cypher in IntelliJ",
"publisher": "neo4j-extensions",
"author": "Neo4j Inc.",
"license": "Apache-2.0",
"preview": true,
"scripts": {
"build:intellij": "./gradlew buildPlugin",
"clean": "./gradlew clean",
"run:intellij": "./gradlew runIde"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ pluginManagement {
}
}

rootProject.name = "cypher-lsp-support"
rootProject.name = "neo4j-for-intellij"
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package org.neo4j.intellij.lsp.language;

import com.intellij.lang.Language;
import org.jetbrains.annotations.NotNull;

public class CypherLanguage extends Language {

public static final CypherLanguage INSTANCE = new CypherLanguage();

private CypherLanguage() {
super("Cypher");
}

@Override
public @NotNull String getDisplayName() {
return "Cypher";
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<idea-plugin>
<id>org.neo4j.intellij.lsp.cypher-lsp-support</id>
<id>org.neo4j.intellij.lsp.neo4j-for-intellij</id>

<name>Cypher Lsp Support</name>
<!-- see https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html -->
<idea-version since-build="242.22855.74"/>

<name>Neo4j for IntelliJ</name>

<vendor url="https://www.neo4j.com">Neo4j Inc.</vendor>

Expand All @@ -17,11 +20,13 @@
<extensions defaultExtensionNs="com.intellij">
<platform.lsp.serverSupportProvider
implementation="org.neo4j.intellij.lsp.cypherlspsupport.CypherLspServerSupportProvider"/>

<fileType
name="Cypher File"
language="Cypher"
implementationClass="org.neo4j.intellij.lsp.language.CypherFileType"
extensions="cypher"
fieldName="INSTANCE"
language="Cypher"
extensions="cypher"/>
/>
</extensions>
</idea-plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<font face="verdana" size="-1">This file template is used whenever you create a new Cypher file.</font>
9 changes: 9 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
"dependsOn": ["^build"],
"outputMode": "new-only"
},
"build:intellij": {
"dependsOn": ["build"],
"outputs": ["packages/intellij-extension/build/**"]
},
"run:intellij": {
"cache": false,
"persistent": true,
"dependsOn": ["build:intellij"]
},
"@neo4j-cypher/language-support#build": {
"outputs": ["src/generated-parser/**", "dist/**"],
"dependsOn": ["antlr4-c3#build"]
Expand Down