Skip to content

Commit

Permalink
Big rewrite: Various (performance) improvements and fixes, Windows su…
Browse files Browse the repository at this point in the history
…pport, Added notification to restart REPLs after changing Cabal or Stack file (@zjhmale), Added notification to setup SDK in case no Haskell SDK is set for project, Multi package support, Only one Stack target is loaded per REPL to prevent conflicts, Library sources are downloaded to folder .intellij-haskell inside user's home directory, Hoogle database is not automatically generated anymore while starting project but is become separate action in Tools menu
  • Loading branch information
rikvdkleij committed Jul 26, 2017
1 parent a5ea996 commit 5d22e61
Show file tree
Hide file tree
Showing 162 changed files with 3,699 additions and 2,903 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2014-2017 Rik van der Kleij

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ lazy val intellijHaskell = (project in file(".")).
unmanagedJars in Compile += baseDirectory.value / "idea"
)

ideaBuild in ThisBuild := "172.2656.10"
ideaBuild in ThisBuild := "172.3317.76"
16 changes: 7 additions & 9 deletions gen/intellij/haskell/parser/HaskellParser.java

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

1 change: 1 addition & 0 deletions gen/intellij/haskell/psi/HaskellVisitor.java

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

66 changes: 19 additions & 47 deletions intellij-haskell/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@

<change-notes><![CDATA[
<p>1.0.0-beta9</p>
<b>IMPORTANT: After upgrade reimport your Haskell Stack project and delete folder .ideaHaskellLib inside project's folder</b>
<ul>
<li>Various (performance) improvements and fixes</li>
<li>Windows support in alpha</li>
<li>Windows support</li>
<li>Added notification to restart REPLs after changing Cabal or Stack file (@zjhmale)</li>
<li>Added notification to setup SDK in case no Haskell SDK is set for project</li>
<li>Multi package support</li>
<li>Only one Stack target is loaded per REPL to prevent conflicts</li>
<li>Library sources are downloaded to folder .intellij-haskell inside user's home directory</li>
<li>Hoogle database is not automatically generated anymore while starting project but is become separate action in Tools menu</li>
</ul>
<p>1.0.0-beta8</p>
<ul>
Expand Down Expand Up @@ -181,6 +186,7 @@
<!-- Refactoring support -->
<lang.refactoringSupport language="Haskell"
implementationClass="intellij.haskell.refactor.HaskellRefactoringSupportProvider"/>
<moveFileHandler implementation="intellij.haskell.refactor.HaskellMoveFileHandler"/>

<!-- Commenter -->
<lang.commenter language="Haskell" implementationClass="intellij.haskell.editor.HaskellCommenter"/>
Expand All @@ -203,7 +209,7 @@
implementationClass="intellij.haskell.navigation.HaskellFindUsagesProvider"/>

<!-- Navigation -->
<gotoClassContributor implementation="intellij.haskell.navigation.GotoByDeclarationContributor"/>
<gotoClassContributor implementation="intellij.haskell.navigation.GotoByDeclarationContributor"/>
<gotoSymbolContributor implementation="intellij.haskell.navigation.GotoByNameContributor"/>

<!-- Annotator -->
Expand All @@ -217,7 +223,7 @@
implementationClass="intellij.haskell.editor.HaskellCompletionContributor"/>
<completion.contributor
language="Cabal"
implementationClass="intellij.haskell.cabal.completion.CabalCompletionContributor" />
implementationClass="intellij.haskell.cabal.completion.CabalCompletionContributor"/>
<lookup.charFilter implementation="intellij.haskell.editor.HaskellCompletionCharFilter"/>
<psi.referenceContributor language="Haskell" implementation="intellij.haskell.psi.HaskellReferenceContributor"/>

Expand Down Expand Up @@ -258,8 +264,8 @@
<projectImportBuilder implementation="intellij.haskell.module.StackProjectImportBuilder"/>

<!-- Index -->
<fileBasedIndex implementation="intellij.haskell.util.index.HaskellFileIndex"/>
<fileBasedIndex implementation="intellij.haskell.util.index.HaskellModuleIndex"/>
<fileBasedIndex implementation="intellij.haskell.util.index.HaskellFileNameIndex"/>
<fileBasedIndex implementation="intellij.haskell.util.index.HaskellModuleNameIndex"/>
<stubIndex implementation="intellij.haskell.psi.stubs.index.HaskellAllNameIndex"/>
<stubElementTypeHolder class="intellij.haskell.psi.HaskellTypes"/>

Expand Down Expand Up @@ -303,19 +309,12 @@
</application-components>

<project-components>
<component>
<implementation-class>intellij.haskell.external.repl.GlobalStackReplProcess</implementation-class>
</component>
<component>
<implementation-class>intellij.haskell.external.repl.ProjectStackReplProcess</implementation-class>
</component>
<component>
<implementation-class>intellij.haskell.external.component.StackProjectManager</implementation-class>
</component>

<component>
<implementation-class>intellij.haskell.external.component.HaskellDocumentationProvider
</implementation-class>
<implementation-class>intellij.haskell.external.component.HaskellDocumentationProvider </implementation-class>
</component>
</project-components>

Expand All @@ -325,7 +324,8 @@
<add-to-group group-id="NewGroup" anchor="before" relative-to-action="NewFile"/>
</action>

<group id="HaskellCodeEditor" text="Haskell" description="Haskell View Tools" icon="/icons/[email protected]" popup="true">
<group id="HaskellCodeEditor" text="Haskell" description="Haskell View Tools" icon="/icons/[email protected]"
popup="true">
<action id="Haskell.ShowType" class="intellij.haskell.action.ShowTypeAction"
text="Show Type" description="Show type of (selected) expression">

Expand Down Expand Up @@ -374,39 +374,11 @@
description="Restart Haskell Stack REPLs and refresh cache">
</action>

<action id="Haskell.GenerateHoogleDatabase" class="intellij.haskell.action.GenerateHoogleDbAction"
text="Generate Hoogle database"
description="Generate Haskell documentation and generate local Hoogle database">
</action>
<add-to-group group-id="OtherMenu" anchor="first"/>
</group>

<group id="HaskellRefactorMenu" text="Haskell" description="Haskell Refactoring" icon="/icons/[email protected]" popup="true">
<action id="Haskell.GenerateTypeSignature"
class="intellij.haskell.action.haskelltools.GenerateTypeSignatureAction"
text="Generate type signature"
description="Generate type signature for current binding with haskell-tools">
<keyboard-shortcut first-keystroke="ctrl alt x" keymap="$default"/>
</action>
<action id="Haskell.GenerateExports"
class="intellij.haskell.action.haskelltools.GenerateExportsAction"
text="Generate exports"
description="Generate exports for current file with haskell-tools">
<keyboard-shortcut first-keystroke="ctrl alt g" keymap="$default"/>
</action>
<action id="Haskell.ExtractBinding"
class="intellij.haskell.action.haskelltools.ExtractBindingAction"
text="Extract binding"
description="Extract binding for selected code with haskell-tools">
<keyboard-shortcut first-keystroke="ctrl alt shift b" keymap="$default"/>
</action>
<action id="Haskell.InlineBinding"
class="intellij.haskell.action.haskelltools.InlineBindingAction"
text="Inline binding"
description="Inline binding for (selected) name with haskell-tools">
<keyboard-shortcut first-keystroke="ctrl alt shift k" keymap="$default"/>
<action id="Haskell.BuildHoogleDatabase" class="intellij.haskell.action.BuildHoogleDbAction"
text="(Re)Build Hoogle database"
description="(Re)Generate Haskell documentation and (re)build local Hoogle database">
</action>
<add-to-group group-id="RefactoringMenu" anchor="last"/>
<add-to-group group-id="ToolsMenu" anchor="first"/>
</group>

<group id="HaskellCodeMenu" text="Haskell" description="Haskell Code Tools" icon="/icons/[email protected]" popup="true">
Expand Down Expand Up @@ -445,7 +417,7 @@
class="intellij.haskell.action.GotoInstanceDeclarationAction"
text="Instance Declaration"
description="Goto instance declaration">
<keyboard-shortcut first-keystroke="ctrl alt i" keymap="$default"/>
<keyboard-shortcut first-keystroke="ctrl alt i" keymap="$default"/>
</action>
<add-to-group group-id="GoToMenu" anchor="last"/>
</group>
Expand Down
9 changes: 4 additions & 5 deletions src/main/scala/intellij/haskell/HaskellFile.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 Rik van der Kleij
* Copyright 2014-2017 Rik van der Kleij
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,14 +21,13 @@ import javax.swing._
import com.intellij.extapi.psi.PsiFileBase
import com.intellij.openapi.fileTypes.{FileType, FileTypeConsumer, FileTypeFactory, LanguageFileType}
import com.intellij.psi.FileViewProvider
import intellij.haskell.psi.{HaskellModid, HaskellModuleDeclaration, HaskellPsiUtil}
import org.jetbrains.annotations.NotNull

class HaskellFile(viewProvider: FileViewProvider) extends PsiFileBase(viewProvider, HaskellLanguage.Instance) {

@NotNull
def getFileType: FileType = {
HaskellFileType.INSTANCE
HaskellFileType.Instance
}

override def toString: String = {
Expand All @@ -41,7 +40,7 @@ class HaskellFile(viewProvider: FileViewProvider) extends PsiFileBase(viewProvid
}

object HaskellFileType {
final val INSTANCE: HaskellFileType = new HaskellFileType
final val Instance: HaskellFileType = new HaskellFileType
}

class HaskellFileType extends LanguageFileType(HaskellLanguage.Instance) {
Expand All @@ -65,6 +64,6 @@ class HaskellFileType extends LanguageFileType(HaskellLanguage.Instance) {

class HaskellLanguageFileTypeFactory extends FileTypeFactory {
def createFileTypes(consumer: FileTypeConsumer) {
consumer.consume(HaskellFileType.INSTANCE, HaskellFileType.INSTANCE.getDefaultExtension)
consumer.consume(HaskellFileType.Instance, HaskellFileType.Instance.getDefaultExtension)
}
}
2 changes: 1 addition & 1 deletion src/main/scala/intellij/haskell/HaskellIcons.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 Rik van der Kleij
* Copyright 2014-2017 Rik van der Kleij
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/intellij/haskell/HaskellLanguage.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 Rik van der Kleij
* Copyright 2014-2017 Rik van der Kleij
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/intellij/haskell/HaskellLexerAdapter.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 Rik van der Kleij
* Copyright 2014-2017 Rik van der Kleij
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 Rik van der Kleij
* Copyright 2014-2017 Rik van der Kleij
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@ package intellij.haskell

import javax.swing.event.HyperlinkEvent

import com.intellij.notification.{Notification, NotificationDisplayType, NotificationGroup, NotificationListener}
import com.intellij.notification._
import com.intellij.openapi.fileEditor.OpenFileDescriptor
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.MessageType
Expand All @@ -28,7 +28,7 @@ import com.intellij.openapi.vfs.LocalFileSystem
object HaskellNotificationGroup {

private val LogOnlyGroup = new NotificationGroup("Haskell Log", NotificationDisplayType.NONE, false)
private val BalloonGroup = new NotificationGroup("Haskell Balloon", NotificationDisplayType.BALLOON, false)
private val BalloonGroup = new NotificationGroup("Haskell Balloon", NotificationDisplayType.BALLOON, true)

def logErrorEvent(project: Option[Project], message: String) {
logEvent(project, message, ERROR, LogOnlyGroup.createNotification)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 Rik van der Kleij
* Copyright 2014-2017 Rik van der Kleij
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/intellij/haskell/_HaskellLexer.flex
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ hexadecimal = 0[xX]{hexit}+
octit = [0-7]
octal = 0[oO]{octit}+

float = [-+]?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)([eE][-+]?[0-9]+)?
float = [-+]?([0-9]+(\.[0-9]*)?|\.[0-9]+)([eE][-+]?[0-9]+)?

gap = \\({white_char}|{newline})*\\
cntrl = {large} | [@\[\\\]\^_]
Expand Down
Loading

0 comments on commit 5d22e61

Please sign in to comment.