GitXplorerGitXplorer
b

linessorterplus

public
5 stars
1 forks
7 issues

Commits

List of commits on branch main.
Unverified
1d987a7af53972e1ce70d0aa9813b7eb15c4fefb

docs: Add link to plugin upload

bbennycode committed a year ago
Unverified
5ee058a34b1bcd4b5d12973e7a6f4dcc53f7aa91

chore: v1.2.0

bbennycode committed a year ago
Unverified
361c5d0c55db63040d1fd43eb26f1083af09bf2a

chore: Update vendor name

bbennycode committed a year ago
Unverified
77b634da70e3ba7bbc54eb23a5572643fa063269

docs: Document SDK selection

bbennycode committed a year ago
Verified
39cb2bb3fee0ccd6021d61c27703029805eb2ace

feat: Add support for json5 and jsonc (#6)

lluca-trigili committed a year ago
Unverified
2c03f80ab42160fb4e5b24623b06bb76456c2ab0

chore: v1.1.0

bbennycode committed 3 years ago

README

The README file for this repository.

Lines Sorter Plus

Lines Sorter Plus is a plugin for the IntelliJ Platform (IDEA, WebStorm, PhpStorm, etc.) which alphabetically sorts texts and JSON objects. This plugin is based on Sylvain Francois' Lines Sorter and emerged from this discussion.

Usage & Installation

Just click on "Edit" and select "Lines Sorter Plus" after you installed this plugin from the JetBrains Marketplace.

You can also activate "Lines Sorter Plus" by pressing Alt + Shift + L:

Demo of Lines Sorter Plus

Info: The plugin differentiates between "selection mode" and "file mode". When you select code with your cursor, then the plugin will format the selected lines of code in "selection mode". When you have no active selection, then the plugin will sort your whole file in "file mode". It supports sorting plaintext and JSON structures (in *.json files).

Development Instructions

Prerequisites

Click "Open Module Settings (F4)" to see your attached SDKs. You need to use Java SDK 11 when targeting IntelliJ IDEA 2020.3 or later (source).

Common Errors

When using a non-fitting JDK, you will see:

Error:java: release version 5 not supported

When using a newer JDK (e.g. Oracle OpenJDK 17.0.1), you will run into:

com.intellij.ide.plugins.StartupAbortedException: UI initialization failed

When you don't have an "IntelliJ Platform Plugin SDK" assigned to this project, the code will fail to import from com.intellij or org.jetbrains:

java: package com.intellij.openapi.actionSystem does not exist

This can be fixed by navigating to "File" - "Project Structure". You should see an "SDK" section where you have to select an "IntelliJ IDEA Community Edition" SDK. If you don't have any, click on "Add SDK" and select "IntelliJ Platform Plugin SDK" (tested with IntelliJ IDEA 2023.2.1, Community Edition):

SDK Selection

Compatibility

Build and tested with:

  • IntelliJ IDEA 2021.3.1 (Community Edition)

Created with the following template:

  • File ➝ New ➝ Project ➝ IntelliJ Platform Plugin (without Gradle)

Logging

When running the plugin, a Sandbox IDE will be started which has the plugin installed. Here is how you can view the logs (with "info" log level) on your system.

With Windows PowerShell:

Get-Content -Path "C:\Users\bn\AppData\Local\JetBrains\IdeaIC2021.3\plugins-sandbox\system\log\idea.log" -Wait

Formatting

Code formatting is done with Prettier which gets installed through npm:

npm install
npm run fix

Staged files in Git get automatically formatted with pretty-quick.

Deployment

  1. Select plugin in the "Project" window
  2. Do a right-click and select "Prepare Plugin Module For Deployment"
  3. Publish .jar file on JetBrains Marketplace through Upload Update

Resources