Coder Social home page Coder Social logo

rikvdkleij / intellij-haskell Goto Github PK

View Code? Open in Web Editor NEW
1.3K 20.0 96.0 8.67 MB

IntelliJ plugin for Haskell

Home Page: https://rikvdkleij.github.io/intellij-haskell/

License: Apache License 2.0

HTML 0.10% Scala 83.54% Java 11.48% Lex 3.76% Logos 1.07% Haskell 0.04%
intellij-plugin haskell intellij jetbrains-plugin stack

intellij-haskell's Introduction

logo IntelliJ plugin for Haskell

Join the chat at https://gitter.im/intellij-haskell/Lobby paypal Build

When I was learning Haskell, I missed the nice features of IntelliJ IDEA. My first approach was to use the default way of creating an IntelliJ plugin by defining a grammar and a lexer according to Haskell report. That didn't work out because I could not define all the recursion. Then I decided to use grammar and lexer definitions only for tokenizing and parsing Haskell code, and not for syntax checking the code. This is needed for syntax highlighting, all kinds of navigation, and so on. Further Haskell language support is provided with the help of external tools.

This plugin depends mainly on Stack. It can create new Stack projects and import existing Stack projects.

GHC 8.2.2 and later is supported.

Any feedback is welcomed!!

Installing the plugin

You can install this plugin using the Jetbrains plugin repository: Settings/Plugins/Browse repositories/IntelliJ-Haskell`

Installing the latest beta of the plugin

To try out the latest beta version one can install the plugin by adding https://plugins.jetbrains.com/plugins/alpha/8258 as a custom plugin repository in Settings/Plugins/Browse repositories/Manage repositories.

An alternative way to install the latest beta version is to download IntelliJ-haskell.zip from releases and apply Install plugin from disk in Settings/Plugins.

Features

  • Syntax highlighting;
  • Error/warning highlighting;
  • Haskell Problems View. This tool window displays GHC messages for the currently edited files;
  • Find usages of identifiers;
  • Resolve references to identifiers;
  • Code completion;
  • In-place rename identifiers;
  • View type info from (selected) expression;
  • View sticky type info;
  • View expression info;
  • View quick documentation;
  • View quick definition;
  • Structure view;
  • Goto to declaration (called Navigate>Declaration in IntelliJ menu);
  • Navigate to declaration (called Navigate>Class in IntelliJ menu);
  • Navigate to an identifier (called Navigate> Symbol in IntelliJ menu);
  • Goto instance declaration (called Navigate>Instance Declaration in IntelliJ menu);
  • Navigate to declaration or identifier powered by Hoogle (called Navigate>Navigation by Hoogle in IntelliJ menu);
  • Inspection by HLint;
  • Quick fixes for HLint suggestions;
  • Show error action to view formatted messages. Useful in case message consists of multiple lines (Ctrl-F10, Meta-F10 on Mac OSX);
  • Intention actions to add language extension (depends on compiler error), add top-level type signature (depends on compiler warning);
  • Intention action to select which module to import if the identifier is not in scope;
  • Default code formatting by ormolu. Alternatively by stylish-Haskell.
  • Code completion for project module names, language extensions, and package names in Cabal file;
  • Running REPL, tests, and executables via Run Configurations;
  • Smart code completion on typed holes (since GHC 8.4);

Getting started

  • If you don't already have IntelliJ, download it - the Community Edition is sufficient.
  • Install this plugin using the Jetbrains plugin repository: Settings/Plugins/Browse repositories/IntelliJ-Haskell`. Make sure no other Haskell plugin is installed in IntelliJ;
  • Install the latest version of Stack; use stack upgrade to confirm you are on the latest version.
  • Setup the project:
    • Make sure your Stack project builds without errors. Preferably by using: stack build --test --haddock --no-haddock-hyperlink-source;
    • After your project is built successfully, import an existing project by:
      • Inside IntelliJ use File>New>Project from Existing Sources... from the IntelliJ menu;
      • In the Welcome to IntelliJ IDEA dialog use Open or Import Project;
    • In the New Project wizard select Import project from external model and check Haskell Stack;
    • On the next page of wizard configure Project SDK by configuring Haskell Tool Stack by selecting a path to stack binary, e.g. /usr/local/bin/stack (you can use which stack on Linux or macOS or where stack on windows to find the path);
    • Finish wizard and project will be opened;
    • Wizard will automatically configure which folders are sources, test and which to exclude;
    • Plugin will automatically build Haskell Tools (HLint, Hoogle, Ormolu, and Stylish Haskell) to prevent incompatibility issues
    • Check Project structure>Project settings>Modules which folders to exclude (like .stack-work and dist) and which folders are Source and Test (normally src and test);
    • Plugin will automatically download library sources. They will be added as source libraries to module(s).
    • After changing the Cabal file and/or stack.yaml use Haskell>Haskell>Update Settings and Restart REPLs to download missing library sources and update the project settings;
    • The Event Log will display what's going on in the background. Useful when something fails. It's disabled by default. It can be enabled by checking the Haskell Log checkbox in the Event Log>Settings or Settings>Appearance & Behavior>Notifications;

Remarks

  1. IntelliJ's Build action is not (yet) implemented. Project is built when the project is opened and when needed, e.g. when library code is changed and the user navigates to test code;
  2. About Haskell Project in Help menu shows which Haskell GHC/tools are used by the plugin for the project;
  3. GHC depends on libtinfo-dev. On Ubuntu you can install it with sudo apt-get install libtinfo-dev;
  4. Haskell tools depend on libgmp3-dev zlib1g-dev. On Ubuntu you can install them with sudo apt-get install libgmp3-dev zlib1g-dev;
  5. Cabal's internal libraries are not (yet) supported;
  6. Cabal's common stanzas are not (yet) supported;
  7. The Haskell tools are built in an IntelliJ sandbox with LTS-16. So they have no dependency on Stackage resolvers in your projects. After Stackage LTS-13 minor updates one can use Haskell>Update Haskell tools;
  8. Stack REPLs are running in the background. You can restart them by Haskell>Update Settings and Restart REPLs.

If you want to contribute to this project, read the contributing guideline.

intellij-haskell's People

Contributors

allanwang avatar chrissound avatar declension avatar develop7 avatar epost avatar fantostisch avatar fornever avatar friedbrice avatar garetht avatar gitter-badger avatar i-walker avatar ice1000 avatar ilyakooo0 avatar joprice avatar liff avatar mbwgh avatar ndmitchell avatar nightra avatar oblosys avatar rikvdkleij avatar sgt avatar sh0hei avatar shalokshalom avatar simonit avatar solicode avatar stilianouly avatar thecentury avatar timomeijer avatar vrom911 avatar zjhmale avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

intellij-haskell's Issues

Stack repl crashes when I have a Paths_<pkg-name> module

Whenever I have a line like: import Paths_<module_name> in my source code the load of any dependent source file in intellij-haskell will fail.

One example project where I find this issue is https://github.com/diogob/pg-recorder

An example output from the console:

10:05 AM	[project-stack-repl] errOut: 
				/Users/diogobiazus/src/hevent-shovel/src/HeventShovel/Config.hs:15:1: error:
				Failed to load interface for ‘Paths_hevent_shovel’
				Use -v to see a list of the files searched for.

10:05 AM	Error in file `/Users/diogobiazus/src/hevent-shovel/src/HeventShovel/Config.hs`:  error:
				    Failed to load interface for ‘Paths_hevent_shovel’
				    Use -v to see a list of the files searched for.

Change only the color of the interface

Hi,
Thank you for your excellent work, finally a solution to act on the ui, however, you would it be possible to add the ability (or create a mini project) to change only the color of the default interface (without touching the icons or the style of tabs)
Thank you

PS: I obviously try changing the xml files and .propertie with more or less success ...
Sorry for the translation

Extend selection by expression

Currently "Extend selection" functionality is rather naive (selects the whole function). Haskforce (and emacs) do it by selecting the outer expression, this is very useful when looking at expression types.

Cannot mark folder as source or test

I have my source and test folder for my haskell stuff a bit 'maven style' : src/main contains my code, src/test contains my test code. There doesn't seem to be a way to mark the src/main folder as source and the src/test as test folder, the only thing I can confiure in Settings -> Modules is exclude some folders. The readme of the plugin seems to advertise that it is possible to mark a folder as source or test (from the 'Getting Started' part :
Select in Modules Settings which folders to exclude (like .cabal-sandbox and dist) and which folders are Source and Test (normally src and test))

And the problem with this is that my test code doesn't seem to be taken into account when compiling. Might this also be the reason that I'm not able to run the tests from within IntelliJ or is this just not supported (running tests from within Intellij?)

Renaming

Hello,

I found another problem: In Haskell code when I try to rename a variable, the renaming is not performed within the same let statement.

Example:

    let (firstState, secondState, thirdState) = (0, 1, 2)
        transitions = transitionTable [((firstState, Just 'a'), [secondState]),
                                       ((firstState, Nothing), [thirdState])]

When I rename secondState then the occurrence in the second binding is not affected. When I place the cursor in the second occurrence of secondState it just renames the first one. Same for thirdState. Oddly enough it works for firstState...

stack traces when trying to auto complete

Having auto complete going on when the code doesn't compile seems to give me a lot of stack traces (which, and that is the real issue, slow down my intellij a lot, I don't think it unreasonable that the code completion has issues when the code doesn't compile, so that's more or less fine by me. The stack traces and associated slow down are more annoying.).
The stack trace is :

[ 74993] ERROR - on.CompletionProgressIndicator - Futures timed out after [1 second] java.util.concurrent.TimeoutException: Futures timed out after [1 second] at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:219) at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:223) at scala.concurrent.Await$$anonfun$result$1.apply(package.scala:116) at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:53) at scala.concurrent.Await$.result(package.scala:116) at com.powertuple.intellij.haskell.code.HaskellCompletionContributor.com$powertuple$intellij$haskell$code$HaskellCompletionContributor$$getIdsFromFullScopeImportedModules(HaskellCompletionContributor.scala:186) at com.powertuple.intellij.haskell.code.HaskellCompletionContributor$$anon$1.addCompletions(HaskellCompletionContributor.scala:77) at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36) at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:155) at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:84) at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:132) at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:125) at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$1.addCompletions(LiveTemplateCompletionContributor.java:75) at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36) at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:155) at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:84) at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:115) at com.intellij.codeInsight.completion.CompletionProgressIndicator.calculateItems(CompletionProgressIndicator.java:769) at com.intellij.codeInsight.completion.CompletionProgressIndicator.access$900(CompletionProgressIndicator.java:84) at com.intellij.codeInsight.completion.CompletionProgressIndicator$1CalculateItems.run(CompletionProgressIndicator.java:751) at com.intellij.codeInsight.completion.AsyncCompletion$1$1$1.run(CompletionThreading.java:93) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:911) at com.intellij.codeInsight.completion.AsyncCompletion$1$1.run(CompletionThreading.java:88) at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178) at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212) at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171) at com.intellij.codeInsight.completion.AsyncCompletion$1.run(CompletionThreading.java:84) at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:419) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:149)

Does hlint work?

Inspection by HLint;
Quick fixes for HLint suggestions;

How does it work? I don't see any suggestions.

When ghc-modi reports an error, the plugin times out

Minor nitpick, ghc-modi reported that I should do a cabal install, basically, before I could call ghc-modi. In the idea, ghc-modi kept timing out, so it took me some time to find out what the issue was (until I decided to run ghc-modi myself). Might be an idea to intercept and display that error message instead of timing out. But a minor issue, like I said.

Edit: Maybe I try to fix this myself one of these days, it's not very urgent and seems like within my reach, as complexity goes.

HaskForce & Haskell-idea-plugin & IntelliJ-Haskell

Hi,
This is not an issue, I just want to show you yet another Haskell IntelliJ plugin: http://carymrobbins.github.io/intellij-haskforce in addition to what you mention in README https://github.com/Atsky/haskell-idea-plugin

And now, there is three plugins in active development. Maybe you consider unite yours efforts.
Just wanted to let you know about the existence of each other, guys. Thanks!

/cc @pjonsson @carymrobbins @atsky @vlpolyansky @bronti @octomarat

Add Intention actions

For example to add type signature to where binding or to add parens around expression.

add type signature null pointer

using the latest intellij on mac

foo = ["bar"]

using the "add type signature" intention on foo causes:

null
java.lang.NullPointerException
    at intellij.haskell.annotator.TypeSignatureIntentionAction.invoke(GhcModExternalAnnotator.scala:172)
    at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler$2.run(ShowIntentionActionsHandler.java:188)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1010)
    at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler$3.run(ShowIntentionActionsHandler.java:202)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:85)
    at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.chooseActionAndInvoke(ShowIntentionActionsHandler.java:207)
    at com.intellij.codeInsight.intention.impl.IntentionListStep$2$1.run(IntentionListStep.java:260)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.a(LaterInvocator.java:337)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:321)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:866)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Go to declaration issue

when i press ⌘-b on OSX, it will jump to other usage place of a symbol instead of its declaration on the top level, i use IDEA 15.0.2 Build #IC-143.1184.

Green background for whitespace, commas and semicolons

Using the Default color scheme, all whitespace gets a green background that stretches to the right end of the window. Commas and semicolons are also affected. The Darcula color scheme looks fine.

The reason seems to be that HS_DEFAULT tokens inherit their color from DOC_COMMENT_MARKUP, which is green. There isn't really a suitable token-type candidate for Default in 'Default language', as the token types are all for actual tokens, not whitespace.

I've put together a fix, for which I'll create a pull request. It removes the style for whitespace, and makes Default inherit from the non-green Comma style. It may need some additional work though, as Default is not very descriptive. A better solution might be to have separate token types for comma, semicolon, etc., or to group them in sets with meaningful names.

Upload to a repository?

Could you please upload this wonderful plugin to a certain repository for easy installation?
Thanks!

SDK creation fails if path ends in /stack

When first setting this up, I tried to set /home/chris/.nix-profile/bin/stack as the path to Stack when creating the SDK, since that's my path to Stack. The first several times it failed silently; the dialog closed and no SDK was added. After a restart of IntelliJ, it started giving an error popup "The selected directory is not a valid home for Stack binary".

It took me a while to figure out that it's actually asking for the path of a directory that contains a stack executable, not the path of a stack executable. It probably ought to either be able to strip the /stack from the end on it or have better failure behavior.

intellij community 2016.2.4

intellij-haskell 1.0.0-beta

Some problem with stack repl

Hello @rikvdkleij I got this log

03:16   [project-stack-repl] Build is starting

03:16   [project-stack-repl] Build command is `stack build --test --only-dependencies --haddock --fast`

03:16   [project-stack-repl] Build is finished

03:16   [project-stack-repl] Stack repl will be started with command: /usr/local/Cellar/haskell-stack/1.2.0_2/bin/stack repl --with-ghc intero --verbosity warn --fast --no-load --no-build --ghc-options -v1 --terminal --test

03:16   [project-stack-repl] The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
            * * * * * * * *
            The main module to load is ambiguous. Candidates are: 
            1. Package `haskell-app' component exe:haskell-app-exe with main-is file: /Users/gromm/work/haskell-app/app/Main.hs
            2. Package `haskell-app' component test:haskell-app-test with main-is file: /Users/gromm/work/haskell-app/test/Spec.hs
            You can specify which one to pick by: 
            * Specifying targets to stack ghci e.g. stack ghci haskell-app:exe:haskell-app-exe
            * Specifying what the main is e.g. stack ghci --main-is haskell-app:exe:haskell-app-exe
            * Choosing from the candidate above [1..2]
            * * * * * * * *


03:16   [project-stack-repl] Could not start Stack repl. Make sure you have set right path to Stack in settings.

03:16   [project-stack-repl] Error message while trying to start Stack repl: Stream closed

03:16   [project-stack-repl] Error while shutting down Stack repl for project haskell-app. Error message: Stream closed

I don't understand why. In my terminal stack repl is available

ghc-modi integration

I think there's an issue with the way you interact with ghc-modi. For example, if I create a module, called A, and I unfortunately put my cursor in the first line, the same line as mentions

module A where

you seem to call ghc-modi with the instruction

info A.hs A

Ghc-modi will then answer 'Cannot find info' (tried this directly on ghc-modi, command line) to inform the user that it didn't find this information. However, the plugin interprets this 'cannot find info' as if there's something wrong with ghc-modi, it seems to get interpreted as a Future that timed out and ghc-modi will not be called for 5 seconds. (Error in communication with ghc-modi: Futures timed out after [1 second]. Check if GHC SDK is set and ghc-modi is okay. ghc-modi will not be called for 5 seconds). This makes the plugin not having any type information anymore for the next 5s.

Error in communication with ghc-modi

Hello, I'm trying to use this plugin (version 0.9) with Intellij Idea 14.0.2 on Win8.1 64 bit
All seems to work, but I'm getting weird error every 5-10 seconds along with IDE freeze

Error in communication with ghc-modi: Futures timed out after [5 seconds]. 
Check if GHC SDK is set and ghc-modi is okay. ghc-modi will not be called for 5 seconds

I am able to run ghc ghc-mod or ghc-modi from terminal in my project's root directory.
Paths in Settings -> Other -> Haskell are also correct

Add support for IntelliJ 2016.2

Since upgrading to the latest version, the intellij-haskell plugin is reported as incompatible. Opening old Haskell projects will result in the following error message:

Unknown Module Type
Cannot determine module type ("HASKELL_MODULE") for the following module:"haskell-project"
The module will be treated as a Unknown module.

Stream closed

I always get this error message,what can I do about it?
Error in communication with ghc-mod: Stream closed. Check if GHC SDK is set and ghc-mod is okay. ghc-mod will not be called for 5 seconds. Command was: check /Users/pzwu/outwork/haskell/yesodtest/app/Main.hs

my config
cabal: /usr/local/bin/cabal
hlint: /Users/pzwu/.cabal/bin/hlint
haskell-docs: /Users/pzwu/.local/bin/haskell-docs
ghc-mod: /Users/pzwu/.cabal/bin/ghc-mod

"Stack repl is not yet available"

The event log prints this many times:

12:02 AM [project-stack-repl] Stack repl is not yet available. Command was: :load /home/chris/foo/Foo.hs

There are no other messages, and I don't know what this message means. I'm not trying to use a REPL; I'd just like compile messages to show up in the editor. I haven't managed to get this plugin to do anything yet. Really excited about getting it working though :)

intellij community 2016.2.4

intellij-haskell 1.0.0-beta

My distro is NixOS, in case that's relevant (since it often is with this sort of thing...)

"Go to declaration" either goes to a wrong place, or searches for usages instead

Note: Both Ctrl-B and Ctrl-LClick are bound to "Go to declaration" action, and nothing else. Both those shortcuts result in the same behaviour, as does picking "Go to declaration" from the popup menu.

Source file and project in question: https://github.com/KarolS/PlaylistSubscriber/blob/master/src/PlaylistSubscriber/PersistentSet.hs

    readPersistentSet :: PersistentSet a -> IO [a]
    readPersistentSet s = do
        let p = persistentSetPath s
        exists <- doesFileExist p
        if exists
        then do
            contents <- readFile p
            return $ map (persistentSetDeserialization s) $ filter (/="") $ lines contents
        else return []

In the above function, if I ctrl-click on IO, Intellij starts searching for usages of IO instead. The same with lines, readFile, and many others. A small popup "Show usages" shows when I'm holding down Ctrl and hovering mouse over the identifier.

If I ctrl-click on persistentSetPath, persistentSetDeserialization, contents, PersistentSet, then it behaves correctly and jumps to the declaration.

If I ctrl-click on the first return, it jumps to the second return.

If I ctrl-click on any usage of PersistentSet in Main.hs, then it works correctly, but all cross-project jumps don't.


Ubuntu 14.04, Intellij-Haskell 0.81, Intellij IDEA 14.1.1, Cabal 1.20.0.2, GHC 7.6.3, ghc-mod 4.1.3

slow down/hang of project when editing

Hi,

Lately, as my project is growing a little bigger, I seem to experience rather long lag when editing through intellij. The IDE can become unresponsive for one or two seconds even. Do you have an idea why this could happen, something that triggers upon saving or so (I think intellij constantly 'saves' in the background, so this might explain).

Unfortunately, you will likely not see it in my talisman project, I have it with the project at work, which is proprietary so I can't really share it. I'm just looking if you would have an idea what might be going on or whether you maybe already have a suspect in your sights?

Kasper

how to contribute

Hello guys,

I'm learning haskell as well and i also have an idea to develop an intellij plugin in scala.

i'm cloning this project on my pc but when trying to open it, intellij says following
Cannot determine module type ("PLUGIN_MODULE") for the following module:"intellij-haskell" The module will be treated as a Unknown module.

What's going wrong here ? Can anyone help please ?

Getting started

I'm trying to follow the instructions for getting started in the README. It says to use File > New Project. Is this correct? In IntelliJ 14.1, there's an option for new project from existing sources. Should I be using that instead?

Thanks!

Feature request: Auto-Indent & Reformat code

First all, many thanks for creating this plugin, it's already a god-sent... Plugin is working fine with latest versions of stack and ghc 8 to boot...

First of all, the feature 'Keep indent on empty lines' in style settings are already usable, but it would be nice to have the ability quickly reformat a source code file according to styling rules as is already the case for other languages.

An 'optimize imports' solution would also be nice.

Keep up the great work!

Plugin crashes on welcome page, when I click `Create New Project`

Here are the logs:

2016-05-27 17:44:55,371 [  52664]  ERROR - llij.ide.plugins.PluginManager - org.jetbrains.haskell.module.HaskellModuleType cannot be cast to intellij.haskell.module.HaskellModuleType 
java.lang.ClassCastException: org.jetbrains.haskell.module.HaskellModuleType cannot be cast to intellij.haskell.module.HaskellModuleType
    at intellij.haskell.module.HaskellModuleType$.getInstance(HaskellModuleType.scala:57)
    at intellij.haskell.module.HaskellModuleBuilder.getModuleType(HaskellModuleBuilder.scala:32)
    at com.intellij.ide.util.projectWizard.ModuleBuilder.getModuleTypeName(ModuleBuilder.java:384)
    at com.intellij.ide.util.projectWizard.ModuleBuilder.getPresentableName(ModuleBuilder.java:380)
    at com.intellij.ide.util.newProjectWizard.TemplatesGroup.<init>(TemplatesGroup.java:61)
    at com.intellij.ide.projectWizard.ProjectTypeStep.fillTemplatesMap(ProjectTypeStep.java:296)
    at com.intellij.ide.projectWizard.ProjectTypeStep.<init>(ProjectTypeStep.java:134)
    at com.intellij.ide.projectWizard.NewProjectWizard.init(NewProjectWizard.java:50)
    at com.intellij.ide.projectWizard.NewProjectWizard.<init>(NewProjectWizard.java:39)
    at com.intellij.ide.actions.NewProjectAction.actionPerformed(NewProjectAction.java:30)
    at com.intellij.ui.components.labels.ActionLink$1.linkSelected(ActionLink.java:64)
    at com.intellij.ui.components.labels.LinkLabel.doClick(LinkLabel.java:116)
    at com.intellij.ui.components.labels.ActionLink.doClick(ActionLink.java:77)
    at com.intellij.ui.components.labels.LinkLabel$MyMouseHandler.mouseReleased(LinkLabel.java:287)
    at java.awt.Component.processMouseEvent(Component.java:6533)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6298)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:857)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:386)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2016-05-27 17:44:55,372 [  52665]  ERROR - llij.ide.plugins.PluginManager - IntelliJ IDEA 2016.1.2  Build #IC-145.972.3 
2016-05-27 17:44:55,372 [  52665]  ERROR - llij.ide.plugins.PluginManager - JDK: 1.8.0_76-release 
2016-05-27 17:44:55,372 [  52665]  ERROR - llij.ide.plugins.PluginManager - VM: OpenJDK 64-Bit Server VM 
2016-05-27 17:44:55,372 [  52665]  ERROR - llij.ide.plugins.PluginManager - Vendor: JetBrains s.r.o 
2016-05-27 17:44:55,372 [  52665]  ERROR - llij.ide.plugins.PluginManager - OS: Mac OS X 
2016-05-27 17:44:55,372 [  52665]  ERROR - llij.ide.plugins.PluginManager - Last Action: $SelectAll 

High cpu usage with ghc-mod

sometimes when auto complete code, it will get stucked and freeze IDEA.

2016-04-24 11 50 58

i currently use

ghc-mod version 5.5.0.0 compiled by GHC 7.10.3

Haskell indentation behaving erratically

Hello,

First of all I'd like to express my gratitude for the efforts you put into developing this plugin and maintaining it for the community :-)

I found an annoying problem with the indentation. Given I use record syntax for a datatype, when I add a new line, then the whole declaration keeps marching to the right. I found no way to stop this from happening within IntelliJ; even turning off Smart indent didn't work.
EDIT: Similar things happen with the do syntax.

I have attached a short video to illustrate what's happening. I had to put it into a ZIP file because I don't want to bother with Youtube for an 8 sec screencast.
screencast.zip

EDIT: If these details are not enough for debugging I can provide you with further information. If it is not possible to diagnose and fix, it would also be acceptable for me to be able to turn the feature off completely.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.