Skip to content
This repository has been archived by the owner. It is now read-only.

Vale plugin for IntelliJ #39

Closed
wouter-veeken opened this issue Aug 7, 2020 · 17 comments
Closed

Vale plugin for IntelliJ #39

wouter-veeken opened this issue Aug 7, 2020 · 17 comments

Comments

@wouter-veeken
Copy link

wouter-veeken commented Aug 7, 2020

As requested by @ChrisChinchilla, here's an issue to request a Vale plugin for IntelliJ with "squiggly lines" functionality.

Background: IntelliJ is widely used among devs I work with and they're more likely to follow my Vale styles if they get real-time feedback in their chosen IDE.

@ChrisChinchilla
Copy link
Contributor

ChrisChinchilla commented Aug 7, 2020

Thanks @wouter-veeken so I guess I meant, integrate properly with intellij to output issues in the way that other extensions do.

@jdkato do you think this should integrate with cli or server? Intellij is an edge case as it's not open source, is commercial, but also has free versions, and the platform for creating extensions is monetizable, but open to anyone etc. I'm not sure myself

@settermjd
Copy link

settermjd commented Aug 13, 2020

I'm more than keen to take this on.

@jdkato jdkato transferred this issue from errata-ai/vale Sep 29, 2020
@jillesvangurp
Copy link

jillesvangurp commented Dec 28, 2020

Intellij is an edge case as it's not open source, is commercial, but also has free versions, and the platform for creating extensions is monetizable, but open to anyone etc. I'm not sure myself

The community edition is licensed under the Apache license: https://github.com/JetBrains/intellij-community and freely available. They also have community editions of some of their other products like pycharm.

@jillesvangurp
Copy link

jillesvangurp commented Dec 28, 2020

Two ways to run vale in intellij:

  1. in preferences, tools, external tools add a configuration for vale.
    I used this as the command line arguments:
    --config /Users/jillesvangurp/.vale.ini --output line --sort --relative $FilePathRelativeToProjectRoot$
    and $ProjectFileDir$ as the working directory. I did not manage to get the output filters to work but instead rely on the Awesome Console plugin for this.

  2. execute via a gradle task. Note, lots of room for improvement in this but it works. You can run the gradle task in intellij. I think there's a dedicated vale plugin for gradle as well that you could use instead.

tasks.register("vale") {
    doLast {
        project.exec {
            commandLine("vale", "--config", "/Users/jillesvangurp/.vale.ini", "--output", "line", "--sort", "--relative", "README.md")
        }
    }
}

In both cases, I use the Awesome Console plugin that turns the file names + line numbers in the output into clickable links. The only thing missing is for this to pick up the warnings and highlight them in the file.

@ChrisChinchilla
Copy link
Contributor

ChrisChinchilla commented Dec 28, 2020

Hey @jillesvangurp fancy seeing you here 👋 . I am actually going to finish my plugin writing guide tomorrow, and then hopefully anyone who wants to pick this up can use that to help them. I will also add your steps above to the docs as an integration guide.

@ChrisChinchilla
Copy link
Contributor

ChrisChinchilla commented Dec 29, 2020

Here's that draft guide - #42

@ChrisChinchilla
Copy link
Contributor

ChrisChinchilla commented Dec 29, 2020

And finally @jillesvangurp you mention a grade plugin, but I couldn't find it. Any link?

@jillesvangurp
Copy link

jillesvangurp commented Dec 29, 2020

@ChrisChinchilla https://github.com/jjaderberg/vale-gradle-plugin this one and looks unmaintained.

@ChrisChinchilla
Copy link
Contributor

ChrisChinchilla commented Jan 12, 2021

Hmm @jillesvangurp but it still worked for you?

@ChrisChinchilla
Copy link
Contributor

ChrisChinchilla commented Jan 12, 2021

Could be good just to update that as a basis perhaps 🤔

@jillesvangurp
Copy link

jillesvangurp commented Jan 12, 2021

Did not try it. I don't really need gradle support currently.

@ChrisChinchilla
Copy link
Contributor

ChrisChinchilla commented Feb 12, 2021

I'll add it anyway, this issue is still open for anyone wanting to make a "better" plugin.

@tarasweeney
Copy link

tarasweeney commented Apr 29, 2022

@jillesvangurp I followed your instructions but the checks don't seem to be happening in IntelliJ. They work in the command link. I installed Awesome Console (but am unclear about any config that might need to be done), and configured my external tools:

Arguments: --config /Users//.vale.ini --output line --sort --relative FilePathRelativeToProjectRoot
Working directory: $ProjectFileDir$

image

But, it still isn't showing my errors in IntelliJ. Any thoughts? Thanks!

cc: @ChrisChinchilla @jdkato @wouter-veeken

@jillesvangurp
Copy link

jillesvangurp commented Apr 29, 2022

Sorry not really using this currently. I'd recommend checking out the Jetbrains Grazie plugin that @ChrisChinchilla recently covered on his youtube channel. It integrates vale and a few other things. https://www.youtube.com/watch?v=Y1QvrsH-Dk4

@tarasweeney
Copy link

tarasweeney commented Apr 29, 2022

Got it! To run Vale in IntelliJ:

  1. Install the Awesome Console.
  2. Go to IntelliJ IDEA > Preferences > Tools > External Tools.
  3. Add Vale and enter the following:
    For Arguments: --config /Users//.vale.ini --output line --sort --relative $FilePathRelativeToProjectRoot$
    For Working directory: $ProjectFileDir$
  4. Define a keyboard shortcut or specify an icon for Vale.
  5. Open any file (I am using .adoc) and use your keyboard shortcut, toolbar icon, or go to Tools > External Tools > Vale. The results are shown in the Run window.

@ChrisChinchilla
Copy link
Contributor

ChrisChinchilla commented May 15, 2022

Hmm, well it looks like the guide that I wrote has vanished from the website and replaced with a link to Grazie anyway, so I think this is probably all closed now as that plugin wraps Vale in a kind of way. @jdkato ?

@jdkato
Copy link
Member

jdkato commented May 25, 2022

@ChrisChinchilla, I've updated the page to include both a description of Grazie and a slightly updated version of your guide.

@jdkato jdkato closed this as completed May 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants