Skip to content

Commit

Permalink
feat(lang): add file type, icon, and template (#35)
Browse files Browse the repository at this point in the history
* docs: add license

Signed-off-by: Luke Gareth Ribchester <luke@luke.gr>

* build: remove template files

Signed-off-by: Luke Gareth Ribchester <luke@luke.gr>

* build: update `pluginGroup`, `pluginName`, and `platformVersion`

Signed-off-by: Luke Gareth Ribchester <luke@luke.gr>

* build: update `id`, `name`, and `vendor`

Signed-off-by: Luke Gareth Ribchester <luke@luke.gr>

* build: increase version to `0.0.1-alpha`

Signed-off-by: Luke Gareth Ribchester <luke@luke.gr>

* feat(editor): add `.bend` file template

Signed-off-by: Luke Gareth Ribchester <luke@luke.gr>

* docs(readme): update readme

Signed-off-by: Luke Gareth Ribchester <luke@luke.gr>

* build: add the plugin icon

Signed-off-by: Luke Gareth Ribchester <luke@luke.gr>

* feat(language): define the Bend file type and icon

Signed-off-by: Luke Gareth Ribchester <luke@luke.gr>

* docs(readme): add plugin identifier

Signed-off-by: Luke Gareth Ribchester <luke@luke.gr>

* docs: add `funding.yml`

Signed-off-by: Luke Gareth Ribchester <luke@luke.gr>

* docs(changelog): add entry

Signed-off-by: Luke Gareth Ribchester <luke@luke.gr>

* build: increase version to `0.0.1`

Signed-off-by: Luke Gareth Ribchester <luke@luke.gr>

---------

Signed-off-by: Luke Gareth Ribchester <luke@luke.gr>
  • Loading branch information
lukeribchester authored May 18, 2024
1 parent 402b58b commit 0abab71
Show file tree
Hide file tree
Showing 22 changed files with 150 additions and 183 deletions.
1 change: 1 addition & 0 deletions .github/funding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: lukeribchester
1 change: 1 addition & 0 deletions .idea/gradle.xml

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

4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

## [Unreleased]
### Added
- Initial scaffold created from [IntelliJ Platform Plugin Template](https://github.com/JetBrains/intellij-platform-plugin-template)
- File type
- File icon
- File template
16 changes: 16 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
MIT License

Copyright (c) 2024 Luke Gareth Ribchester

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
73 changes: 43 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,57 @@
# bend-intellij
# Bend Language Support for the IntelliJ Platform 🚀

<p align="center">
<picture>
<source srcset="./images/higherorderco-logo.gif" media="(prefers-color-scheme: dark)"/>
<img src="./images/higherorderco-logo.gif" width="830" alt="HigherOrderCO logo" />
</picture>
</p>

![Build](https://github.com/lukeribchester/bend-intellij/workflows/Build/badge.svg)
[![Version](https://img.shields.io/jetbrains/plugin/v/PLUGIN_ID.svg)](https://plugins.jetbrains.com/plugin/PLUGIN_ID)
[![Downloads](https://img.shields.io/jetbrains/plugin/d/PLUGIN_ID.svg)](https://plugins.jetbrains.com/plugin/PLUGIN_ID)

## Template ToDo list
- [x] Create a new [IntelliJ Platform Plugin Template][template] project.
- [ ] Get familiar with the [template documentation][template].
- [ ] Adjust the [pluginGroup](./gradle.properties), [plugin ID](./src/main/resources/META-INF/plugin.xml) and [sources package](./src/main/kotlin).
- [ ] Adjust the plugin description in `README` (see [Tips][docs:plugin-description])
- [ ] Review the [Legal Agreements](https://plugins.jetbrains.com/docs/marketplace/legal-agreements.html?from=IJPluginTemplate).
- [ ] [Publish a plugin manually](https://plugins.jetbrains.com/docs/intellij/publishing-plugin.html?from=IJPluginTemplate) for the first time.
- [ ] Set the `PLUGIN_ID` in the above README badges.
- [ ] Set the [Plugin Signing](https://plugins.jetbrains.com/docs/intellij/plugin-signing.html?from=IJPluginTemplate) related [secrets](https://github.com/JetBrains/intellij-platform-plugin-template#environment-variables).
- [ ] Set the [Deployment Token](https://plugins.jetbrains.com/docs/marketplace/plugin-upload.html?from=IJPluginTemplate).
- [ ] Click the <kbd>Watch</kbd> button on the top of the [IntelliJ Platform Plugin Template][template] to be notified about releases containing new features and fixes.
[![Version](https://img.shields.io/jetbrains/plugin/v/24451.svg)](https://plugins.jetbrains.com/plugin/24451)
[![Downloads](https://img.shields.io/jetbrains/plugin/d/24451.svg)](https://plugins.jetbrains.com/plugin/24451)

<!-- Plugin description -->
This Fancy IntelliJ Platform Plugin is going to be your implementation of the brilliant ideas that you have.
This plugin provides support for [Higher Order Company's](https://higherorderco.com/) Bend parallel programming language to
the IntelliJ Platform.

_**Warning:** While effort is made to ensure a stable and reliable user experience, this plugin is under heavy
development._

## What is Bend?

Bend is a massively parallel, high-level programming language.

Unlike low-level alternatives like CUDA and Metal, Bend has the feeling and features of expressive languages like
Python and Haskell, including fast object allocations, higher-order functions with full closure support, unrestricted
recursion, even continuations. Yet, it runs on massively parallel hardware like GPUs, with near-linear speedup based on
core count, and zero explicit parallel annotations: no thread spawning, no locks, mutexes, atomics. Bend is powered by
the HVM2 runtime.

This specific section is a source for the [plugin.xml](/src/main/resources/META-INF/plugin.xml) file which will be extracted by the [Gradle](/build.gradle.kts) during the build process.
- [**Get started with Bend**](https://github.com/HigherOrderCO/bend/blob/main/GUIDE.md)

To keep everything working, do not remove `<!-- ... -->` sections.
<!-- Plugin description end -->

---

## Installation

- Using the IDE built-in plugin system:

<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>Marketplace</kbd> > <kbd>Search for "bend-intellij"</kbd> >
<kbd>Install</kbd>

- Manually:
### JetBrains Marketplace

Download the [latest release](https://github.com/lukeribchester/bend-intellij/releases/latest) and install it manually using
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>⚙️</kbd> > <kbd>Install plugin from disk...</kbd>
Install using your IDE's built-in plugin marketplace:

1. Navigate to <kbd>Settings/Preferences</kbd>
2. Select <kbd>Plugins</kbd> > <kbd>Marketplace</kbd>
3. Search for <kbd>'Bend'</kbd>
4. Select <kbd>Install Plugin</kbd>

---
Plugin based on the [IntelliJ Platform Plugin Template][template].
View on the [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/24451-bend).

### Manual

Download the [latest release](https://github.com/lukeribchester/bend-intellij/releases/latest) and install it manually
from disk through your IDE:

[template]: https://github.com/JetBrains/intellij-platform-plugin-template
[docs:plugin-description]: https://plugins.jetbrains.com/docs/intellij/plugin-user-experience.html#plugin-description-and-presentation
1. Navigate to <kbd>Settings/Preferences</kbd>
2. Select <kbd>Plugins</kbd> > <kbd>⚙️</kbd> > <kbd>Install Plugin from Disk...</kbd>
3. Open the downloaded `.zip` file
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html

pluginGroup = com.github.lukeribchester.bendintellij
pluginName = bend-intellij
pluginGroup = com.higherorderco.bend
pluginName = Bend
pluginRepositoryUrl = https://github.com/lukeribchester/bend-intellij
# SemVer format -> https://semver.org
pluginVersion = 0.0.1
Expand All @@ -12,7 +12,7 @@ pluginUntilBuild = 241.*

# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType = IC
platformVersion = 2022.3.3
platformVersion = 2024.1.1

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
Expand Down
Binary file added images/higherorderco-logo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 0 additions & 20 deletions src/main/kotlin/com/github/lukeribchester/bendintellij/MyBundle.kt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 9 additions & 0 deletions src/main/kotlin/com/higherorderco/bend/BendIcons.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.higherorderco.bend

import com.intellij.openapi.util.IconLoader.getIcon
import javax.swing.Icon


object BendIcons {
val FILE: Icon = getIcon("/icons/file.svg", BendIcons::class.java)
}
34 changes: 34 additions & 0 deletions src/main/kotlin/com/higherorderco/bend/language/BendFileType.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.higherorderco.bend.language

import com.higherorderco.bend.BendIcons
import com.intellij.openapi.fileTypes.LanguageFileType
import org.jetbrains.annotations.NotNull
import org.jetbrains.annotations.Nullable
import javax.swing.Icon


class BendFileType private constructor() : LanguageFileType(BendLanguage.INSTANCE) {
@NotNull
override fun getName(): String {
return "Bend File"
}

@NotNull
override fun getDescription(): String {
return "Bend file"
}

@NotNull
override fun getDefaultExtension(): String {
return "bend"
}

@Nullable
override fun getIcon(): Icon {
return BendIcons.FILE
}

companion object {
val INSTANCE: BendFileType = BendFileType()

Check warning on line 32 in src/main/kotlin/com/higherorderco/bend/language/BendFileType.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "INSTANCE" is never used
}
}
10 changes: 10 additions & 0 deletions src/main/kotlin/com/higherorderco/bend/language/BendLanguage.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.higherorderco.bend.language

import com.intellij.lang.Language


object BendLanguage : Language("Bend") {
private fun readResolve(): Any = BendLanguage

val INSTANCE: BendLanguage = BendLanguage
}
17 changes: 10 additions & 7 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<!-- Plugin Configuration File. Read more: https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html -->
<idea-plugin>
<id>com.github.lukeribchester.bendintellij</id>
<name>bend-intellij</name>
<vendor>lukeribchester</vendor>
<id>com.higherorderco.bend</id>
<name>Bend</name>
<vendor>HigherOrderCO</vendor>

<depends>com.intellij.modules.platform</depends>

<resource-bundle>messages.MyBundle</resource-bundle>

<extensions defaultExtensionNs="com.intellij">
<toolWindow factoryClass="com.github.lukeribchester.bendintellij.toolWindow.MyToolWindowFactory" id="MyToolWindow"/>
<!-- File Type -->
<fileType
name="Bend File"
implementationClass="com.higherorderco.bend.language.BendFileType"
fieldName="INSTANCE"
language="Bend"
extensions="bend"/>
</extensions>

<applicationListeners>
<listener class="com.github.lukeribchester.bendintellij.listeners.MyApplicationActivationListener" topic="com.intellij.openapi.application.ApplicationActivationListener"/>
</applicationListeners>
</idea-plugin>
10 changes: 10 additions & 0 deletions src/main/resources/META-INF/pluginIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
10 changes: 10 additions & 0 deletions src/main/resources/icons/file.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions src/main/resources/messages/MyBundle.properties

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions src/test/testData/rename/foo.xml

This file was deleted.

3 changes: 0 additions & 3 deletions src/test/testData/rename/foo_after.xml

This file was deleted.

0 comments on commit 0abab71

Please sign in to comment.