├── project
├── build.properties
└── plugins.sbt
├── src
├── main
│ ├── resources
│ │ ├── ghci
│ │ │ ├── default.ghci
│ │ │ └── 8.2.1.ghci
│ │ ├── intentionDescriptions
│ │ │ ├── AddParensIntention
│ │ │ │ ├── before.hs.template
│ │ │ │ ├── after.hs.template
│ │ │ │ └── description.html
│ │ │ ├── RemoveParensIntention
│ │ │ │ ├── after.hs.template
│ │ │ │ ├── before.hs.template
│ │ │ │ └── description.html
│ │ │ └── CaseSplitIntention
│ │ │ │ ├── after.hs.template
│ │ │ │ ├── before.hs.template
│ │ │ │ └── description.html
│ │ ├── fileTemplates
│ │ │ └── internal
│ │ │ │ ├── Haskell Module.hs.ft
│ │ │ │ ├── Haskell Test Module.hs.ft
│ │ │ │ ├── Alex Source.x.ft
│ │ │ │ ├── Alex Source.x.html
│ │ │ │ ├── Haskell Module.hs.html
│ │ │ │ └── Haskell Test Module.hs.html
│ │ ├── icons
│ │ │ ├── hs.png
│ │ │ ├── alex.png
│ │ │ ├── cabal.png
│ │ │ ├── class.png
│ │ │ ├── data.png
│ │ │ ├── hs@2x.png
│ │ │ ├── module.png
│ │ │ ├── type.png
│ │ │ ├── alex@2x.png
│ │ │ ├── cabal@2x.png
│ │ │ ├── foreign.png
│ │ │ ├── instance.png
│ │ │ ├── newtype.png
│ │ │ ├── haskell@16.png
│ │ │ ├── type_family.png
│ │ │ ├── haskell@16@2x.png
│ │ │ ├── type_instance.png
│ │ │ ├── haskell-blue@16.png
│ │ │ ├── type_signature.png
│ │ │ ├── haskell-blue@16@2x.png
│ │ │ └── default_declaration.png
│ │ ├── inspectionDescriptions
│ │ │ └── HLintInspection.html
│ │ └── dictionary
│ │ │ └── haskell.dic
│ └── scala
│ │ └── intellij
│ │ └── haskell
│ │ ├── cabal
│ │ ├── lang
│ │ │ ├── psi
│ │ │ │ ├── impl
│ │ │ │ │ ├── ExtensionsImpl.scala
│ │ │ │ │ ├── GhcOptionsImpl.scala
│ │ │ │ │ ├── CabalElementTypeError.scala
│ │ │ │ │ ├── MainIsImpl.scala
│ │ │ │ │ ├── SourceDirsImpl.scala
│ │ │ │ │ ├── CabalNamedElementImpl.scala
│ │ │ │ │ ├── ExposedModulesImpl.scala
│ │ │ │ │ ├── IdentListFieldImpl.scala
│ │ │ │ │ ├── CabalElementImplUtil.scala
│ │ │ │ │ ├── ModuleImpl.scala
│ │ │ │ │ └── BuildDependsImpl.scala
│ │ │ │ ├── CabalPsiUtil.scala
│ │ │ │ ├── CabalElementType.java
│ │ │ │ ├── CabalReference.scala
│ │ │ │ └── CabalNamedElementManipulator.scala
│ │ │ └── lexer
│ │ │ │ └── CabalParsingLexer.scala
│ │ ├── highlighting
│ │ │ ├── CabalSyntaxHighlightingLexer.scala
│ │ │ ├── CabalSyntaxHighlighterFactory.scala
│ │ │ └── CabalAnnotator.scala
│ │ ├── CabalFileType.java
│ │ ├── CabalCommenter.scala
│ │ ├── CabalLanguage.java
│ │ └── CabalFile.scala
│ │ ├── alex
│ │ ├── lang
│ │ │ ├── psi
│ │ │ │ ├── AlexElement.scala
│ │ │ │ ├── AlexTokenType.scala
│ │ │ │ ├── impl
│ │ │ │ │ ├── AlexElementImpl.scala
│ │ │ │ │ └── AlexElementManipulator.scala
│ │ │ │ └── AlexHaskellInjector.scala
│ │ │ ├── lexer
│ │ │ │ └── AlexLexer.scala
│ │ │ └── AlexBraceMatcher.scala
│ │ ├── AlexFile.scala
│ │ ├── highlighting
│ │ │ └── AlexSyntaxHighlighterFactory.scala
│ │ ├── AlexLanguage.java
│ │ └── AlexFileType.java
│ │ ├── HaskellLexer.java
│ │ ├── spellchecker
│ │ ├── HaskellBundledDictionaryProvider.scala
│ │ ├── CabalSpellcheckingStrategy.scala
│ │ └── HaskellSpellcheckingStrategy.scala
│ │ ├── runconfig
│ │ ├── console
│ │ │ ├── HaskellConsoleHighlightingUtil.scala
│ │ │ ├── HaskellConsoleProcessHandler.scala
│ │ │ ├── HaskellConsoleConfigurationFactory.scala
│ │ │ ├── HaskellConsoleActionPromoter.scala
│ │ │ ├── HaskellConsoleExecuteAction.scala
│ │ │ ├── HaskellConsoleViewMap.scala
│ │ │ └── HaskellConsoleConfiguration.scala
│ │ ├── run
│ │ │ └── HaskellRunConfigurationFactory.scala
│ │ ├── test
│ │ │ └── HaskellTestConfigurationFactory.scala
│ │ └── HaskellStackConfigurationType.scala
│ │ ├── util
│ │ ├── HtmlElement.scala
│ │ └── FutureUtil.scala
│ │ ├── HTool.scala
│ │ ├── navigation
│ │ └── HaskellTargetElementUtil2.scala
│ │ ├── psi
│ │ ├── HaskellQualifierElement.scala
│ │ ├── HaskellExpressionElement.scala
│ │ ├── HaskellQuasiQuoteElement.scala
│ │ ├── HaskellStringLiteralElement.scala
│ │ ├── HaskellCompositeElement.scala
│ │ ├── impl
│ │ │ ├── HaskellQuasiQuoteElementImpl.scala
│ │ │ ├── HaskellStringLiteralElementImpl.scala
│ │ │ └── HaskellQuasiQuoteManipulator.scala
│ │ ├── HaskellDataConstructorDeclarationElement.scala
│ │ ├── HaskellDeclarationElement.scala
│ │ ├── HaskellQualifiedNameElement.scala
│ │ ├── stubs
│ │ │ ├── types
│ │ │ │ ├── HaskellVarsymStubElementType.scala
│ │ │ │ └── HaskellStubElementType.scala
│ │ │ ├── HaskellModidStub.java
│ │ │ ├── HaskellVaridStub.java
│ │ │ └── index
│ │ │ │ └── HaskellAllNameIndex.scala
│ │ ├── HaskellCompositeElementType.scala
│ │ ├── HaskellNamedElement.scala
│ │ ├── HaskellNamedElementManipulator.scala
│ │ └── HaskellTokenType.scala
│ │ ├── HaskellLexerAdapter.scala
│ │ ├── sdk
│ │ └── HaskellStackVersionValidator.scala
│ │ ├── action
│ │ ├── ghci
│ │ │ ├── ReloadModulesAction.scala
│ │ │ ├── ReloadWithLastCommandAction.scala
│ │ │ └── LoadModuleAction.scala
│ │ └── UpdateHaskellToolsAction.scala
│ │ ├── ui
│ │ └── EnterNameDialog.scala
│ │ ├── editor
│ │ ├── HaskellCodeFoldingOptionsProvider.java
│ │ ├── HaskellQuoteHandler.scala
│ │ └── formatter
│ │ │ └── settings
│ │ │ └── HaskellCodeStyleSettings.scala
│ │ ├── HaskellFileType.java
│ │ ├── HaskellLanguage.java
│ │ ├── intention
│ │ └── RemoveParensIntention.scala
│ │ ├── external
│ │ └── component
│ │ │ └── package.scala
│ │ ├── HaskellFile.scala
│ │ └── highlighter
│ │ └── HaskellSyntaxHighlighterFactory.java
└── test
│ ├── testData
│ ├── parsing-hs
│ │ ├── Pragma.hs
│ │ └── ComplicatedPragma.hs
│ └── parsing
│ │ ├── MixedStatefulStateless.x
│ │ ├── Simple.x
│ │ ├── Rules.x
│ │ └── RuleDescription.x
│ └── scala
│ └── intellij
│ └── haskell
│ ├── HaskellParsingTest.scala
│ └── alex
│ └── AlexParsingTest.scala
├── images
├── Modules.png
├── Project.png
├── IntelliJ SDK.png
├── Jetbrains JDK.png
├── Run configuration.png
└── Intellij Haskell module.png
├── logo
├── icon_intellij_haskell_128.png
├── icon_intellij_haskell_16.png
├── icon_intellij_haskell_24.png
├── icon_intellij_haskell_256.png
├── icon_intellij_haskell_32.png
├── icon_intellij_haskell_48.png
├── icon_intellij_haskell_512.png
└── icon_intellij_haskell_64.png
├── .gitignore
├── docs
└── IntelliJ-Haskell talk at A'dam Haskell Meetup.pdf
├── gen
└── intellij
│ └── haskell
│ ├── .editorconfig
│ ├── psi
│ ├── HaskellDerivingVia.java
│ ├── HaskellQuasiQuote.java
│ ├── HaskellDotDot.java
│ ├── HaskellComments.java
│ ├── HaskellImportHiding.java
│ ├── HaskellImportEmptySpec.java
│ ├── HaskellImportQualified.java
│ ├── HaskellGeneralPragmaContent.java
│ ├── HaskellGtycon.java
│ ├── HaskellListType.java
│ ├── HaskellQNames.java
│ ├── HaskellFileHeader.java
│ ├── HaskellTypeEquality.java
│ ├── HaskellFixityDeclaration.java
│ ├── HaskellImportQualifiedAs.java
│ ├── HaskellImportPackageName.java
│ ├── HaskellPragma.java
│ ├── HaskellTextLiteral.java
│ ├── HaskellCdecls.java
│ ├── HaskellInstvar.java
│ ├── HaskellCcontext.java
│ ├── HaskellCidecls.java
│ ├── HaskellExports.java
│ ├── HaskellKindSignature.java
│ ├── HaskellConstr.java
│ ├── HaskellScontext.java
│ ├── HaskellConstr3.java
│ ├── HaskellImportIdsSpec.java
│ ├── HaskellSimpleclass.java
│ ├── HaskellDataDeclarationDeriving.java
│ ├── HaskellCdecl.java
│ ├── HaskellImportDeclarations.java
│ ├── HaskellInst.java
│ ├── HaskellNewconstrFielddecl.java
│ ├── HaskellConstr1.java
│ ├── HaskellImportHidingSpec.java
│ ├── HaskellImportId.java
│ ├── HaskellImportSpec.java
│ ├── HaskellConstr2.java
│ ├── HaskellExport.java
│ ├── HaskellQName.java
│ ├── HaskellNewconstr.java
│ ├── HaskellQConQualifier.java
│ ├── HaskellFielddecl.java
│ ├── HaskellVarCon.java
│ ├── HaskellTypeFamilyType.java
│ ├── HaskellQCon.java
│ ├── HaskellExpression.java
│ ├── HaskellShebangLine.java
│ ├── HaskellModuleBody.java
│ ├── HaskellQVarCon.java
│ ├── HaskellCdeclDataDeclaration.java
│ ├── HaskellQConQualifier1.java
│ ├── HaskellQualifier.java
│ ├── HaskellSimpletype.java
│ ├── HaskellQConQualifier2.java
│ ├── HaskellQConQualifier3.java
│ ├── HaskellQConQualifier4.java
│ ├── HaskellForeignDeclaration.java
│ ├── HaskellClazz.java
│ ├── HaskellConid.java
│ ├── HaskellVarid.java
│ ├── HaskellConsym.java
│ ├── HaskellTypeInstanceDeclaration.java
│ ├── HaskellVarsym.java
│ ├── HaskellModid.java
│ ├── HaskellTtype.java
│ ├── HaskellImportDeclaration.java
│ ├── HaskellModuleDeclaration.java
│ ├── HaskellDefaultDeclaration.java
│ ├── HaskellTypeSignature.java
│ ├── HaskellTypeFamilyDeclaration.java
│ ├── impl
│ │ ├── HaskellQuasiQuoteImpl.java
│ │ ├── HaskellDerivingViaImpl.java
│ │ ├── HaskellDotDotImpl.java
│ │ ├── HaskellCommentsImpl.java
│ │ ├── HaskellTextLiteralImpl.java
│ │ ├── HaskellImportHidingImpl.java
│ │ ├── HaskellImportEmptySpecImpl.java
│ │ ├── HaskellImportQualifiedImpl.java
│ │ ├── HaskellGeneralPragmaContentImpl.java
│ │ ├── HaskellGtyconImpl.java
│ │ ├── HaskellListTypeImpl.java
│ │ ├── HaskellQNamesImpl.java
│ │ ├── HaskellFileHeaderImpl.java
│ │ ├── HaskellTypeEqualityImpl.java
│ │ ├── HaskellPragmaImpl.java
│ │ ├── HaskellFixityDeclarationImpl.java
│ │ ├── HaskellImportQualifiedAsImpl.java
│ │ ├── HaskellImportPackageNameImpl.java
│ │ ├── HaskellInstvarImpl.java
│ │ ├── HaskellConstr3Impl.java
│ │ ├── HaskellSimpleclassImpl.java
│ │ └── HaskellKindSignatureImpl.java
│ ├── HaskellDerivingDeclaration.java
│ ├── HaskellClassDeclaration.java
│ ├── HaskellInstanceDeclaration.java
│ ├── HaskellTypeDeclaration.java
│ ├── HaskellCidecl.java
│ ├── HaskellNewtypeDeclaration.java
│ └── HaskellDataDeclaration.java
│ └── alex
│ └── lang
│ └── psi
│ ├── AlexIdentifier.java
│ ├── AlexRegexPart.java
│ ├── AlexWrapperType.java
│ ├── AlexTopModuleSection.java
│ ├── AlexUserCodeSection.java
│ ├── AlexRuleId.java
│ ├── AlexTokenSetId.java
│ ├── AlexTokensSection.java
│ ├── AlexDeclarationsSection.java
│ ├── AlexStatelessTokensRule.java
│ ├── AlexRegex.java
│ ├── AlexRuleDeclaration.java
│ ├── AlexRuleDescription.java
│ ├── AlexTokenSetDeclaration.java
│ ├── AlexDeclaration.java
│ ├── AlexTokensRule.java
│ ├── AlexStatefulTokensRule.java
│ └── impl
│ ├── AlexRuleIdImpl.java
│ ├── AlexRegexPartImpl.java
│ ├── AlexIdentifierImpl.java
│ ├── AlexTokenSetIdImpl.java
│ ├── AlexWrapperTypeImpl.java
│ ├── AlexUserCodeSectionImpl.java
│ ├── AlexTopModuleSectionImpl.java
│ ├── AlexTokensSectionImpl.java
│ ├── AlexStatelessTokensRuleImpl.java
│ ├── AlexDeclarationsSectionImpl.java
│ ├── AlexRegexImpl.java
│ ├── AlexRuleDescriptionImpl.java
│ ├── AlexRuleDeclarationImpl.java
│ ├── AlexDeclarationImpl.java
│ ├── AlexTokensRuleImpl.java
│ ├── AlexTokenSetDeclarationImpl.java
│ └── AlexStatefulTokensRuleImpl.java
├── .github
├── workflows
│ └── scala.yml
└── FUNDING.yml
├── intellij-haskell
└── intellij-haskell.iml
└── .run
└── IntelliJ-Haskell.run.xml
/project/build.properties:
--------------------------------------------------------------------------------
1 | sbt.version=1.6.2
2 |
--------------------------------------------------------------------------------
/src/main/resources/ghci/default.ghci:
--------------------------------------------------------------------------------
1 | :set +m
2 | :set prompt ""
3 | :set prompt2 ""
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/AddParensIntention/before.hs.template:
--------------------------------------------------------------------------------
1 | 1 + 2
--------------------------------------------------------------------------------
/src/main/resources/ghci/8.2.1.ghci:
--------------------------------------------------------------------------------
1 | :set +m
2 | :set prompt ""
3 | :set prompt-cont ""
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/AddParensIntention/after.hs.template:
--------------------------------------------------------------------------------
1 | (1 + 2)
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/RemoveParensIntention/after.hs.template:
--------------------------------------------------------------------------------
1 | 1 + 2
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/RemoveParensIntention/before.hs.template:
--------------------------------------------------------------------------------
1 | (1 + 2)
--------------------------------------------------------------------------------
/src/main/resources/fileTemplates/internal/Haskell Module.hs.ft:
--------------------------------------------------------------------------------
1 | module ${NAME} where
2 |
3 |
--------------------------------------------------------------------------------
/images/Modules.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/images/Modules.png
--------------------------------------------------------------------------------
/images/Project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/images/Project.png
--------------------------------------------------------------------------------
/images/IntelliJ SDK.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/images/IntelliJ SDK.png
--------------------------------------------------------------------------------
/images/Jetbrains JDK.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/images/Jetbrains JDK.png
--------------------------------------------------------------------------------
/src/test/testData/parsing-hs/Pragma.hs:
--------------------------------------------------------------------------------
1 | {-# Hey #-}
2 | {-# LANGUAGE OhMyGod #-}
3 | {-# OPTIONS_GHC --omG #-}
4 |
--------------------------------------------------------------------------------
/images/Run configuration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/images/Run configuration.png
--------------------------------------------------------------------------------
/src/main/resources/icons/hs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/hs.png
--------------------------------------------------------------------------------
/images/Intellij Haskell module.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/images/Intellij Haskell module.png
--------------------------------------------------------------------------------
/logo/icon_intellij_haskell_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/logo/icon_intellij_haskell_128.png
--------------------------------------------------------------------------------
/logo/icon_intellij_haskell_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/logo/icon_intellij_haskell_16.png
--------------------------------------------------------------------------------
/logo/icon_intellij_haskell_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/logo/icon_intellij_haskell_24.png
--------------------------------------------------------------------------------
/logo/icon_intellij_haskell_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/logo/icon_intellij_haskell_256.png
--------------------------------------------------------------------------------
/logo/icon_intellij_haskell_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/logo/icon_intellij_haskell_32.png
--------------------------------------------------------------------------------
/logo/icon_intellij_haskell_48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/logo/icon_intellij_haskell_48.png
--------------------------------------------------------------------------------
/logo/icon_intellij_haskell_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/logo/icon_intellij_haskell_512.png
--------------------------------------------------------------------------------
/logo/icon_intellij_haskell_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/logo/icon_intellij_haskell_64.png
--------------------------------------------------------------------------------
/src/main/resources/fileTemplates/internal/Haskell Test Module.hs.ft:
--------------------------------------------------------------------------------
1 | module ${NAME} where
2 |
3 | import qualified ${SUT_NAME} as SUT
--------------------------------------------------------------------------------
/src/main/resources/icons/alex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/alex.png
--------------------------------------------------------------------------------
/src/main/resources/icons/cabal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/cabal.png
--------------------------------------------------------------------------------
/src/main/resources/icons/class.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/class.png
--------------------------------------------------------------------------------
/src/main/resources/icons/data.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/data.png
--------------------------------------------------------------------------------
/src/main/resources/icons/hs@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/hs@2x.png
--------------------------------------------------------------------------------
/src/main/resources/icons/module.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/module.png
--------------------------------------------------------------------------------
/src/main/resources/icons/type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/type.png
--------------------------------------------------------------------------------
/src/main/resources/icons/alex@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/alex@2x.png
--------------------------------------------------------------------------------
/src/main/resources/icons/cabal@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/cabal@2x.png
--------------------------------------------------------------------------------
/src/main/resources/icons/foreign.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/foreign.png
--------------------------------------------------------------------------------
/src/main/resources/icons/instance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/instance.png
--------------------------------------------------------------------------------
/src/main/resources/icons/newtype.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/newtype.png
--------------------------------------------------------------------------------
/src/main/resources/icons/haskell@16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/haskell@16.png
--------------------------------------------------------------------------------
/src/main/resources/icons/type_family.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/type_family.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | idea-flex.skeleton
2 | target/
3 | .idea/
4 | idea/
5 | *~
6 | out/
7 | project/project/
8 | jflex-*.jar
9 | /.bsp/sbt.json
10 |
--------------------------------------------------------------------------------
/src/main/resources/fileTemplates/internal/Alex Source.x.ft:
--------------------------------------------------------------------------------
1 | {
2 | module ${NAME} where
3 | }
4 |
5 | tokens :-
6 |
7 | {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/resources/icons/haskell@16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/haskell@16@2x.png
--------------------------------------------------------------------------------
/src/main/resources/icons/type_instance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/type_instance.png
--------------------------------------------------------------------------------
/src/main/resources/icons/haskell-blue@16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/haskell-blue@16.png
--------------------------------------------------------------------------------
/src/main/resources/icons/type_signature.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/type_signature.png
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/CaseSplitIntention/after.hs.template:
--------------------------------------------------------------------------------
1 | foo :: FooType -> Smth
2 | foo Foo = undefined
3 | foo (Bar n) = undefined
--------------------------------------------------------------------------------
/src/main/resources/icons/haskell-blue@16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/haskell-blue@16@2x.png
--------------------------------------------------------------------------------
/src/main/resources/icons/default_declaration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/src/main/resources/icons/default_declaration.png
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/CaseSplitIntention/before.hs.template:
--------------------------------------------------------------------------------
1 | data FooType = Foo | Bar Int
2 |
3 | foo :: FooType -> Smth
4 | foo x = undefined
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/CaseSplitIntention/description.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | This intention performs case splitting.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/docs/IntelliJ-Haskell talk at A'dam Haskell Meetup.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rikvdkleij/intellij-haskell/HEAD/docs/IntelliJ-Haskell talk at A'dam Haskell Meetup.pdf
--------------------------------------------------------------------------------
/src/main/resources/fileTemplates/internal/Alex Source.x.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | This is an Alex source file file template.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/fileTemplates/internal/Haskell Module.hs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | This is a Haskell module file template.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/AddParensIntention/description.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | This intention adds parens to expressions.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/RemoveParensIntention/description.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | This intention removes parens from expressions.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/impl/ExtensionsImpl.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.psi.impl
2 |
3 | trait ExtensionsImpl extends IdentListFieldImpl
4 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/impl/GhcOptionsImpl.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.psi.impl
2 |
3 | trait GhcOptionsImpl extends IdentListFieldImpl
4 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.java]
2 | charset = utf-8
3 | end_of_line = lf
4 | indent_size = 2
5 | indent_style = space
6 | insert_final_newline = true
7 | max_line_length = 120
8 |
--------------------------------------------------------------------------------
/project/plugins.sbt:
--------------------------------------------------------------------------------
1 | addSbtPlugin("org.jetbrains" % "sbt-idea-plugin" % "3.14.3")
2 |
3 | resolvers += Resolver.url("jetbrains-bintray",
4 | url("https://dl.bintray.com/jetbrains/sbt-plugins/"))(Resolver.ivyStylePatterns)
5 |
--------------------------------------------------------------------------------
/src/main/resources/inspectionDescriptions/HLintInspection.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Inspection by HLint.
4 | For more information, see HLint's GitHub page
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/fileTemplates/internal/Haskell Test Module.hs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | This is a Haskell test module file template. You can refer to the module under test with ${SUT_NAME}.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellDerivingVia.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | public interface HaskellDerivingVia extends HaskellCompositeElement {
5 |
6 | }
7 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/lexer/CabalParsingLexer.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.lexer
2 |
3 | import com.intellij.lexer.FlexAdapter
4 |
5 | class CabalParsingLexer extends FlexAdapter(new _CabalParsingLexer())
6 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/alex/lang/psi/AlexElement.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.alex.lang.psi
2 |
3 | import com.intellij.psi.PsiElement
4 |
5 | /**
6 | * @author ice1000
7 | */
8 | trait AlexElement extends PsiElement {
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/alex/lang/lexer/AlexLexer.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.alex.lang.lexer
2 |
3 | import com.intellij.lexer.FlexAdapter
4 |
5 | /**
6 | * @author ice1000
7 | */
8 | class AlexLexer extends FlexAdapter(new _AlexLexer) {
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/HaskellLexer.java:
--------------------------------------------------------------------------------
1 | package intellij.haskell;
2 |
3 | import com.intellij.lexer.FlexAdapter;
4 |
5 | public class HaskellLexer extends FlexAdapter {
6 | public HaskellLexer() {
7 | super(new _HaskellLexer());
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/highlighting/CabalSyntaxHighlightingLexer.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.highlighting
2 |
3 | import com.intellij.lexer.FlexAdapter
4 |
5 | class CabalSyntaxHighlightingLexer() extends FlexAdapter(new _CabalSyntaxHighlightingLexer)
6 |
--------------------------------------------------------------------------------
/src/test/testData/parsing-hs/ComplicatedPragma.hs:
--------------------------------------------------------------------------------
1 | {-# LANGUAGE TheWorldOverHeaven#-}
2 | {-# OPTIONS_GHC "String" #-}
3 | {-# OPTIONS_GHC " \" Escape \' \n" #-}
4 | {-# OPTIONS_GHC
5 | MULTI
6 | LINE
7 | #-}
8 |
9 | {-# LANGUAGE Comma,Separated,Pragmas #-}
10 |
11 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellQuasiQuote.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import com.intellij.psi.PsiLanguageInjectionHost;
5 |
6 | public interface HaskellQuasiQuote extends HaskellQuasiQuoteElement, PsiLanguageInjectionHost {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/src/test/testData/parsing/MixedStatefulStateless.x:
--------------------------------------------------------------------------------
1 | {
2 | module MixedStatefulStateless where
3 |
4 | import Komeji.Satori
5 | import Komeji.Koishi
6 | }
7 |
8 | tokens :-
9 |
10 | @reimu { simple ReimuToken }
11 |
12 | {
13 | @alice { simple AliceToken }
14 | }
15 |
16 | {
17 | Stop the time!
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/impl/CabalElementTypeError.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.psi.impl
2 |
3 | import com.intellij.psi.PsiElement
4 |
5 | class CabalElementTypeError(expected: String, got: PsiElement)
6 | extends AssertionError(
7 | s"Expected $expected but got $got (${got.getText})"
8 | )
9 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellDotDot.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellDotDot extends HaskellCompositeElement {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellComments.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellComments extends HaskellCompositeElement {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexIdentifier.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexIdentifier extends AlexElement {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexRegexPart.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexRegexPart extends AlexElement {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexWrapperType.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexWrapperType extends AlexElement {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellImportHiding.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellImportHiding extends HaskellCompositeElement {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/alex/lang/psi/AlexTokenType.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.alex.lang.psi
2 |
3 | import com.intellij.psi.tree.IElementType
4 | import intellij.haskell.alex.AlexLanguage
5 |
6 | /**
7 | * @author ice1000
8 | */
9 | class AlexTokenType(debugName: String) extends IElementType(debugName, AlexLanguage.Instance) {
10 | }
11 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexTopModuleSection.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexTopModuleSection extends AlexElement {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexUserCodeSection.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexUserCodeSection extends AlexElement {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellImportEmptySpec.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellImportEmptySpec extends HaskellCompositeElement {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellImportQualified.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellImportQualified extends HaskellCompositeElement {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellGeneralPragmaContent.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellGeneralPragmaContent extends HaskellCompositeElement {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellGtycon.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellGtycon extends HaskellCompositeElement {
9 |
10 | @Nullable
11 | HaskellQName getQName();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellListType.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellListType extends HaskellCompositeElement {
9 |
10 | @Nullable
11 | HaskellQName getQName();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexRuleId.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 | import com.intellij.psi.PsiNameIdentifierOwner;
8 |
9 | public interface AlexRuleId extends PsiNameIdentifierOwner {
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellQNames.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellQNames extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getQNameList();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexTokenSetId.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 | import com.intellij.psi.PsiNameIdentifierOwner;
8 |
9 | public interface AlexTokenSetId extends PsiNameIdentifierOwner {
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellFileHeader.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellFileHeader extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getPragmaList();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellTypeEquality.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellTypeEquality extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getQNameList();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/src/test/testData/parsing/Simple.x:
--------------------------------------------------------------------------------
1 | {
2 | {-# LANGUAGE LambdaCase #-}
3 |
4 | module Simple where
5 |
6 | import Star.Platinum
7 | import The.World
8 | }
9 |
10 | %wrapper "bytestring"
11 |
12 | $sanae = god
13 | $pachouli = [a-zA-Z]
14 |
15 | @marisa = $black $white
16 | @alice = love $marisa
17 | @reimu = friend $marisa love $sanae
18 |
19 | tokens :-
20 |
21 | {
22 | I reject my humanity, jojo!
23 | }
24 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellFixityDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellFixityDeclaration extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | HaskellQNames getQNames();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexTokensSection.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexTokensSection extends AlexElement {
9 |
10 | @NotNull
11 | List getTokensRuleList();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellImportQualifiedAs.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellImportQualifiedAs extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | HaskellQualifier getQualifier();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellImportPackageName.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellImportPackageName extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | HaskellTextLiteral getTextLiteral();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellPragma.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellPragma extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getGeneralPragmaContentList();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellTextLiteral.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 | import com.intellij.psi.PsiLanguageInjectionHost;
8 |
9 | public interface HaskellTextLiteral extends HaskellStringLiteralElement, PsiLanguageInjectionHost {
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/alex/lang/psi/impl/AlexElementImpl.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.alex.lang.psi.impl
2 |
3 | import com.intellij.extapi.psi.ASTWrapperPsiElement
4 | import com.intellij.lang.ASTNode
5 | import intellij.haskell.alex.lang.psi.AlexElement
6 |
7 | /**
8 | * @author ice1000
9 | */
10 | class AlexElementImpl private[impl](node: ASTNode) extends ASTWrapperPsiElement(node) with AlexElement {
11 | }
12 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexDeclarationsSection.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexDeclarationsSection extends AlexElement {
9 |
10 | @NotNull
11 | List getDeclarationList();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexStatelessTokensRule.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexStatelessTokensRule extends AlexElement {
9 |
10 | @NotNull
11 | AlexRuleDescription getRuleDescription();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellCdecls.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.List;
7 |
8 | public interface HaskellCdecls extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getCdeclList();
12 |
13 | @NotNull
14 | List getPragmaList();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellInstvar.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellInstvar extends HaskellCompositeElement {
9 |
10 | @Nullable
11 | HaskellQName getQName();
12 |
13 | @Nullable
14 | HaskellTtype getTtype();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellCcontext.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.List;
7 |
8 | public interface HaskellCcontext extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getClazzList();
12 |
13 | @NotNull
14 | List getPragmaList();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellCidecls.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.List;
7 |
8 | public interface HaskellCidecls extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getCideclList();
12 |
13 | @NotNull
14 | List getPragmaList();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellExports.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.List;
7 |
8 | public interface HaskellExports extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getExportList();
12 |
13 | @NotNull
14 | List getPragmaList();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/spellchecker/HaskellBundledDictionaryProvider.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.spellchecker
2 |
3 | import com.intellij.spellchecker.BundledDictionaryProvider
4 |
5 | /**
6 | * Provides a custom dictionary for the Haskell spellchecker.
7 | */
8 | class HaskellBundledDictionaryProvider extends BundledDictionaryProvider {
9 | override def getBundledDictionaries: Array[String] = Array("/dictionary/haskell.dic")
10 | }
11 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexRegex.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexRegex extends AlexElement {
9 |
10 | @Nullable
11 | AlexRegexPart getRegexPart();
12 |
13 | @Nullable
14 | AlexTokenSetId getTokenSetId();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellKindSignature.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellKindSignature extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | HaskellQName getQName();
12 |
13 | @NotNull
14 | HaskellTtype getTtype();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/CabalPsiUtil.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.psi
2 |
3 | import com.intellij.psi.PsiElement
4 | import intellij.haskell.cabal.lang.psi
5 | import intellij.haskell.psi.HaskellPsiUtil
6 |
7 | object CabalPsiUtil {
8 |
9 | def getFieldContext(el: PsiElement): Option[psi.CabalFieldElement] = {
10 | HaskellPsiUtil.collectFirstParent(el) { case el: psi.CabalFieldElement => el }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/impl/MainIsImpl.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.psi.impl
2 |
3 | import com.intellij.psi.PsiElement
4 | import intellij.haskell.cabal.lang.psi.CabalTypes
5 | import intellij.haskell.psi.HaskellPsiUtil
6 |
7 | trait MainIsImpl extends PsiElement {
8 |
9 | def getValue: Option[String] = {
10 | HaskellPsiUtil.getChildNodes(this, CabalTypes.FREEFORM).headOption.map(_.getText)
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellConstr.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.Nullable;
5 |
6 | public interface HaskellConstr extends HaskellCompositeElement {
7 |
8 | @Nullable
9 | HaskellConstr1 getConstr1();
10 |
11 | @Nullable
12 | HaskellConstr2 getConstr2();
13 |
14 | @Nullable
15 | HaskellConstr3 getConstr3();
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellScontext.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.List;
7 |
8 | public interface HaskellScontext extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getPragmaList();
12 |
13 | @NotNull
14 | List getSimpleclassList();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellConstr3.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellConstr3 extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getPragmaList();
12 |
13 | @NotNull
14 | List getTtypeList();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellImportIdsSpec.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.List;
7 |
8 | public interface HaskellImportIdsSpec extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getImportIdList();
12 |
13 | @NotNull
14 | List getPragmaList();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellSimpleclass.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellSimpleclass extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getQNameList();
12 |
13 | @Nullable
14 | HaskellTtype getTtype();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexRuleDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexRuleDeclaration extends AlexElement {
9 |
10 | @NotNull
11 | List getRegexList();
12 |
13 | @NotNull
14 | AlexRuleId getRuleId();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexRuleDescription.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexRuleDescription extends AlexElement {
9 |
10 | @NotNull
11 | List getRegexList();
12 |
13 | @Nullable
14 | AlexRuleId getRuleId();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/test/scala/intellij/haskell/HaskellParsingTest.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell
2 |
3 | import com.intellij.testFramework.ParsingTestCase
4 |
5 | class HaskellParsingTest extends ParsingTestCase("", "hs", new HaskellParserDefinition) {
6 | override def getTestDataPath: String = "src/test/testData/parsing-hs"
7 |
8 | def testPragma(): Unit = {
9 | doTest(true)
10 | }
11 |
12 | def testComplicatedPragma(): Unit = {
13 | doTest(true)
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/test/testData/parsing/Rules.x:
--------------------------------------------------------------------------------
1 | {
2 | {-# LANGUAGE LambdaCase #-}
3 |
4 | module Rules where
5 |
6 | import Crazy.Diamond
7 | import Killer.Queen
8 | }
9 |
10 | %wrapper "bytestring"
11 |
12 | $sanae = god
13 | @marisa = $black $white
14 | @alice = love $marisa
15 | @reimu = friend $marisa love $sanae
16 |
17 | tokens :-
18 |
19 | {
20 | @alice { simple AliceToken }
21 | }
22 |
23 | @reimu { simple ReimuToken }
24 |
25 | {
26 | it was me, dio!
27 | }
28 |
--------------------------------------------------------------------------------
/.github/workflows/scala.yml:
--------------------------------------------------------------------------------
1 | name: Scala CI
2 |
3 | on:
4 | push:
5 | branches: [ master ]
6 | pull_request:
7 | branches: [ master ]
8 |
9 | jobs:
10 | build:
11 |
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - uses: actions/checkout@v2
16 | - name: Set up JDK 11
17 | uses: actions/setup-java@v2
18 | with:
19 | java-version: '11'
20 | distribution: 'adopt'
21 | - name: Run tests
22 | run: sbt test
23 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/runconfig/console/HaskellConsoleHighlightingUtil.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.runconfig.console
2 |
3 | import scala.util.matching.Regex
4 |
5 | object HaskellConsoleHighlightingUtil {
6 | private val ID = "[A-Z]\\w*"
7 | private val Module = s"\\*?$ID(\\.$ID)*"
8 | private val Modules = s"($Module\\s*)*"
9 | val PromptArrow = ">"
10 | val LambdaArrow = "λ> "
11 | val LineWithPrompt = new Regex(s"($Modules$PromptArrow)")
12 | }
13 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellDataDeclarationDeriving.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.List;
7 |
8 | public interface HaskellDataDeclarationDeriving extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getPragmaList();
12 |
13 | @NotNull
14 | List getTtypeList();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexTokenSetDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexTokenSetDeclaration extends AlexElement {
9 |
10 | @NotNull
11 | List getRegexList();
12 |
13 | @NotNull
14 | AlexTokenSetId getTokenSetId();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellCdecl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.Nullable;
5 |
6 | public interface HaskellCdecl extends HaskellCompositeElement {
7 |
8 | @Nullable
9 | HaskellCdeclDataDeclaration getCdeclDataDeclaration();
10 |
11 | @Nullable
12 | HaskellCidecl getCidecl();
13 |
14 | @Nullable
15 | HaskellTypeSignature getTypeSignature();
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexDeclaration extends AlexElement {
9 |
10 | @Nullable
11 | AlexRuleDeclaration getRuleDeclaration();
12 |
13 | @Nullable
14 | AlexTokenSetDeclaration getTokenSetDeclaration();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexTokensRule.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexTokensRule extends AlexElement {
9 |
10 | @Nullable
11 | AlexStatefulTokensRule getStatefulTokensRule();
12 |
13 | @Nullable
14 | AlexStatelessTokensRule getStatelessTokensRule();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/CabalElementType.java:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.psi;
2 |
3 | import com.intellij.psi.tree.IElementType;
4 | import intellij.haskell.cabal.CabalLanguage;
5 | import org.jetbrains.annotations.NonNls;
6 | import org.jetbrains.annotations.NotNull;
7 |
8 | public class CabalElementType extends IElementType {
9 | public CabalElementType(@NotNull @NonNls String debugName) {
10 | super(debugName, CabalLanguage.Instance);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/AlexStatefulTokensRule.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface AlexStatefulTokensRule extends AlexElement {
9 |
10 | @Nullable
11 | AlexIdentifier getIdentifier();
12 |
13 | @NotNull
14 | List getStatelessTokensRuleList();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/impl/SourceDirsImpl.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.psi.impl
2 |
3 | import com.intellij.psi.PsiElement
4 | import intellij.haskell.cabal.lang.psi.CabalTypes
5 | import intellij.haskell.psi.HaskellPsiUtil
6 |
7 | trait SourceDirsImpl extends PsiElement {
8 |
9 | /** Retrieves the source dir paths as strings. */
10 | def getValue: Array[String] = {
11 | HaskellPsiUtil.getChildNodes(this, CabalTypes.SOURCE_DIR).map(_.getText)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellImportDeclarations.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellImportDeclarations extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getImportDeclarationList();
12 |
13 | @NotNull
14 | List getPragmaList();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellInst.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.List;
7 |
8 | public interface HaskellInst extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getGtyconList();
12 |
13 | @NotNull
14 | List getInstvarList();
15 |
16 | @NotNull
17 | List getPragmaList();
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellNewconstrFielddecl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.List;
7 |
8 | public interface HaskellNewconstrFielddecl extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getPragmaList();
12 |
13 | @NotNull
14 | List getQNameList();
15 |
16 | @NotNull
17 | HaskellTtype getTtype();
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellConstr1.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellConstr1 extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getFielddeclList();
12 |
13 | @NotNull
14 | List getPragmaList();
15 |
16 | @Nullable
17 | HaskellQName getQName();
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/impl/CabalNamedElementImpl.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.psi.impl
2 |
3 | import com.intellij.psi.{PsiElement, PsiReference}
4 | import intellij.haskell.cabal.lang.psi.{CabalNamedElement, CabalReference}
5 |
6 | trait CabalNamedElementImpl extends CabalNamedElement {
7 |
8 | def getVariants: Array[AnyRef]
9 |
10 | def resolve(): Option[PsiElement]
11 |
12 | override def getReference: PsiReference = {
13 | new CabalReference(this, getTextRange)
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellImportHidingSpec.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.List;
7 |
8 | public interface HaskellImportHidingSpec extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | HaskellImportHiding getImportHiding();
12 |
13 | @NotNull
14 | List getImportIdList();
15 |
16 | @NotNull
17 | List getPragmaList();
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/highlighting/CabalSyntaxHighlighterFactory.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.highlighting
2 |
3 | import com.intellij.openapi.fileTypes.{SyntaxHighlighter, SyntaxHighlighterFactory}
4 | import com.intellij.openapi.project.Project
5 | import com.intellij.openapi.vfs.VirtualFile
6 |
7 | class CabalSyntaxHighlighterFactory extends SyntaxHighlighterFactory {
8 | def getSyntaxHighlighter(project: Project, virtualFile: VirtualFile): SyntaxHighlighter = {
9 | new CabalSyntaxHighlighter
10 | }
11 | }
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellImportId.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 | import org.jetbrains.annotations.Nullable;
6 |
7 | import java.util.List;
8 |
9 | public interface HaskellImportId extends HaskellCompositeElement {
10 |
11 | @Nullable
12 | HaskellDotDot getDotDot();
13 |
14 | @NotNull
15 | List getPragmaList();
16 |
17 | @NotNull
18 | List getQNameList();
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/spellchecker/CabalSpellcheckingStrategy.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.spellchecker
2 |
3 | import com.intellij.psi.PsiElement
4 | import com.intellij.spellchecker.tokenizer.{SpellcheckingStrategy, Tokenizer}
5 | import intellij.haskell.cabal.CabalLanguage
6 |
7 | /**
8 | * Provide spellchecker support for Cabal sources.
9 | */
10 | class CabalSpellcheckingStrategy extends SpellcheckingStrategy {
11 | override def isMyContext(element: PsiElement): Boolean = CabalLanguage.Instance.is(element.getLanguage)
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/spellchecker/HaskellSpellcheckingStrategy.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.spellchecker
2 |
3 | import intellij.haskell.HaskellLanguage
4 | import com.intellij.psi.PsiElement
5 | import com.intellij.spellchecker.tokenizer.{Tokenizer, SpellcheckingStrategy}
6 |
7 | /**
8 | * Provide spellchecker support for Haskell sources.
9 | */
10 | class HaskellSpellcheckingStrategy extends SpellcheckingStrategy {
11 | override def isMyContext(element: PsiElement): Boolean = HaskellLanguage.Instance.is(element.getLanguage)
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/util/HtmlElement.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.util
2 |
3 | object HtmlElement {
4 | final val Quot = """
5 | final val Lt = "<"
6 | final val Gt = ">"
7 | final val Amp = "&"
8 | final val Nbsp = " "
9 | final val HtmlStart = ""
10 | final val BodyStart = ""
11 | final val HtmlEnd = ""
12 | final val BodyEnd = ""
13 | final val Break = "
"
14 | final val HorizontalLine = "
"
15 | final val PreStart = ""
16 | final val PreEnd = "
"
17 | }
18 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellImportSpec.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellImportSpec extends HaskellCompositeElement {
9 |
10 | @Nullable
11 | HaskellImportEmptySpec getImportEmptySpec();
12 |
13 | @Nullable
14 | HaskellImportHidingSpec getImportHidingSpec();
15 |
16 | @Nullable
17 | HaskellImportIdsSpec getImportIdsSpec();
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/intellij-haskell/intellij-haskell.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/alex/AlexFile.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.alex
2 |
3 | import com.intellij.extapi.psi.PsiFileBase
4 | import com.intellij.openapi.fileTypes.FileType
5 | import com.intellij.psi.FileViewProvider
6 |
7 | /**
8 | * @author ice1000
9 | */
10 | class AlexFile(viewProvider: FileViewProvider) extends PsiFileBase(viewProvider, AlexLanguage.Instance) {
11 |
12 | def getFileType: FileType = {
13 | new AlexFileType(AlexLanguage.Instance)
14 | }
15 |
16 | override def toString: String = {
17 | " Alex file"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/alex/highlighting/AlexSyntaxHighlighterFactory.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.alex.highlighting
2 |
3 | import com.intellij.openapi.fileTypes.{SyntaxHighlighter, SyntaxHighlighterFactory}
4 | import com.intellij.openapi.project.Project
5 | import com.intellij.openapi.vfs.VirtualFile
6 |
7 | /**
8 | * @author ice1000
9 | */
10 | class AlexSyntaxHighlighterFactory extends SyntaxHighlighterFactory {
11 | override def getSyntaxHighlighter(project: Project, virtualFile: VirtualFile): SyntaxHighlighter = {
12 | new AlexSyntaxHighlighter
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/runconfig/console/HaskellConsoleProcessHandler.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.runconfig.console
2 |
3 | import java.nio.charset.Charset
4 |
5 | import com.intellij.execution.console.LanguageConsoleImpl
6 | import com.intellij.execution.process.ColoredProcessHandler
7 |
8 | class HaskellConsoleProcessHandler private[runconfig](val process: Process, val commandLine: String, val console: HaskellConsoleView) extends ColoredProcessHandler(process, commandLine, Charset.forName("UTF-8")) {
9 |
10 | def getLanguageConsole: LanguageConsoleImpl = console
11 | }
12 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellConstr2.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.List;
7 |
8 | public interface HaskellConstr2 extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getPragmaList();
12 |
13 | @NotNull
14 | List getQNameList();
15 |
16 | @NotNull
17 | List getTtypeList();
18 |
19 | @NotNull
20 | List getTypeSignatureList();
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/HTool.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell
2 |
3 | sealed abstract class HTool extends Product with Serializable {
4 | def name: String
5 | }
6 |
7 | object HTool {
8 |
9 | case object Hlint extends HTool {
10 | def name: String = "hlint"
11 | }
12 |
13 | case object Hoogle extends HTool {
14 | def name: String = "hoogle"
15 | }
16 |
17 | case object StylishHaskell extends HTool {
18 | def name: String = "stylish-haskell"
19 | }
20 |
21 | case object Ormolu extends HTool {
22 | def name: String = "ormolu"
23 |
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/CabalReference.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.psi
2 |
3 | import com.intellij.openapi.util.TextRange
4 | import com.intellij.psi.{PsiElement, PsiNamedElement, PsiReferenceBase}
5 |
6 | import intellij.haskell.cabal.lang.psi.impl.CabalNamedElementImpl
7 |
8 | final class CabalReference(el: CabalNamedElementImpl, textRange: TextRange)
9 | extends PsiReferenceBase[PsiNamedElement](el, textRange) {
10 |
11 | override def getVariants: Array[AnyRef] = el.getVariants
12 |
13 | override def resolve(): PsiElement = el.resolve().orNull
14 | }
15 |
--------------------------------------------------------------------------------
/src/test/testData/parsing/RuleDescription.x:
--------------------------------------------------------------------------------
1 | {
2 | {-# LANGUAGE LambdaCase #-}
3 |
4 | module RuleDescription where
5 |
6 | import Alice.Margatroid
7 | import Marisa.Kirisame
8 | }
9 |
10 | %wrapper "bytestring"
11 |
12 | $yasaka_kanako = [a-z]
13 | $moriya_suwako = [A-Z]
14 |
15 | tokens :-
16 |
17 | {
18 | "kochiya sanae" { simple "Jusei no kokosei" }
19 | $yasaka_kanako { simple "Central Goddess" }
20 | $moriya_suwako { simple "Local Goddess" }
21 | }
22 |
23 | @reiuji { simple ReiujiUtsuho }
24 |
25 | {
26 | Jojo! This is the last of my hamon!
27 | Take it from meeeeee!
28 | }
29 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellExport.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 | import org.jetbrains.annotations.Nullable;
6 |
7 | import java.util.List;
8 |
9 | public interface HaskellExport extends HaskellCompositeElement {
10 |
11 | @Nullable
12 | HaskellDotDot getDotDot();
13 |
14 | @Nullable
15 | HaskellModid getModid();
16 |
17 | @NotNull
18 | List getPragmaList();
19 |
20 | @NotNull
21 | List getQNameList();
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellQName.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 | import scala.Option;
8 |
9 | public interface HaskellQName extends HaskellQualifiedNameElement {
10 |
11 | @Nullable
12 | HaskellQVarCon getQVarCon();
13 |
14 | @Nullable
15 | HaskellVarCon getVarCon();
16 |
17 | String getName();
18 |
19 | HaskellNamedElement getIdentifierElement();
20 |
21 | Option getQualifierName();
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/impl/ExposedModulesImpl.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.psi.impl
2 |
3 | import com.intellij.psi.PsiElement
4 | import intellij.haskell.cabal.lang.psi._
5 | import intellij.haskell.psi.HaskellPsiUtil
6 |
7 | trait ExposedModulesImpl extends PsiElement {
8 |
9 | def getModuleNames: Array[String] = {
10 | HaskellPsiUtil.getChildOfType(this, classOf[ModuleList]) match {
11 | case None => Array.empty
12 | case Some(moduleList) => HaskellPsiUtil.streamChildren(moduleList, classOf[Module]).map(c => c.getModuleName ).toArray
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellNewconstr.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 | import org.jetbrains.annotations.Nullable;
6 |
7 | import java.util.List;
8 |
9 | public interface HaskellNewconstr extends HaskellCompositeElement {
10 |
11 | @Nullable
12 | HaskellNewconstrFielddecl getNewconstrFielddecl();
13 |
14 | @NotNull
15 | List getPragmaList();
16 |
17 | @NotNull
18 | List getQNameList();
19 |
20 | @Nullable
21 | HaskellTtype getTtype();
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellQConQualifier.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellQConQualifier extends HaskellCompositeElement {
9 |
10 | @Nullable
11 | HaskellQConQualifier1 getQConQualifier1();
12 |
13 | @Nullable
14 | HaskellQConQualifier2 getQConQualifier2();
15 |
16 | @Nullable
17 | HaskellQConQualifier3 getQConQualifier3();
18 |
19 | @Nullable
20 | HaskellQConQualifier4 getQConQualifier4();
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/impl/IdentListFieldImpl.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.psi.impl
2 |
3 | import com.intellij.psi.PsiElement
4 | import intellij.haskell.cabal.lang.psi.{CabalTypes, IdentList}
5 | import intellij.haskell.psi.HaskellPsiUtil
6 |
7 | trait IdentListFieldImpl extends PsiElement {
8 |
9 | /** Retrieves the extension names as strings. */
10 | def getValue: Array[String] = HaskellPsiUtil.getChildOfType(this, classOf[IdentList]) match {
11 | case None => Array.empty
12 | case Some(el) => HaskellPsiUtil.getChildNodes(el, CabalTypes.IDENT).map(_.getText)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellFielddecl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellFielddecl extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getPragmaList();
12 |
13 | @NotNull
14 | List getQNameList();
15 |
16 | @NotNull
17 | HaskellQNames getQNames();
18 |
19 | @Nullable
20 | HaskellScontext getScontext();
21 |
22 | @Nullable
23 | HaskellTtype getTtype();
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellVarCon.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellVarCon extends HaskellCompositeElement {
9 |
10 | @Nullable
11 | HaskellConid getConid();
12 |
13 | @Nullable
14 | HaskellConsym getConsym();
15 |
16 | @Nullable
17 | HaskellVarid getVarid();
18 |
19 | @Nullable
20 | HaskellVarsym getVarsym();
21 |
22 | String getName();
23 |
24 | HaskellNamedElement getIdentifierElement();
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/impl/CabalElementImplUtil.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.psi.impl
2 |
3 | import scala.reflect.ClassTag
4 |
5 | import com.intellij.psi.PsiElement
6 |
7 | object CabalElementImplUtil {
8 |
9 | def assertUpCast[A <: PsiElement : ClassTag](el: PsiElement): A = {
10 | val ct = implicitly[ClassTag[A]]
11 | el match {
12 | case ct(x) => x
13 | case other =>
14 | throw new AssertionError(
15 | s"Expected ${ct.runtimeClass.getName} but got: " +
16 | s"${other.getClass.getName} (${other.getText})"
17 | )
18 | }
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/runconfig/run/HaskellRunConfigurationFactory.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.runconfig.run
2 |
3 | import com.intellij.execution.configurations.{ConfigurationFactory, ConfigurationType}
4 | import com.intellij.openapi.project.Project
5 |
6 | class HaskellRunConfigurationFactory(val typez: ConfigurationType) extends ConfigurationFactory(typez) {
7 | private val name = "Haskell Stack Runner"
8 |
9 | override def createTemplateConfiguration(project: Project) = new HaskellRunConfiguration(name, project, this)
10 |
11 | override def getName: String = name
12 |
13 | override def getId: String = name
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/runconfig/test/HaskellTestConfigurationFactory.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.runconfig.test
2 |
3 | import com.intellij.execution.configurations.{ConfigurationFactory, ConfigurationType}
4 | import com.intellij.openapi.project.Project
5 |
6 | class HaskellTestConfigurationFactory(val typez: ConfigurationType) extends ConfigurationFactory(typez) {
7 | private val name = "Haskell Stack Tester"
8 |
9 | override def createTemplateConfiguration(project: Project) = new HaskellTestConfiguration(name, project, this)
10 |
11 | override def getName: String = name
12 |
13 | override def getId: String = name
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/navigation/HaskellTargetElementUtil2.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.navigation
2 |
3 | import com.intellij.codeInsight.TargetElementEvaluatorEx2
4 | import com.intellij.psi.PsiElement
5 | import intellij.haskell.psi.HaskellNamedElement
6 |
7 | class HaskellTargetElementUtil2 extends TargetElementEvaluatorEx2 {
8 |
9 | override def getNamedElement(element: PsiElement): PsiElement = {
10 | if (element.isInstanceOf[HaskellNamedElement]) {
11 | element
12 | } else {
13 | null
14 | }
15 | }
16 |
17 | override def isAcceptableNamedParent(parent: PsiElement): Boolean = {
18 | false
19 | }
20 | }
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/alex/AlexLanguage.java:
--------------------------------------------------------------------------------
1 | package intellij.haskell.alex;
2 |
3 | import com.intellij.lang.Language;
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | /**
7 | * @author ice1000
8 | */
9 | public class AlexLanguage extends Language {
10 | public static final AlexLanguage Instance = new AlexLanguage();
11 |
12 | public AlexLanguage() {
13 | super("Alex", "text/x");
14 | }
15 |
16 | @NotNull
17 | @Override
18 | public String getDisplayName() {
19 | return "Alex";
20 | }
21 |
22 | @Override
23 | public boolean isCaseSensitive() {
24 | return true;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellTypeFamilyType.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.List;
7 |
8 | public interface HaskellTypeFamilyType extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getCcontextList();
12 |
13 | @NotNull
14 | List getPragmaList();
15 |
16 | @NotNull
17 | List getQNameList();
18 |
19 | @NotNull
20 | List getQNamesList();
21 |
22 | @NotNull
23 | List getTtypeList();
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/runconfig/console/HaskellConsoleConfigurationFactory.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.runconfig.console
2 |
3 | import com.intellij.execution.configurations.{ConfigurationFactory, ConfigurationType}
4 | import com.intellij.openapi.project.Project
5 |
6 | class HaskellConsoleConfigurationFactory(val typez: ConfigurationType) extends ConfigurationFactory(typez) {
7 | private val name = "Haskell Stack REPL"
8 |
9 | override def createTemplateConfiguration(project: Project) = new HaskellConsoleConfiguration(name, project, this)
10 |
11 | override def getName: String = name
12 |
13 | override def getId: String = getName
14 | }
15 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellQCon.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellQCon extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | HaskellConid getConid();
12 |
13 | @Nullable
14 | HaskellQConQualifier1 getQConQualifier1();
15 |
16 | @Nullable
17 | HaskellQConQualifier2 getQConQualifier2();
18 |
19 | @Nullable
20 | HaskellQConQualifier3 getQConQualifier3();
21 |
22 | @Nullable
23 | HaskellQConQualifier4 getQConQualifier4();
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellExpression.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.List;
7 |
8 | public interface HaskellExpression extends HaskellExpressionElement {
9 |
10 | @NotNull
11 | List getDotDotList();
12 |
13 | @NotNull
14 | List getPragmaList();
15 |
16 | @NotNull
17 | List getQNameList();
18 |
19 | @NotNull
20 | List getQuasiQuoteList();
21 |
22 | @NotNull
23 | List getTextLiteralList();
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellShebangLine.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.List;
7 |
8 | public interface HaskellShebangLine extends HaskellCompositeElement {
9 |
10 | @NotNull
11 | List getDotDotList();
12 |
13 | @NotNull
14 | List getPragmaList();
15 |
16 | @NotNull
17 | List getQNameList();
18 |
19 | @NotNull
20 | List getQuasiQuoteList();
21 |
22 | @NotNull
23 | List getTextLiteralList();
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellModuleBody.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 | import org.jetbrains.annotations.Nullable;
6 |
7 | import java.util.List;
8 |
9 | public interface HaskellModuleBody extends HaskellCompositeElement {
10 |
11 | @Nullable
12 | HaskellImportDeclarations getImportDeclarations();
13 |
14 | @Nullable
15 | HaskellModuleDeclaration getModuleDeclaration();
16 |
17 | @NotNull
18 | List getPragmaList();
19 |
20 | @NotNull
21 | List getTopDeclarationList();
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellQVarCon.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 |
8 | public interface HaskellQVarCon extends HaskellCompositeElement {
9 |
10 | @Nullable
11 | HaskellConsym getConsym();
12 |
13 | @Nullable
14 | HaskellQCon getQCon();
15 |
16 | @Nullable
17 | HaskellQualifier getQualifier();
18 |
19 | @Nullable
20 | HaskellVarid getVarid();
21 |
22 | @Nullable
23 | HaskellVarsym getVarsym();
24 |
25 | String getName();
26 |
27 | HaskellNamedElement getIdentifierElement();
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/util/FutureUtil.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.util
2 |
3 | import java.util.concurrent.{Future, TimeUnit, TimeoutException}
4 |
5 | import com.intellij.openapi.project.Project
6 | import intellij.haskell.HaskellNotificationGroup
7 |
8 | object FutureUtil {
9 |
10 | def waitForValue[T](project: Project, future: Future[T], actionDescription: String, timeoutInSeconds: Int = 5): Option[T] = {
11 | try {
12 | Option(future.get(timeoutInSeconds, TimeUnit.SECONDS))
13 | } catch {
14 | case _: TimeoutException =>
15 | HaskellNotificationGroup.logInfoEvent(project, s"Timeout while $actionDescription")
16 | None
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellCdeclDataDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 | import org.jetbrains.annotations.Nullable;
6 |
7 | import java.util.List;
8 |
9 | public interface HaskellCdeclDataDeclaration extends HaskellCompositeElement {
10 |
11 | @NotNull
12 | List getKindSignatureList();
13 |
14 | @NotNull
15 | List getPragmaList();
16 |
17 | @NotNull
18 | List getQNameList();
19 |
20 | @NotNull
21 | HaskellSimpletype getSimpletype();
22 |
23 | @Nullable
24 | HaskellTtype getTtype();
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellQConQualifier1.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 | import com.intellij.navigation.ItemPresentation;
8 | import com.intellij.psi.PsiReference;
9 |
10 | public interface HaskellQConQualifier1 extends HaskellQualifierElement, HaskellNamedElement {
11 |
12 | @NotNull
13 | HaskellConid getConid();
14 |
15 | String getName();
16 |
17 | PsiElement setName(String newName);
18 |
19 | HaskellNamedElement getNameIdentifier();
20 |
21 | PsiReference getReference();
22 |
23 | ItemPresentation getPresentation();
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellQualifier.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 | import com.intellij.navigation.ItemPresentation;
8 | import com.intellij.psi.PsiReference;
9 |
10 | public interface HaskellQualifier extends HaskellQualifierElement, HaskellNamedElement {
11 |
12 | @NotNull
13 | List getConidList();
14 |
15 | String getName();
16 |
17 | PsiElement setName(String newName);
18 |
19 | HaskellNamedElement getNameIdentifier();
20 |
21 | PsiReference getReference();
22 |
23 | ItemPresentation getPresentation();
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellSimpletype.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 | import org.jetbrains.annotations.Nullable;
6 | import scala.collection.immutable.Seq;
7 |
8 | import java.util.List;
9 |
10 | public interface HaskellSimpletype extends HaskellCompositeElement {
11 |
12 | @NotNull
13 | List getPragmaList();
14 |
15 | @NotNull
16 | List getQNameList();
17 |
18 | @Nullable
19 | HaskellTtype getTtype();
20 |
21 | @NotNull
22 | List getTypeSignatureList();
23 |
24 | Seq getIdentifierElements();
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellQConQualifier2.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 | import com.intellij.navigation.ItemPresentation;
8 | import com.intellij.psi.PsiReference;
9 |
10 | public interface HaskellQConQualifier2 extends HaskellQualifierElement, HaskellNamedElement {
11 |
12 | @NotNull
13 | List getConidList();
14 |
15 | String getName();
16 |
17 | PsiElement setName(String newName);
18 |
19 | HaskellNamedElement getNameIdentifier();
20 |
21 | PsiReference getReference();
22 |
23 | ItemPresentation getPresentation();
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellQConQualifier3.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 | import com.intellij.navigation.ItemPresentation;
8 | import com.intellij.psi.PsiReference;
9 |
10 | public interface HaskellQConQualifier3 extends HaskellQualifierElement, HaskellNamedElement {
11 |
12 | @NotNull
13 | List getConidList();
14 |
15 | String getName();
16 |
17 | PsiElement setName(String newName);
18 |
19 | HaskellNamedElement getNameIdentifier();
20 |
21 | PsiReference getReference();
22 |
23 | ItemPresentation getPresentation();
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellQConQualifier4.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 | import com.intellij.navigation.ItemPresentation;
8 | import com.intellij.psi.PsiReference;
9 |
10 | public interface HaskellQConQualifier4 extends HaskellQualifierElement, HaskellNamedElement {
11 |
12 | @NotNull
13 | List getConidList();
14 |
15 | String getName();
16 |
17 | PsiElement setName(String newName);
18 |
19 | HaskellNamedElement getNameIdentifier();
20 |
21 | PsiReference getReference();
22 |
23 | ItemPresentation getPresentation();
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/test/scala/intellij/haskell/alex/AlexParsingTest.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.alex
2 |
3 | import com.intellij.testFramework.ParsingTestCase
4 | import intellij.haskell.alex.lang.parser.AlexParserDefinition
5 |
6 | class AlexParsingTest extends ParsingTestCase("", "x", new AlexParserDefinition) {
7 | override def getTestDataPath: String = "src/test/testData/parsing"
8 |
9 | def testSimple(): Unit = {
10 | doTest(true)
11 | }
12 |
13 | def testRules(): Unit = {
14 | doTest(true)
15 | }
16 |
17 | def testRuleDescription(): Unit = {
18 | doTest(true)
19 | }
20 |
21 | def testLexerOwO(): Unit = {
22 | doTest(true)
23 | }
24 |
25 | def testMixedStatefulStateless(): Unit = {
26 | doTest(true)
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [rikvdkleij]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: ['https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=H6QKQKFRKJBF2&item_name=IntelliJ-Haskell¤cy_code=EUR']
13 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/impl/ModuleImpl.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.psi.impl
2 |
3 | import com.intellij.psi.PsiElement
4 | import intellij.haskell.cabal.lang.psi.ModulePart
5 |
6 | trait ModuleImpl extends PsiElement {
7 |
8 | def getParts: Array[ModulePart] = getChildren.map(assertModulePart)
9 |
10 | def getFirstPart: ModulePart = assertModulePart(getFirstChild)
11 |
12 | def getLastPart: ModulePart = assertModulePart(getLastChild)
13 |
14 | def getModuleName: String = {
15 | this.getText
16 | }
17 |
18 | private def assertModulePart(el: PsiElement): ModulePart = el match {
19 | case el: ModulePart => el
20 | case other => throw new CabalElementTypeError("ModulePart", other)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/.run/IntelliJ-Haskell.run.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellForeignDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import com.intellij.navigation.ItemPresentation;
5 | import org.jetbrains.annotations.NotNull;
6 | import scala.Option;
7 | import scala.collection.immutable.Seq;
8 |
9 | import java.util.List;
10 |
11 | public interface HaskellForeignDeclaration extends HaskellDeclarationElement {
12 |
13 | @NotNull
14 | HaskellExpression getExpression();
15 |
16 | @NotNull
17 | List getPragmaList();
18 |
19 | String getName();
20 |
21 | ItemPresentation getPresentation();
22 |
23 | Seq getIdentifierElements();
24 |
25 | Option getModuleName();
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/impl/BuildDependsImpl.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.lang.psi.impl
2 |
3 | import com.intellij.psi.PsiElement
4 | import intellij.haskell.cabal.lang.psi._
5 | import intellij.haskell.psi.HaskellPsiUtil
6 |
7 | trait BuildDependsImpl extends PsiElement {
8 |
9 | /** Retrieves the package names as strings. */
10 | def getPackageNames: Array[String] = HaskellPsiUtil.getChildOfType(this, classOf[Dependencies]) match {
11 | case None => Array.empty
12 | case Some(el) =>
13 | val res =
14 | HaskellPsiUtil.streamChildren(el, classOf[Dependency]).flatMap(c =>
15 | HaskellPsiUtil.getChildNodes(c, CabalTypes.DEPENDENCY_NAME).headOption.map(_.getText)
16 | ).toArray
17 | res
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellClazz.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 | import org.jetbrains.annotations.Nullable;
6 |
7 | import java.util.List;
8 |
9 | public interface HaskellClazz extends HaskellCompositeElement {
10 |
11 | @NotNull
12 | List getDerivingViaList();
13 |
14 | @NotNull
15 | List getPragmaList();
16 |
17 | @NotNull
18 | List getQNameList();
19 |
20 | @NotNull
21 | List getTextLiteralList();
22 |
23 | @Nullable
24 | HaskellTtype getTtype();
25 |
26 | @NotNull
27 | List getTypeSignatureList();
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellConid.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 | import com.intellij.psi.StubBasedPsiElement;
8 | import intellij.haskell.psi.stubs.HaskellConidStub;
9 | import com.intellij.navigation.ItemPresentation;
10 | import com.intellij.psi.PsiReference;
11 |
12 | public interface HaskellConid extends HaskellNamedElement, StubBasedPsiElement {
13 |
14 | String getName();
15 |
16 | PsiElement setName(String newName);
17 |
18 | HaskellNamedElement getNameIdentifier();
19 |
20 | PsiReference getReference();
21 |
22 | ItemPresentation getPresentation();
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellVarid.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 | import com.intellij.psi.StubBasedPsiElement;
8 | import intellij.haskell.psi.stubs.HaskellVaridStub;
9 | import com.intellij.navigation.ItemPresentation;
10 | import com.intellij.psi.PsiReference;
11 |
12 | public interface HaskellVarid extends HaskellNamedElement, StubBasedPsiElement {
13 |
14 | String getName();
15 |
16 | PsiElement setName(String newName);
17 |
18 | HaskellNamedElement getNameIdentifier();
19 |
20 | PsiReference getReference();
21 |
22 | ItemPresentation getPresentation();
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellConsym.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 | import com.intellij.psi.StubBasedPsiElement;
8 | import intellij.haskell.psi.stubs.HaskellConsymStub;
9 | import com.intellij.navigation.ItemPresentation;
10 | import com.intellij.psi.PsiReference;
11 |
12 | public interface HaskellConsym extends HaskellNamedElement, StubBasedPsiElement {
13 |
14 | String getName();
15 |
16 | PsiElement setName(String newName);
17 |
18 | HaskellNamedElement getNameIdentifier();
19 |
20 | PsiReference getReference();
21 |
22 | ItemPresentation getPresentation();
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellTypeInstanceDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import com.intellij.navigation.ItemPresentation;
5 | import org.jetbrains.annotations.NotNull;
6 | import scala.Option;
7 | import scala.collection.immutable.Seq;
8 |
9 | import java.util.List;
10 |
11 | public interface HaskellTypeInstanceDeclaration extends HaskellDeclarationElement {
12 |
13 | @NotNull
14 | HaskellExpression getExpression();
15 |
16 | @NotNull
17 | List getPragmaList();
18 |
19 | String getName();
20 |
21 | ItemPresentation getPresentation();
22 |
23 | Seq getIdentifierElements();
24 |
25 | Option getModuleName();
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellVarsym.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 | import com.intellij.psi.StubBasedPsiElement;
8 | import intellij.haskell.psi.stubs.HaskellVarsymStub;
9 | import com.intellij.navigation.ItemPresentation;
10 | import com.intellij.psi.PsiReference;
11 |
12 | public interface HaskellVarsym extends HaskellNamedElement, StubBasedPsiElement {
13 |
14 | String getName();
15 |
16 | PsiElement setName(String newName);
17 |
18 | HaskellNamedElement getNameIdentifier();
19 |
20 | PsiReference getReference();
21 |
22 | ItemPresentation getPresentation();
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/resources/dictionary/haskell.dic:
--------------------------------------------------------------------------------
1 | aeson
2 | attoparsec
3 | bytestring
4 | compat
5 | datatype
6 | decl
7 | decls
8 | deepseq
9 | deserialize
10 | deserializer
11 | deserializing
12 | eithers
13 | fcontext
14 | filepath
15 | fmap
16 | foldable
17 | foldl
18 | foldr
19 | forall
20 | frac
21 | frob
22 | functor
23 | ghci
24 | hashable
25 | hashmap
26 | hcollapse
27 | hlift
28 | homogenous
29 | hoogle
30 | hspec
31 | hsubparser
32 | intercalate
33 | laarhoven
34 | mconcat
35 | mempty
36 | metavar
37 | monad
38 | monoid
39 | monomorphism
40 | mplus
41 | mzero
42 | newtype
43 | noblock
44 | optparse
45 | peano
46 | pprint
47 | prog
48 | safecopy
49 | seq
50 | sqlite
51 | stderr
52 | stdin
53 | stdout
54 | storable
55 | traversable
56 | typeable
57 | unbox
58 | unboxed
59 | uncurry
60 | uuids
61 | yaml
62 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/HaskellQualifierElement.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi
18 |
19 | trait HaskellQualifierElement extends HaskellNamedElement
20 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/HaskellExpressionElement.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi
18 |
19 | trait HaskellExpressionElement extends HaskellCompositeElement
20 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/HaskellQuasiQuoteElement.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi
18 |
19 | trait HaskellQuasiQuoteElement extends HaskellCompositeElement {
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/HaskellStringLiteralElement.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi
18 |
19 | trait HaskellStringLiteralElement extends HaskellCompositeElement {
20 | }
21 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellModid.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.psi.PsiElement;
7 | import com.intellij.psi.StubBasedPsiElement;
8 | import intellij.haskell.psi.stubs.HaskellModidStub;
9 | import com.intellij.navigation.ItemPresentation;
10 | import com.intellij.psi.PsiReference;
11 |
12 | public interface HaskellModid extends HaskellNamedElement, StubBasedPsiElement {
13 |
14 | @NotNull
15 | List getConidList();
16 |
17 | String getName();
18 |
19 | PsiElement setName(String newName);
20 |
21 | HaskellNamedElement getNameIdentifier();
22 |
23 | PsiReference getReference();
24 |
25 | ItemPresentation getPresentation();
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellTtype.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 | import org.jetbrains.annotations.Nullable;
6 |
7 | import java.util.List;
8 |
9 | public interface HaskellTtype extends HaskellCompositeElement {
10 |
11 | @NotNull
12 | List getDerivingViaList();
13 |
14 | @Nullable
15 | HaskellListType getListType();
16 |
17 | @NotNull
18 | List getPragmaList();
19 |
20 | @NotNull
21 | List getQNameList();
22 |
23 | @NotNull
24 | List getTextLiteralList();
25 |
26 | @NotNull
27 | List getTtypeList();
28 |
29 | @NotNull
30 | List getTypeSignatureList();
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/HaskellCompositeElement.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi
18 |
19 | import com.intellij.psi.PsiElement
20 |
21 | trait HaskellCompositeElement extends PsiElement
22 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/HaskellLexerAdapter.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell
18 |
19 | import com.intellij.lexer.FlexAdapter
20 |
21 | class HaskellLexerAdapter extends FlexAdapter(new _HaskellLexer)
22 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellImportDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 | import org.jetbrains.annotations.Nullable;
6 | import scala.Option;
7 |
8 | import java.util.List;
9 |
10 | public interface HaskellImportDeclaration extends HaskellCompositeElement {
11 |
12 | @Nullable
13 | HaskellImportPackageName getImportPackageName();
14 |
15 | @Nullable
16 | HaskellImportQualified getImportQualified();
17 |
18 | @Nullable
19 | HaskellImportQualifiedAs getImportQualifiedAs();
20 |
21 | @Nullable
22 | HaskellImportSpec getImportSpec();
23 |
24 | @Nullable
25 | HaskellModid getModid();
26 |
27 | @NotNull
28 | List getPragmaList();
29 |
30 | Option getModuleName();
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellModuleDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import com.intellij.navigation.ItemPresentation;
5 | import org.jetbrains.annotations.NotNull;
6 | import org.jetbrains.annotations.Nullable;
7 | import scala.Option;
8 | import scala.collection.immutable.Seq;
9 |
10 | import java.util.List;
11 |
12 | public interface HaskellModuleDeclaration extends HaskellDeclarationElement {
13 |
14 | @Nullable
15 | HaskellExports getExports();
16 |
17 | @NotNull
18 | HaskellModid getModid();
19 |
20 | @NotNull
21 | List getPragmaList();
22 |
23 | String getName();
24 |
25 | ItemPresentation getPresentation();
26 |
27 | Seq getIdentifierElements();
28 |
29 | Option getModuleName();
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/alex/lang/psi/AlexHaskellInjector.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.alex.lang.psi
2 |
3 | import com.intellij.openapi.util.TextRange
4 | import com.intellij.psi.{InjectedLanguagePlaces, LanguageInjector, PsiLanguageInjectionHost}
5 | import intellij.haskell.HaskellLanguage
6 |
7 | /**
8 | * @author ice1000
9 | */
10 | class AlexHaskellInjector extends LanguageInjector {
11 | override def getLanguagesToInject(host: PsiLanguageInjectionHost, places: InjectedLanguagePlaces): Unit = {
12 | host match {
13 | case _: AlexTopModuleSection =>
14 | places.addPlace(HaskellLanguage.Instance, new TextRange(2, host.getTextLength - 1), null, null)
15 | case _: AlexUserCodeSection =>
16 | places.addPlace(HaskellLanguage.Instance, new TextRange(2, host.getTextLength - 1), null, null)
17 | case _ =>
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/sdk/HaskellStackVersionValidator.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.sdk
2 |
3 | import com.intellij.util.text.VersionComparatorUtil
4 |
5 | object HaskellStackVersionValidator {
6 |
7 | final val MinimumVersion = "1.7.0"
8 |
9 | def validate(maybeVersion: Option[String]): Unit = {
10 | validate(maybeVersion, MinimumVersion)
11 | }
12 |
13 | private[sdk] def validate(version: Option[String], minimumVersion: String): Unit = {
14 | if (!isValid(version, minimumVersion)) {
15 | throw new Exception(s"Stack version should be > $minimumVersion")
16 | }
17 | }
18 |
19 | private[sdk] def isValid(version: Option[String], minimumVersion: String): Boolean = {
20 | version.map(_.trim) match {
21 | case Some(v) if VersionComparatorUtil.compare(v, minimumVersion) >= 0 => true
22 | case _ => false
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/action/ghci/ReloadModulesAction.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.action.ghci
2 |
3 | import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent}
4 | import intellij.haskell.action.ActionUtil
5 | import intellij.haskell.runconfig.console.HaskellConsoleViewMap
6 |
7 | class ReloadModulesAction extends AnAction {
8 |
9 | override def update(actionEvent: AnActionEvent): Unit = {
10 | actionEvent.getPresentation.setEnabled(HaskellConsoleViewMap.getConsole(actionEvent.getProject).isDefined)
11 | }
12 |
13 | def actionPerformed(actionEvent: AnActionEvent): Unit = {
14 | for {
15 | actionContext <- ActionUtil.findActionContext(actionEvent)
16 | consoleView <- HaskellConsoleViewMap.getConsole(actionContext.project)
17 | } yield {
18 | consoleView.executeCommand(":reload", addToHistory = false)
19 | }
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/impl/HaskellQuasiQuoteElementImpl.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.psi.impl
2 |
3 | import com.intellij.lang.ASTNode
4 | import com.intellij.psi.{ElementManipulators, LiteralTextEscaper, PsiLanguageInjectionHost}
5 | import intellij.haskell.psi.HaskellQuasiQuoteElement
6 |
7 | abstract class HaskellQuasiQuoteElementImpl private[impl](node: ASTNode)
8 | extends HaskellCompositeElementImpl(node)
9 | with HaskellQuasiQuoteElement
10 | with PsiLanguageInjectionHost {
11 | override def isValidHost: Boolean = {
12 | true
13 | }
14 |
15 | override def updateText(text: String): HaskellQuasiQuoteElementImpl = {
16 | ElementManipulators.handleContentChange(this, text)
17 | }
18 |
19 | override def createLiteralTextEscaper(): LiteralTextEscaper[HaskellQuasiQuoteElementImpl] = {
20 | LiteralTextEscaper.createSimple(this)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellDefaultDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import com.intellij.navigation.ItemPresentation;
5 | import org.jetbrains.annotations.NotNull;
6 | import org.jetbrains.annotations.Nullable;
7 | import scala.Option;
8 | import scala.collection.immutable.Seq;
9 |
10 | import java.util.List;
11 |
12 | public interface HaskellDefaultDeclaration extends HaskellDeclarationElement {
13 |
14 | @NotNull
15 | List getPragmaList();
16 |
17 | @NotNull
18 | List getTtypeList();
19 |
20 | @Nullable
21 | HaskellTypeSignature getTypeSignature();
22 |
23 | String getName();
24 |
25 | ItemPresentation getPresentation();
26 |
27 | Seq getIdentifierElements();
28 |
29 | Option getModuleName();
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellTypeSignature.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import com.intellij.navigation.ItemPresentation;
5 | import org.jetbrains.annotations.NotNull;
6 | import scala.Option;
7 | import scala.collection.immutable.Seq;
8 |
9 | import java.util.List;
10 |
11 | public interface HaskellTypeSignature extends HaskellDeclarationElement {
12 |
13 | @NotNull
14 | List getCcontextList();
15 |
16 | @NotNull
17 | List getPragmaList();
18 |
19 | @NotNull
20 | List getQNamesList();
21 |
22 | @NotNull
23 | HaskellTtype getTtype();
24 |
25 | String getName();
26 |
27 | ItemPresentation getPresentation();
28 |
29 | Seq getIdentifierElements();
30 |
31 | Option getModuleName();
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/impl/HaskellStringLiteralElementImpl.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.psi.impl
2 |
3 | import com.intellij.lang.ASTNode
4 | import com.intellij.psi.{ElementManipulators, LiteralTextEscaper, PsiLanguageInjectionHost}
5 | import intellij.haskell.psi.HaskellStringLiteralElement
6 |
7 | abstract class HaskellStringLiteralElementImpl private[impl](node: ASTNode)
8 | extends HaskellCompositeElementImpl(node)
9 | with HaskellStringLiteralElement
10 | with PsiLanguageInjectionHost {
11 | override def isValidHost: Boolean = {
12 | true
13 | }
14 |
15 | override def updateText(text: String): HaskellStringLiteralElementImpl = {
16 | ElementManipulators.handleContentChange(this, text)
17 | }
18 |
19 | override def createLiteralTextEscaper(): LiteralTextEscaper[HaskellStringLiteralElementImpl] = {
20 | new HaskellStringEscaper(this)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellTypeFamilyDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import com.intellij.navigation.ItemPresentation;
5 | import org.jetbrains.annotations.NotNull;
6 | import org.jetbrains.annotations.Nullable;
7 | import scala.Option;
8 | import scala.collection.immutable.Seq;
9 |
10 | import java.util.List;
11 |
12 | public interface HaskellTypeFamilyDeclaration extends HaskellDeclarationElement {
13 |
14 | @Nullable
15 | HaskellExpression getExpression();
16 |
17 | @NotNull
18 | List getPragmaList();
19 |
20 | @NotNull
21 | HaskellTypeFamilyType getTypeFamilyType();
22 |
23 | String getName();
24 |
25 | ItemPresentation getPresentation();
26 |
27 | Seq getIdentifierElements();
28 |
29 | Option getModuleName();
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/HaskellDataConstructorDeclarationElement.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi
18 |
19 | trait HaskellDataConstructorDeclarationElement extends HaskellDeclarationElement {
20 | def getDataTypeConstructor: HaskellNamedElement
21 | }
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellQuasiQuoteImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import com.intellij.lang.ASTNode;
5 | import com.intellij.psi.PsiElementVisitor;
6 | import intellij.haskell.psi.HaskellQuasiQuote;
7 | import intellij.haskell.psi.HaskellVisitor;
8 | import org.jetbrains.annotations.NotNull;
9 |
10 | public class HaskellQuasiQuoteImpl extends HaskellQuasiQuoteElementImpl implements HaskellQuasiQuote {
11 |
12 | public HaskellQuasiQuoteImpl(ASTNode node) {
13 | super(node);
14 | }
15 |
16 | public void accept(@NotNull HaskellVisitor visitor) {
17 | visitor.visitQuasiQuote(this);
18 | }
19 |
20 | public void accept(@NotNull PsiElementVisitor visitor) {
21 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor) visitor);
22 | else super.accept(visitor);
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellDerivingDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import com.intellij.navigation.ItemPresentation;
5 | import org.jetbrains.annotations.NotNull;
6 | import org.jetbrains.annotations.Nullable;
7 | import scala.Option;
8 | import scala.collection.immutable.Seq;
9 |
10 | import java.util.List;
11 |
12 | public interface HaskellDerivingDeclaration extends HaskellDeclarationElement {
13 |
14 | @NotNull
15 | HaskellInst getInst();
16 |
17 | @NotNull
18 | List getPragmaList();
19 |
20 | @NotNull
21 | HaskellQName getQName();
22 |
23 | @Nullable
24 | HaskellScontext getScontext();
25 |
26 | String getName();
27 |
28 | ItemPresentation getPresentation();
29 |
30 | Seq getIdentifierElements();
31 |
32 | Option getModuleName();
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellDerivingViaImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import com.intellij.lang.ASTNode;
5 | import com.intellij.psi.PsiElementVisitor;
6 | import intellij.haskell.psi.HaskellDerivingVia;
7 | import intellij.haskell.psi.HaskellVisitor;
8 | import org.jetbrains.annotations.NotNull;
9 |
10 | public class HaskellDerivingViaImpl extends HaskellCompositeElementImpl implements HaskellDerivingVia {
11 |
12 | public HaskellDerivingViaImpl(ASTNode node) {
13 | super(node);
14 | }
15 |
16 | public void accept(@NotNull HaskellVisitor visitor) {
17 | visitor.visitDerivingVia(this);
18 | }
19 |
20 | public void accept(@NotNull PsiElementVisitor visitor) {
21 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor) visitor);
22 | else super.accept(visitor);
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/ui/EnterNameDialog.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.ui
2 |
3 | import java.awt.BorderLayout
4 |
5 | import com.intellij.openapi.ui.DialogWrapper
6 | import javax.swing.{JComponent, JLabel, JPanel, JTextField}
7 |
8 | class EnterNameDialog(prompt: String, suggestion: String = "") extends DialogWrapper(true) {
9 | private val textField = if (suggestion.isEmpty) new JTextField(10) else new JTextField(suggestion)
10 | init()
11 | setTitle(prompt)
12 | override def createCenterPanel(): JComponent = {
13 | val dialogPanel: JPanel = new JPanel(new BorderLayout)
14 |
15 | val label: JLabel = new JLabel(prompt)
16 | dialogPanel.add(label, BorderLayout.NORTH)
17 |
18 | dialogPanel.add(textField, BorderLayout.SOUTH)
19 |
20 | dialogPanel
21 | }
22 |
23 | override def getPreferredFocusedComponent: JComponent = textField
24 |
25 | def getName: String = textField.getText
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/action/ghci/ReloadWithLastCommandAction.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.action.ghci
2 |
3 | import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent}
4 | import intellij.haskell.action.ActionUtil
5 | import intellij.haskell.runconfig.console.HaskellConsoleViewMap
6 |
7 | class ReloadWithLastCommandAction extends AnAction {
8 |
9 | override def update(actionEvent: AnActionEvent): Unit = {
10 | actionEvent.getPresentation.setEnabled(HaskellConsoleViewMap.getConsole(actionEvent.getProject).isDefined)
11 | }
12 |
13 | def actionPerformed(actionEvent: AnActionEvent): Unit = {
14 | for {
15 | actionContext <- ActionUtil.findActionContext(actionEvent)
16 | consoleView <- HaskellConsoleViewMap.getConsole(actionContext.project)
17 | } yield {
18 | consoleView.executeCommand(":reload", addToHistory = false)
19 | consoleView.executeLastCommand()
20 | }
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/alex/lang/psi/impl/AlexElementManipulator.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.alex.lang.psi.impl
2 |
3 | import com.intellij.openapi.util.TextRange
4 | import com.intellij.psi.AbstractElementManipulator
5 | import com.intellij.util.IncorrectOperationException
6 | import org.jetbrains.annotations.Nullable
7 |
8 | /**
9 | * @author ice1000
10 | */
11 | class AlexElementManipulator extends AbstractElementManipulator[AlexHaskellCodeInjectionHost] {
12 | @Nullable
13 | @throws[IncorrectOperationException]
14 | override def handleContentChange(psi: AlexHaskellCodeInjectionHost,
15 | range: TextRange,
16 | newContent: String): AlexHaskellCodeInjectionHost = {
17 | val oldText = psi.getText
18 | val newText = oldText.substring(0, range.getStartOffset) + newContent + oldText.substring(range.getEndOffset)
19 | psi.updateText(newText)
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/HaskellDeclarationElement.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi
18 |
19 | import com.intellij.navigation.NavigationItem
20 |
21 | trait HaskellDeclarationElement extends HaskellCompositeElement with NavigationItem {
22 | def getIdentifierElements: Iterable[HaskellNamedElement]
23 | }
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexRuleIdImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexRuleIdImpl extends AlexIdMixin implements AlexRuleId {
14 |
15 | public AlexRuleIdImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitRuleId(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellDotDotImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellDotDotImpl extends HaskellCompositeElementImpl implements HaskellDotDot {
14 |
15 | public HaskellDotDotImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitDotDot(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/HaskellQualifiedNameElement.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi
18 |
19 | trait HaskellQualifiedNameElement extends HaskellCompositeElement {
20 |
21 | def getName: String
22 |
23 | def getIdentifierElement: HaskellNamedElement
24 |
25 | def getQualifierName: Option[String]
26 | }
27 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellCommentsImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellCommentsImpl extends HaskellCompositeElementImpl implements HaskellComments {
14 |
15 | public HaskellCommentsImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitComments(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexRegexPartImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexRegexPartImpl extends AlexElementImpl implements AlexRegexPart {
14 |
15 | public AlexRegexPartImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitRegexPart(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexIdentifierImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexIdentifierImpl extends AlexElementImpl implements AlexIdentifier {
14 |
15 | public AlexIdentifierImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitIdentifier(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexTokenSetIdImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexTokenSetIdImpl extends AlexIdMixin implements AlexTokenSetId {
14 |
15 | public AlexTokenSetIdImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitTokenSetId(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexWrapperTypeImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexWrapperTypeImpl extends AlexElementImpl implements AlexWrapperType {
14 |
15 | public AlexWrapperTypeImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitWrapperType(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellTextLiteralImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellTextLiteralImpl extends HaskellStringLiteralElementImpl implements HaskellTextLiteral {
14 |
15 | public HaskellTextLiteralImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitTextLiteral(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellClassDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import com.intellij.navigation.ItemPresentation;
5 | import org.jetbrains.annotations.NotNull;
6 | import org.jetbrains.annotations.Nullable;
7 | import scala.Option;
8 | import scala.collection.immutable.Seq;
9 |
10 | import java.util.List;
11 |
12 | public interface HaskellClassDeclaration extends HaskellDeclarationElement {
13 |
14 | @Nullable
15 | HaskellCdecls getCdecls();
16 |
17 | @NotNull
18 | List getPragmaList();
19 |
20 | @NotNull
21 | List getQNameList();
22 |
23 | @Nullable
24 | HaskellScontext getScontext();
25 |
26 | @NotNull
27 | List getTtypeList();
28 |
29 | String getName();
30 |
31 | ItemPresentation getPresentation();
32 |
33 | Seq getIdentifierElements();
34 |
35 | Option getModuleName();
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellImportHidingImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellImportHidingImpl extends HaskellCompositeElementImpl implements HaskellImportHiding {
14 |
15 | public HaskellImportHidingImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitImportHiding(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/editor/HaskellCodeFoldingOptionsProvider.java:
--------------------------------------------------------------------------------
1 | package intellij.haskell.editor;
2 |
3 | import com.intellij.application.options.editor.CodeFoldingOptionsProvider;
4 | import com.intellij.openapi.options.BeanConfigurable;
5 |
6 | public class HaskellCodeFoldingOptionsProvider extends BeanConfigurable implements CodeFoldingOptionsProvider {
7 | public HaskellCodeFoldingOptionsProvider() {
8 | super(HaskellFoldingSettings.getInstance().getState(), "Haskell");
9 | HaskellFoldingSettings settings = HaskellFoldingSettings.getInstance();
10 | checkBox("File header", settings::isCollapseFileHeader, value -> settings.getState().COLLAPSE_FILE_HEADER = value);
11 | checkBox("Imports", settings::isCollapseImports, value -> settings.getState().COLLAPSE_IMPORTS = value);
12 | checkBox("Top-level expression", settings::isCollapseTopLevelExpression, value -> settings.getState().COLLAPSE_TOP_LEVEL_EXPRESSION = value);
13 | }
14 | }
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/editor/HaskellQuoteHandler.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.editor
18 |
19 | import com.intellij.codeInsight.editorActions.SimpleTokenSetQuoteHandler
20 | import intellij.haskell.psi.HaskellTypes._
21 |
22 | class HaskellQuoteHandler extends SimpleTokenSetQuoteHandler(HS_STRING_LITERAL, HS_BACKQUOTE, HS_QUOTE, HS_DOUBLE_QUOTES)
23 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/stubs/types/HaskellVarsymStubElementType.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.psi.stubs.types
2 |
3 | import com.intellij.psi.PsiElement
4 | import com.intellij.psi.stubs.{StubElement, StubInputStream}
5 | import intellij.haskell.psi.HaskellVarsym
6 | import intellij.haskell.psi.impl.HaskellVarsymImpl
7 | import intellij.haskell.psi.stubs.HaskellVarsymStub
8 |
9 | class HaskellVarsymStubElementType(debugName: String) extends HaskellNamedStubElementType[HaskellVarsymStub, HaskellVarsym](debugName) {
10 | def createPsi(stub: HaskellVarsymStub): HaskellVarsym = {
11 | new HaskellVarsymImpl(stub, this)
12 | }
13 |
14 | def createStub(psi: HaskellVarsym, parentStub: StubElement[_ <: PsiElement]): HaskellVarsymStub = {
15 | new HaskellVarsymStub(parentStub, this, psi.getName)
16 | }
17 |
18 | def deserialize(dataStream: StubInputStream, parentStub: StubElement[_ <: PsiElement]): HaskellVarsymStub = {
19 | new HaskellVarsymStub(parentStub, this, dataStream.readName)
20 | }
21 | }
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellImportEmptySpecImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellImportEmptySpecImpl extends HaskellCompositeElementImpl implements HaskellImportEmptySpec {
14 |
15 | public HaskellImportEmptySpecImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitImportEmptySpec(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellImportQualifiedImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellImportQualifiedImpl extends HaskellCompositeElementImpl implements HaskellImportQualified {
14 |
15 | public HaskellImportQualifiedImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitImportQualified(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexUserCodeSectionImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexUserCodeSectionImpl extends AlexHaskellCodeInjectionHost implements AlexUserCodeSection {
14 |
15 | public AlexUserCodeSectionImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitUserCodeSection(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexTopModuleSectionImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexTopModuleSectionImpl extends AlexHaskellCodeInjectionHost implements AlexTopModuleSection {
14 |
15 | public AlexTopModuleSectionImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitTopModuleSection(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/HaskellCompositeElementType.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi
18 |
19 | import com.intellij.psi.tree.IElementType
20 | import intellij.haskell.HaskellLanguage
21 | import org.jetbrains.annotations.{NonNls, NotNull}
22 |
23 | class HaskellCompositeElementType(@NotNull @NonNls debugName: String) extends IElementType(debugName, HaskellLanguage.Instance)
24 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellGeneralPragmaContentImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellGeneralPragmaContentImpl extends HaskellCompositeElementImpl implements HaskellGeneralPragmaContent {
14 |
15 | public HaskellGeneralPragmaContentImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitGeneralPragmaContent(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/HaskellNamedElement.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi
18 |
19 | import com.intellij.navigation.NavigationItem
20 | import com.intellij.psi.PsiNameIdentifierOwner
21 | import com.intellij.psi.search.SearchScope
22 |
23 | trait HaskellNamedElement extends HaskellCompositeElement with PsiNameIdentifierOwner with NavigationItem {
24 | def getUseScope: SearchScope
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/editor/formatter/settings/HaskellCodeStyleSettings.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.editor.formatter.settings
18 |
19 | import com.intellij.psi.codeStyle.{CodeStyleSettings, CustomCodeStyleSettings}
20 |
21 | class HaskellCodeStyleSettings(settings: CodeStyleSettings) extends CustomCodeStyleSettings("HaskellCodeStyleSettings", settings) {
22 | settings.AUTODETECT_INDENTS = false
23 | }
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/runconfig/HaskellStackConfigurationType.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.runconfig
2 |
3 | import javax.swing.Icon
4 | import com.intellij.execution.configurations.{ConfigurationFactory, ConfigurationType}
5 | import icons.HaskellIcons
6 | import intellij.haskell.runconfig.console.HaskellConsoleConfigurationFactory
7 | import intellij.haskell.runconfig.run.HaskellRunConfigurationFactory
8 | import intellij.haskell.runconfig.test.HaskellTestConfigurationFactory
9 |
10 | class HaskellStackConfigurationType extends ConfigurationType {
11 | def getDisplayName: String = "Haskell Stack"
12 |
13 | def getConfigurationTypeDescription: String = "Haskell Stack configuration"
14 |
15 | def getIcon: Icon = HaskellIcons.HaskellLogo
16 |
17 | def getId = "HaskellStackConfigurationType"
18 |
19 | def getConfigurationFactories: Array[ConfigurationFactory] = Array[ConfigurationFactory](
20 | new HaskellConsoleConfigurationFactory(this),
21 | new HaskellRunConfigurationFactory(this),
22 | new HaskellTestConfigurationFactory(this)
23 | )
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/runconfig/console/HaskellConsoleActionPromoter.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.runconfig.console
2 |
3 | import com.intellij.openapi.actionSystem.{ActionPromoter, AnAction, DataContext}
4 | import com.intellij.openapi.editor.actions.EnterAction
5 | import com.intellij.util.containers.ContainerUtil
6 |
7 | import java.util
8 | import java.util.Comparator
9 |
10 | class HaskellConsoleActionPromoter extends ActionPromoter {
11 | private val Comparator = new Comparator[AnAction]() {
12 | def compare(o1: AnAction, o2: AnAction): Int = {
13 | (notEnter(o1), notEnter(o2)) match {
14 | case (false, true) => 1
15 | case (true, false) => -1
16 | case _ => 0
17 | }
18 | }
19 |
20 | private def notEnter(o: AnAction) = !o.isInstanceOf[EnterAction]
21 | }
22 |
23 | override def promote(actions: util.List[_ <: AnAction], context: DataContext): util.List[AnAction] = {
24 | val result = new util.ArrayList[AnAction](actions)
25 | ContainerUtil.sort(result, Comparator)
26 | result
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/action/UpdateHaskellToolsAction.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.action
2 |
3 | import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent}
4 | import com.intellij.openapi.project.Project
5 | import intellij.haskell.HaskellNotificationGroup
6 | import intellij.haskell.external.component.StackProjectManager
7 | import intellij.haskell.util.HaskellEditorUtil
8 |
9 | class UpdateHaskellToolsAction extends AnAction {
10 |
11 | override def update(actionEvent: AnActionEvent): Unit = {
12 | HaskellEditorUtil.enableExternalAction(actionEvent, (project: Project) => !StackProjectManager.isInstallingHaskellTools(project) && !StackProjectManager.isInitializing(project) && !StackProjectManager.isPreloadingAllLibraryIdentifiers(project))
13 | }
14 |
15 | def actionPerformed(actionEvent: AnActionEvent): Unit = {
16 | Option(actionEvent.getProject).foreach(project => {
17 | HaskellNotificationGroup.logInfoEvent(project, "Updating Haskell Tools")
18 | StackProjectManager.installHaskellTools(project, update = true)
19 | })
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/HaskellFileType.java:
--------------------------------------------------------------------------------
1 | package intellij.haskell;
2 |
3 | import com.intellij.lang.Language;
4 | import com.intellij.openapi.fileTypes.LanguageFileType;
5 | import icons.HaskellIcons;
6 | import org.jetbrains.annotations.NotNull;
7 | import org.jetbrains.annotations.Nullable;
8 |
9 | import javax.swing.*;
10 |
11 | public class HaskellFileType extends LanguageFileType {
12 |
13 | public static final HaskellFileType INSTANCE = new HaskellFileType(HaskellLanguage.Instance);
14 |
15 | protected HaskellFileType(@NotNull Language language) {
16 | super(language);
17 | }
18 |
19 | @NotNull
20 | @Override
21 | public String getName() {
22 | return "Haskell";
23 | }
24 |
25 | @NotNull
26 | @Override
27 | public String getDescription() {
28 | return "Haskell file";
29 | }
30 |
31 | @NotNull
32 | @Override
33 | public String getDefaultExtension() {
34 | return "hs";
35 | }
36 |
37 | @Nullable
38 | @Override
39 | public Icon getIcon() {
40 | return HaskellIcons.HaskellLogo;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellInstanceDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import com.intellij.navigation.ItemPresentation;
5 | import org.jetbrains.annotations.NotNull;
6 | import org.jetbrains.annotations.Nullable;
7 | import scala.Option;
8 | import scala.collection.immutable.Seq;
9 |
10 | import java.util.List;
11 |
12 | public interface HaskellInstanceDeclaration extends HaskellDeclarationElement {
13 |
14 | @Nullable
15 | HaskellCidecls getCidecls();
16 |
17 | @Nullable
18 | HaskellInst getInst();
19 |
20 | @NotNull
21 | List getPragmaList();
22 |
23 | @Nullable
24 | HaskellQName getQName();
25 |
26 | @Nullable
27 | HaskellScontext getScontext();
28 |
29 | @Nullable
30 | HaskellTypeEquality getTypeEquality();
31 |
32 | @NotNull
33 | List getVaridList();
34 |
35 | String getName();
36 |
37 | ItemPresentation getPresentation();
38 |
39 | Seq getIdentifierElements();
40 |
41 | Option getModuleName();
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellGtyconImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellGtyconImpl extends HaskellCompositeElementImpl implements HaskellGtycon {
14 |
15 | public HaskellGtyconImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitGtycon(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @Nullable
30 | public HaskellQName getQName() {
31 | return PsiTreeUtil.getChildOfType(this, HaskellQName.class);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/alex/AlexFileType.java:
--------------------------------------------------------------------------------
1 | package intellij.haskell.alex;
2 |
3 | import com.intellij.lang.Language;
4 | import com.intellij.openapi.fileTypes.LanguageFileType;
5 | import icons.HaskellIcons;
6 | import org.jetbrains.annotations.NotNull;
7 | import org.jetbrains.annotations.Nullable;
8 |
9 | import javax.swing.*;
10 |
11 | public class AlexFileType extends LanguageFileType {
12 |
13 | public static final AlexFileType INSTANCE = new AlexFileType(AlexLanguage.Instance);
14 |
15 | protected AlexFileType(@NotNull Language language) {
16 | super(language);
17 | }
18 |
19 | @NotNull
20 | @Override
21 | public String getName() {
22 | return "Alex";
23 | }
24 |
25 | @NotNull
26 | @Override
27 | public String getDescription() {
28 | return "Alex source file (Haskell lexer generator)";
29 | }
30 |
31 | @NotNull
32 | @Override
33 | public String getDefaultExtension() {
34 | return "x";
35 | }
36 |
37 | @Nullable
38 | @Override
39 | public Icon getIcon() {
40 | return HaskellIcons.AlexLogo;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellListTypeImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellListTypeImpl extends HaskellCompositeElementImpl implements HaskellListType {
14 |
15 | public HaskellListTypeImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitListType(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @Nullable
30 | public HaskellQName getQName() {
31 | return PsiTreeUtil.getChildOfType(this, HaskellQName.class);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/HaskellNamedElementManipulator.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi
18 |
19 | import com.intellij.openapi.util.TextRange
20 | import com.intellij.psi.AbstractElementManipulator
21 |
22 | class HaskellNamedElementManipulator extends AbstractElementManipulator[HaskellNamedElement] {
23 | def handleContentChange(psi: HaskellNamedElement, range: TextRange, newContent: String): HaskellNamedElement = {
24 | psi.setName(newContent)
25 | psi
26 | }
27 | }
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/CabalFileType.java:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal;
2 |
3 | import com.intellij.lang.Language;
4 | import com.intellij.openapi.fileTypes.LanguageFileType;
5 | import icons.HaskellIcons;
6 | import org.jetbrains.annotations.NotNull;
7 | import org.jetbrains.annotations.Nullable;
8 |
9 | import javax.swing.*;
10 |
11 | public class CabalFileType extends LanguageFileType {
12 |
13 | public static final CabalFileType INSTANCE = new CabalFileType(CabalLanguage.Instance);
14 |
15 | protected CabalFileType(@NotNull Language language) {
16 | super(language);
17 | }
18 |
19 | @NotNull
20 | @Override
21 | public String getName() {
22 | return "Cabal";
23 | }
24 |
25 | @NotNull
26 | @Override
27 | public String getDescription() {
28 | return "Cabal file (Haskell package description)";
29 | }
30 |
31 | @NotNull
32 | @Override
33 | public String getDefaultExtension() {
34 | return "cabal";
35 | }
36 |
37 | @Nullable
38 | @Override
39 | public Icon getIcon() {
40 | return HaskellIcons.CabalLogo;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellQNamesImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellQNamesImpl extends HaskellCompositeElementImpl implements HaskellQNames {
14 |
15 | public HaskellQNamesImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitQNames(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public List getQNameList() {
31 | return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/lang/psi/CabalNamedElementManipulator.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.cabal.lang.psi
18 |
19 | import com.intellij.openapi.util.TextRange
20 | import com.intellij.psi.AbstractElementManipulator
21 |
22 | class CabalNamedElementManipulator extends AbstractElementManipulator[CabalNamedElement] {
23 | def handleContentChange(psi: CabalNamedElement, range: TextRange, newContent: String): CabalNamedElement = {
24 | psi.setName(newContent)
25 | psi
26 | }
27 | }
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellTypeDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import com.intellij.navigation.ItemPresentation;
5 | import org.jetbrains.annotations.NotNull;
6 | import org.jetbrains.annotations.Nullable;
7 | import scala.Option;
8 | import scala.collection.immutable.Seq;
9 |
10 | import java.util.List;
11 |
12 | public interface HaskellTypeDeclaration extends HaskellDeclarationElement {
13 |
14 | @Nullable
15 | HaskellExpression getExpression();
16 |
17 | @NotNull
18 | List getKindSignatureList();
19 |
20 | @NotNull
21 | List getPragmaList();
22 |
23 | @NotNull
24 | List getQNameList();
25 |
26 | @NotNull
27 | HaskellSimpletype getSimpletype();
28 |
29 | @Nullable
30 | HaskellTtype getTtype();
31 |
32 | @Nullable
33 | HaskellTypeSignature getTypeSignature();
34 |
35 | String getName();
36 |
37 | ItemPresentation getPresentation();
38 |
39 | Seq getIdentifierElements();
40 |
41 | Option getModuleName();
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/CabalCommenter.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.cabal
18 |
19 | import com.intellij.lang.Commenter
20 |
21 | class CabalCommenter extends Commenter {
22 | override def getCommentedBlockCommentPrefix: String = null
23 |
24 | override def getBlockCommentSuffix: String = null
25 |
26 | override def getBlockCommentPrefix: String = null
27 |
28 | override def getLineCommentPrefix: String = "--"
29 |
30 | override def getCommentedBlockCommentSuffix: String = null
31 | }
32 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellFileHeaderImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellFileHeaderImpl extends HaskellCompositeElementImpl implements HaskellFileHeader {
14 |
15 | public HaskellFileHeaderImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitFileHeader(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public List getPragmaList() {
31 | return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellPragma.class);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellTypeEqualityImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellTypeEqualityImpl extends HaskellCompositeElementImpl implements HaskellTypeEquality {
14 |
15 | public HaskellTypeEqualityImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitTypeEquality(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public List getQNameList() {
31 | return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellCidecl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import org.jetbrains.annotations.NotNull;
5 | import org.jetbrains.annotations.Nullable;
6 |
7 | import java.util.List;
8 |
9 | public interface HaskellCidecl extends HaskellCompositeElement {
10 |
11 | @Nullable
12 | HaskellDataDeclaration getDataDeclaration();
13 |
14 | @Nullable
15 | HaskellDefaultDeclaration getDefaultDeclaration();
16 |
17 | @NotNull
18 | List getDotDotList();
19 |
20 | @Nullable
21 | HaskellInstanceDeclaration getInstanceDeclaration();
22 |
23 | @Nullable
24 | HaskellNewtypeDeclaration getNewtypeDeclaration();
25 |
26 | @Nullable
27 | HaskellPragma getPragma();
28 |
29 | @NotNull
30 | List getQNameList();
31 |
32 | @NotNull
33 | List getQuasiQuoteList();
34 |
35 | @NotNull
36 | List getTextLiteralList();
37 |
38 | @Nullable
39 | HaskellTypeDeclaration getTypeDeclaration();
40 |
41 | @Nullable
42 | HaskellTypeFamilyDeclaration getTypeFamilyDeclaration();
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellPragmaImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellPragmaImpl extends HaskellCompositeElementImpl implements HaskellPragma {
14 |
15 | public HaskellPragmaImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitPragma(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public List getGeneralPragmaContentList() {
31 | return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellGeneralPragmaContent.class);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/HaskellTokenType.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package intellij.haskell.psi
17 |
18 | import com.intellij.psi.tree.IElementType
19 | import intellij.haskell.HaskellLanguage
20 | import org.jetbrains.annotations.{NonNls, NotNull}
21 |
22 | class HaskellTokenType(@NotNull @NonNls debugName: String) extends IElementType(debugName, HaskellLanguage.Instance) {
23 |
24 | override def toString: String = {
25 | "HaskellTokenType." + super.toString
26 | }
27 |
28 | def getName: String = {
29 | super.toString.toLowerCase
30 | }
31 | }
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexTokensSectionImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexTokensSectionImpl extends AlexElementImpl implements AlexTokensSection {
14 |
15 | public AlexTokensSectionImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitTokensSection(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public List getTokensRuleList() {
31 | return PsiTreeUtil.getChildrenOfTypeAsList(this, AlexTokensRule.class);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellFixityDeclarationImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellFixityDeclarationImpl extends HaskellCompositeElementImpl implements HaskellFixityDeclaration {
14 |
15 | public HaskellFixityDeclarationImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitFixityDeclaration(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public HaskellQNames getQNames() {
31 | return notNullChild(PsiTreeUtil.getChildOfType(this, HaskellQNames.class));
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellImportQualifiedAsImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellImportQualifiedAsImpl extends HaskellCompositeElementImpl implements HaskellImportQualifiedAs {
14 |
15 | public HaskellImportQualifiedAsImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitImportQualifiedAs(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public HaskellQualifier getQualifier() {
31 | return notNullChild(PsiTreeUtil.getChildOfType(this, HaskellQualifier.class));
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/alex/lang/AlexBraceMatcher.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.alex.lang
2 |
3 | import com.intellij.lang.{BracePair, PairedBraceMatcher}
4 | import com.intellij.psi.PsiFile
5 | import com.intellij.psi.tree.IElementType
6 | import intellij.haskell.alex.lang.psi.AlexTypes
7 |
8 | /**
9 | * @author ice1000
10 | */
11 | object AlexBraceMatcher {
12 | final val PAIRS = Array(
13 | new BracePair(AlexTypes.ALEX_SOMETHING_IS_GONNA_HAPPEN, AlexTypes.ALEX_SOMETHING_HAS_ALREADY_HAPPENED, false),
14 | new BracePair(AlexTypes.ALEX_STATEFUL_TOKENS_RULE_START, AlexTypes.ALEX_STATEFUL_TOKENS_RULE_END, false),
15 | new BracePair(AlexTypes.ALEX_LEFT_LISP, AlexTypes.ALEX_RIGHT_LISP, false)
16 | )
17 | }
18 |
19 | /**
20 | * @author ice1000
21 | */
22 | class AlexBraceMatcher extends PairedBraceMatcher {
23 | override def getPairs: Array[BracePair] = {
24 | AlexBraceMatcher.PAIRS
25 | }
26 |
27 | override def isPairedBracesAllowedBeforeType(iElementType: IElementType, iElementType1: IElementType): Boolean = {
28 | true
29 | }
30 |
31 | override def getCodeConstructStart(psiFile: PsiFile, openingBraceOffset: Int): Int = {
32 | openingBraceOffset
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexStatelessTokensRuleImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexStatelessTokensRuleImpl extends AlexElementImpl implements AlexStatelessTokensRule {
14 |
15 | public AlexStatelessTokensRuleImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitStatelessTokensRule(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public AlexRuleDescription getRuleDescription() {
31 | return findNotNullChildByClass(AlexRuleDescription.class);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellImportPackageNameImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellImportPackageNameImpl extends HaskellCompositeElementImpl implements HaskellImportPackageName {
14 |
15 | public HaskellImportPackageNameImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitImportPackageName(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public HaskellTextLiteral getTextLiteral() {
31 | return notNullChild(PsiTreeUtil.getChildOfType(this, HaskellTextLiteral.class));
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexDeclarationsSectionImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexDeclarationsSectionImpl extends AlexElementImpl implements AlexDeclarationsSection {
14 |
15 | public AlexDeclarationsSectionImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitDeclarationsSection(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public List getDeclarationList() {
31 | return PsiTreeUtil.getChildrenOfTypeAsList(this, AlexDeclaration.class);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/runconfig/console/HaskellConsoleExecuteAction.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.runconfig.console
2 |
3 | import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent, CommonDataKeys}
4 | import com.intellij.openapi.editor.Editor
5 | import com.intellij.openapi.editor.ex.EditorEx
6 |
7 | class HaskellConsoleExecuteAction extends AnAction {
8 |
9 | override def update(actionEvent: AnActionEvent): Unit = {
10 | val presentation = actionEvent.getPresentation
11 | val editor: Editor = actionEvent.getData(CommonDataKeys.EDITOR)
12 | if (!editor.isInstanceOf[EditorEx] || editor.asInstanceOf[EditorEx].isRendererMode) {
13 | presentation.setEnabled(false)
14 | } else {
15 | HaskellConsoleViewMap.getConsole(editor) match {
16 | case Some(consoleView) => presentation.setEnabledAndVisible(consoleView.isRunning)
17 | case None => presentation.setEnabled(false)
18 | }
19 | }
20 | }
21 |
22 | override def actionPerformed(actionEvent: AnActionEvent): Unit = {
23 | for {
24 | editor <- Option(actionEvent.getData(CommonDataKeys.EDITOR))
25 | consoleView <- HaskellConsoleViewMap.getConsole(editor)
26 | } yield consoleView.execute()
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexRegexImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexRegexImpl extends AlexElementImpl implements AlexRegex {
14 |
15 | public AlexRegexImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitRegex(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @Nullable
30 | public AlexRegexPart getRegexPart() {
31 | return findChildByClass(AlexRegexPart.class);
32 | }
33 |
34 | @Override
35 | @Nullable
36 | public AlexTokenSetId getTokenSetId() {
37 | return findChildByClass(AlexTokenSetId.class);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/runconfig/console/HaskellConsoleViewMap.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.runconfig.console
2 |
3 | import java.util.concurrent.ConcurrentHashMap
4 |
5 | import com.intellij.openapi.editor.Editor
6 | import com.intellij.openapi.project.Project
7 | import com.intellij.psi.PsiFile
8 |
9 | import scala.collection.concurrent
10 | import scala.jdk.CollectionConverters._
11 |
12 | object HaskellConsoleViewMap {
13 | private val consoleViews = new ConcurrentHashMap[Editor, HaskellConsoleView]().asScala
14 |
15 | def addConsole(console: HaskellConsoleView): Unit = {
16 | consoleViews.put(console.getConsoleEditor, console)
17 | }
18 |
19 | def delConsole(console: HaskellConsoleView): Unit = {
20 | consoleViews.remove(console.getConsoleEditor)
21 | }
22 |
23 | def getConsole(editor: Editor): Option[HaskellConsoleView] = {
24 | consoleViews.get(editor)
25 | }
26 |
27 | def getConsole(editor: Project): Option[HaskellConsoleView] = {
28 | consoleViews.values.find(console => console.project == editor && console.isShowing)
29 | }
30 |
31 | // File is project file and not file which represents console
32 | val projectFileByConfigName: concurrent.Map[String, PsiFile] = new ConcurrentHashMap[String, PsiFile]().asScala
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/HaskellLanguage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell;
18 |
19 | import com.intellij.lang.Language;
20 | import org.jetbrains.annotations.NotNull;
21 |
22 | public class HaskellLanguage extends Language {
23 |
24 | public static final HaskellLanguage Instance = new HaskellLanguage();
25 |
26 | public HaskellLanguage() {
27 | super("Haskell");
28 | }
29 |
30 | @NotNull
31 | @Override
32 | public String getDisplayName() {
33 | return "Haskell";
34 | }
35 |
36 | @Override
37 | public boolean isCaseSensitive() {
38 | return true;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/action/ghci/LoadModuleAction.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.action.ghci
2 |
3 | import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent}
4 | import intellij.haskell.HaskellNotificationGroup
5 | import intellij.haskell.action.ActionUtil
6 | import intellij.haskell.runconfig.console.HaskellConsoleViewMap
7 | import intellij.haskell.util.HaskellFileUtil
8 |
9 | class LoadModuleAction extends AnAction {
10 |
11 | override def update(actionEvent: AnActionEvent): Unit = {
12 | actionEvent.getPresentation.setEnabled(HaskellConsoleViewMap.getConsole(actionEvent.getProject).isDefined)
13 | }
14 |
15 | def actionPerformed(actionEvent: AnActionEvent): Unit = {
16 | for {
17 | actionContext <- ActionUtil.findActionContext(actionEvent)
18 | consoleView <- HaskellConsoleViewMap.getConsole(actionContext.project)
19 | } yield {
20 | HaskellFileUtil.getAbsolutePath(actionContext.psiFile) match {
21 | case Some(filePath) => consoleView.executeCommand(s":load $filePath", addToHistory = false)
22 | case None => HaskellNotificationGroup.logWarningBalloonEvent(actionContext.project, s"Can't load file in REPL because `${actionContext.psiFile.getName}` only exists in memory")
23 | }
24 | }
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/CabalLanguage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.cabal;
18 |
19 | import com.intellij.lang.Language;
20 | import org.jetbrains.annotations.NotNull;
21 |
22 | public class CabalLanguage extends Language {
23 |
24 | public static final CabalLanguage Instance = new CabalLanguage();
25 |
26 | public CabalLanguage() {
27 | super("Cabal");
28 | }
29 |
30 | @NotNull
31 | @Override
32 | public String getDisplayName() {
33 | return "Cabal";
34 | }
35 |
36 | @Override
37 | public boolean isCaseSensitive() {
38 | return true;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/intention/RemoveParensIntention.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.intention
2 |
3 | import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction
4 | import com.intellij.openapi.editor.Editor
5 | import com.intellij.openapi.project.Project
6 | import com.intellij.psi.PsiElement
7 | import intellij.haskell.psi.HaskellPsiUtil
8 | import intellij.haskell.psi.HaskellTypes._
9 |
10 | class RemoveParensIntention extends PsiElementBaseIntentionAction {
11 |
12 | override def invoke(project: Project, editor: Editor, psiElement: PsiElement): Unit = {
13 | for {
14 | (start, end) <- HaskellPsiUtil.getSelectionStartEnd(psiElement, editor)
15 | } yield {
16 | start.delete()
17 | end.delete()
18 | }
19 | }
20 |
21 | override def isAvailable(project: Project, editor: Editor, psiElement: PsiElement): Boolean = {
22 | HaskellPsiUtil.getSelectionStartEnd(psiElement, editor) match {
23 | case Some((start, end)) => psiElement.isWritable && start.getNode.getElementType == HS_LEFT_PAREN && end.getNode.getElementType == HS_RIGHT_PAREN
24 | case None => false
25 | }
26 | }
27 |
28 | override def getFamilyName: String = getText
29 |
30 | override def getText: String = "Remove parens around expression"
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/stubs/types/HaskellStubElementType.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi.stubs.types
18 |
19 | import com.intellij.psi.stubs.{IStubElementType, IndexSink, StubElement}
20 | import intellij.haskell.HaskellLanguage
21 | import intellij.haskell.psi.HaskellCompositeElement
22 |
23 | abstract class HaskellStubElementType[S <: StubElement[T], T <: HaskellCompositeElement](debugName: String) extends IStubElementType[S, T](debugName, HaskellLanguage.Instance) {
24 |
25 | def indexStub(stub: S, sink: IndexSink): Unit
26 |
27 | def getExternalId: String = {
28 | "haskell." + super.toString
29 | }
30 | }
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellInstvarImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellInstvarImpl extends HaskellCompositeElementImpl implements HaskellInstvar {
14 |
15 | public HaskellInstvarImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitInstvar(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @Nullable
30 | public HaskellQName getQName() {
31 | return PsiTreeUtil.getChildOfType(this, HaskellQName.class);
32 | }
33 |
34 | @Override
35 | @Nullable
36 | public HaskellTtype getTtype() {
37 | return PsiTreeUtil.getChildOfType(this, HaskellTtype.class);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/highlighting/CabalAnnotator.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.cabal.highlighting
2 |
3 | import com.intellij.lang.annotation.{AnnotationHolder, Annotator}
4 | import com.intellij.openapi.editor.colors.{EditorColorsManager, TextAttributesKey}
5 | import com.intellij.psi.PsiElement
6 | import intellij.haskell.cabal.lang.psi.CabalTypes._
7 | import intellij.haskell.cabal.lang.psi._
8 | import intellij.haskell.highlighter.HighlightingAnnotator
9 |
10 | class CabalAnnotator extends Annotator {
11 |
12 | def annotate(el: PsiElement, h: AnnotationHolder): Unit = {
13 | el.getNode.getElementType match {
14 | case _: CabalFieldKeyTokenType => setHighlighting(el, h, CabalSyntaxHighlighter.KEY)
15 | case _: CabalStanzaKeyTokenType => setHighlighting(el, h, CabalSyntaxHighlighter.CONFIG)
16 | case _: CabalStanzaArgTokenType => setHighlighting(el, h, CabalSyntaxHighlighter.CONFIG)
17 | case LBRACE | RBRACE => setHighlighting(el, h, CabalSyntaxHighlighter.COLON)
18 | case _ => // noop
19 | }
20 | }
21 |
22 | private def setHighlighting(element: PsiElement, holder: AnnotationHolder, key: TextAttributesKey): Unit = {
23 | HighlightingAnnotator.infoAnnotation(holder, element, EditorColorsManager.getInstance.getGlobalScheme.getAttributes(key))
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/external/component/package.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.external
2 |
3 | package object component {
4 |
5 | sealed trait NoInfo {
6 | def message: String
7 | }
8 |
9 | case object ReplNotAvailable extends NoInfo {
10 | def message: String = "No info because REPL isn't (yet) available"
11 | }
12 |
13 | case class NoInfoAvailable(name: String, locationName: String, errorMessage: Option[String] = None) extends NoInfo {
14 | override def message: String = s"No info available for $name in $locationName" + errorMessage.map(m => s" | Error message: $m").getOrElse("")
15 | }
16 |
17 | case object IndexNotReady extends NoInfo {
18 | override def message: String = "No info because index isn't ready"
19 | }
20 |
21 | case class ModuleNotAvailable(name: String) extends NoInfo {
22 | override def message: String = s"No info because $name isn't loaded or found"
23 | }
24 |
25 | case class ReadActionTimeout(readActionDescription: String) extends NoInfo {
26 | def message = s"No info because read action timed out while $readActionDescription"
27 | }
28 |
29 | // GHCi output: No matching export in any local modules.
30 | case object NoMatchingExport extends NoInfo {
31 | def message: String = "No matching export in any local modules"
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexRuleDescriptionImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexRuleDescriptionImpl extends AlexElementImpl implements AlexRuleDescription {
14 |
15 | public AlexRuleDescriptionImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitRuleDescription(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public List getRegexList() {
31 | return PsiTreeUtil.getChildrenOfTypeAsList(this, AlexRegex.class);
32 | }
33 |
34 | @Override
35 | @Nullable
36 | public AlexRuleId getRuleId() {
37 | return findChildByClass(AlexRuleId.class);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellConstr3Impl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellConstr3Impl extends HaskellCompositeElementImpl implements HaskellConstr3 {
14 |
15 | public HaskellConstr3Impl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitConstr3(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public List getPragmaList() {
31 | return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellPragma.class);
32 | }
33 |
34 | @Override
35 | @NotNull
36 | public List getTtypeList() {
37 | return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellSimpleclassImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellSimpleclassImpl extends HaskellCompositeElementImpl implements HaskellSimpleclass {
14 |
15 | public HaskellSimpleclassImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitSimpleclass(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public List getQNameList() {
31 | return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class);
32 | }
33 |
34 | @Override
35 | @Nullable
36 | public HaskellTtype getTtype() {
37 | return PsiTreeUtil.getChildOfType(this, HaskellTtype.class);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexRuleDeclarationImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexRuleDeclarationImpl extends AlexElementImpl implements AlexRuleDeclaration {
14 |
15 | public AlexRuleDeclarationImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitRuleDeclaration(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public List getRegexList() {
31 | return PsiTreeUtil.getChildrenOfTypeAsList(this, AlexRegex.class);
32 | }
33 |
34 | @Override
35 | @NotNull
36 | public AlexRuleId getRuleId() {
37 | return findNotNullChildByClass(AlexRuleId.class);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/HaskellFile.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell
18 |
19 | import com.intellij.extapi.psi.PsiFileBase
20 | import com.intellij.openapi.fileTypes._
21 | import com.intellij.psi.FileViewProvider
22 | import javax.swing._
23 | import org.jetbrains.annotations.NotNull
24 |
25 | class HaskellFile(viewProvider: FileViewProvider) extends PsiFileBase(viewProvider, HaskellLanguage.Instance) {
26 |
27 | @NotNull
28 | def getFileType: FileType = {
29 | HaskellFileType.INSTANCE
30 | }
31 |
32 | override def toString: String = {
33 | "Haskell file"
34 | }
35 |
36 | override def getIcon(flags: Int): Icon = {
37 | super.getIcon(flags)
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexDeclarationImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexDeclarationImpl extends AlexElementImpl implements AlexDeclaration {
14 |
15 | public AlexDeclarationImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitDeclaration(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @Nullable
30 | public AlexRuleDeclaration getRuleDeclaration() {
31 | return findChildByClass(AlexRuleDeclaration.class);
32 | }
33 |
34 | @Override
35 | @Nullable
36 | public AlexTokenSetDeclaration getTokenSetDeclaration() {
37 | return findChildByClass(AlexTokenSetDeclaration.class);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexTokensRuleImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexTokensRuleImpl extends AlexElementImpl implements AlexTokensRule {
14 |
15 | public AlexTokensRuleImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitTokensRule(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @Nullable
30 | public AlexStatefulTokensRule getStatefulTokensRule() {
31 | return findChildByClass(AlexStatefulTokensRule.class);
32 | }
33 |
34 | @Override
35 | @Nullable
36 | public AlexStatelessTokensRule getStatelessTokensRule() {
37 | return findChildByClass(AlexStatelessTokensRule.class);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/impl/HaskellKindSignatureImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.psi.HaskellTypes.*;
11 | import intellij.haskell.psi.*;
12 |
13 | public class HaskellKindSignatureImpl extends HaskellCompositeElementImpl implements HaskellKindSignature {
14 |
15 | public HaskellKindSignatureImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull HaskellVisitor visitor) {
20 | visitor.visitKindSignature(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public HaskellQName getQName() {
31 | return notNullChild(PsiTreeUtil.getChildOfType(this, HaskellQName.class));
32 | }
33 |
34 | @Override
35 | @NotNull
36 | public HaskellTtype getTtype() {
37 | return notNullChild(PsiTreeUtil.getChildOfType(this, HaskellTtype.class));
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/cabal/CabalFile.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.cabal
18 |
19 | import com.intellij.extapi.psi.PsiFileBase
20 | import com.intellij.openapi.fileTypes.FileType
21 | import com.intellij.psi.FileViewProvider
22 | import javax.swing._
23 | import org.jetbrains.annotations.NotNull
24 |
25 | class CabalFile(viewProvider: FileViewProvider) extends PsiFileBase(viewProvider, CabalLanguage.Instance) {
26 |
27 | @NotNull
28 | def getFileType: FileType = {
29 | CabalFileType.INSTANCE
30 | }
31 |
32 | override def toString: String = {
33 | "Cabal file"
34 | }
35 |
36 | override def getIcon(flags: Int): Icon = {
37 | super.getIcon(flags)
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/impl/HaskellQuasiQuoteManipulator.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.psi.impl
2 |
3 | import com.intellij.openapi.util.TextRange
4 | import com.intellij.psi.AbstractElementManipulator
5 | import com.intellij.util.IncorrectOperationException
6 | import intellij.haskell.psi.HaskellElementFactory
7 | import org.jetbrains.annotations.Nullable
8 |
9 | /**
10 | * @author ice1000
11 | */
12 | class HaskellQuasiQuoteManipulator extends AbstractElementManipulator[HaskellQuasiQuoteElementImpl] {
13 | @Nullable
14 | @throws[IncorrectOperationException]
15 | override def handleContentChange(psi: HaskellQuasiQuoteElementImpl,
16 | range: TextRange,
17 | newContent: String): HaskellQuasiQuoteElementImpl = {
18 | val oldText = psi.getText
19 | val newText = oldText.substring(0, range.getStartOffset) + newContent + oldText.substring(range.getEndOffset)
20 | val newElement = HaskellElementFactory.createQuasiQuote(psi.getProject, newText)
21 | newElement.map(psi.replace(_).asInstanceOf[HaskellQuasiQuoteElementImpl]).orNull
22 | }
23 |
24 | override def getRangeInElement(element: HaskellQuasiQuoteElementImpl): TextRange = {
25 | val text = element.getText
26 | new TextRange(text.indexOf('|') + 1, text.lastIndexOf('|'))
27 | }
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexTokenSetDeclarationImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexTokenSetDeclarationImpl extends AlexElementImpl implements AlexTokenSetDeclaration {
14 |
15 | public AlexTokenSetDeclarationImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitTokenSetDeclaration(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @NotNull
30 | public List getRegexList() {
31 | return PsiTreeUtil.getChildrenOfTypeAsList(this, AlexRegex.class);
32 | }
33 |
34 | @Override
35 | @NotNull
36 | public AlexTokenSetId getTokenSetId() {
37 | return findNotNullChildByClass(AlexTokenSetId.class);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellNewtypeDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import com.intellij.navigation.ItemPresentation;
5 | import org.jetbrains.annotations.NotNull;
6 | import org.jetbrains.annotations.Nullable;
7 | import scala.Option;
8 | import scala.collection.immutable.Seq;
9 |
10 | import java.util.List;
11 |
12 | public interface HaskellNewtypeDeclaration extends HaskellDataConstructorDeclarationElement {
13 |
14 | @Nullable
15 | HaskellCcontext getCcontext();
16 |
17 | @NotNull
18 | List getDerivingViaList();
19 |
20 | @NotNull
21 | HaskellNewconstr getNewconstr();
22 |
23 | @NotNull
24 | List getPragmaList();
25 |
26 | @NotNull
27 | List getQNameList();
28 |
29 | @NotNull
30 | HaskellSimpletype getSimpletype();
31 |
32 | @Nullable
33 | HaskellTextLiteral getTextLiteral();
34 |
35 | @NotNull
36 | List getTtypeList();
37 |
38 | @NotNull
39 | List getTypeSignatureList();
40 |
41 | String getName();
42 |
43 | ItemPresentation getPresentation();
44 |
45 | Seq getIdentifierElements();
46 |
47 | Option getModuleName();
48 |
49 | HaskellNamedElement getDataTypeConstructor();
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/stubs/HaskellModidStub.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi.stubs;
18 |
19 | import com.intellij.psi.stubs.IStubElementType;
20 | import com.intellij.psi.stubs.NamedStubBase;
21 | import com.intellij.psi.stubs.StubElement;
22 | import com.intellij.util.io.StringRef;
23 | import intellij.haskell.psi.HaskellModid;
24 |
25 | public class HaskellModidStub extends NamedStubBase {
26 | public HaskellModidStub(StubElement parent, IStubElementType elementType, StringRef name) {
27 | super(parent, elementType, name);
28 | }
29 |
30 | public HaskellModidStub(StubElement parent, IStubElementType elementType, String name) {
31 | super(parent, elementType, name);
32 | }
33 | }
--------------------------------------------------------------------------------
/gen/intellij/haskell/alex/lang/psi/impl/AlexStatefulTokensRuleImpl.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.alex.lang.psi.impl;
3 |
4 | import java.util.List;
5 | import org.jetbrains.annotations.*;
6 | import com.intellij.lang.ASTNode;
7 | import com.intellij.psi.PsiElement;
8 | import com.intellij.psi.PsiElementVisitor;
9 | import com.intellij.psi.util.PsiTreeUtil;
10 | import static intellij.haskell.alex.lang.psi.AlexTypes.*;
11 | import intellij.haskell.alex.lang.psi.*;
12 |
13 | public class AlexStatefulTokensRuleImpl extends AlexElementImpl implements AlexStatefulTokensRule {
14 |
15 | public AlexStatefulTokensRuleImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public void accept(@NotNull AlexVisitor visitor) {
20 | visitor.visitStatefulTokensRule(this);
21 | }
22 |
23 | public void accept(@NotNull PsiElementVisitor visitor) {
24 | if (visitor instanceof AlexVisitor) accept((AlexVisitor)visitor);
25 | else super.accept(visitor);
26 | }
27 |
28 | @Override
29 | @Nullable
30 | public AlexIdentifier getIdentifier() {
31 | return findChildByClass(AlexIdentifier.class);
32 | }
33 |
34 | @Override
35 | @NotNull
36 | public List getStatelessTokensRuleList() {
37 | return PsiTreeUtil.getChildrenOfTypeAsList(this, AlexStatelessTokensRule.class);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/stubs/HaskellVaridStub.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi.stubs;
18 |
19 | import com.intellij.psi.stubs.IStubElementType;
20 | import com.intellij.psi.stubs.NamedStubBase;
21 | import com.intellij.psi.stubs.StubElement;
22 | import com.intellij.util.io.StringRef;
23 | import intellij.haskell.psi.HaskellVarid;
24 |
25 | public class HaskellVaridStub extends NamedStubBase {
26 | public HaskellVaridStub(StubElement parent, IStubElementType elementType, StringRef name) {
27 | super(parent, elementType, name);
28 | }
29 |
30 | public HaskellVaridStub(StubElement parent, IStubElementType elementType, String name) {
31 | super(parent, elementType, name);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/psi/stubs/index/HaskellAllNameIndex.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.psi.stubs.index
18 |
19 | import com.intellij.psi.stubs.{StringStubIndexExtension, StubIndexKey}
20 | import intellij.haskell.psi.HaskellNamedElement
21 |
22 | object HaskellAllNameIndex {
23 |
24 | val Key: StubIndexKey[String, HaskellNamedElement] = StubIndexKey.createIndexKey("haskell.all.name")
25 | val Version = 1
26 | }
27 |
28 | class HaskellAllNameIndex extends StringStubIndexExtension[HaskellNamedElement] {
29 |
30 | override def getVersion: Int = {
31 | super.getVersion + HaskellAllNameIndex.Version
32 | }
33 |
34 | def getKey: StubIndexKey[String, HaskellNamedElement] = {
35 | HaskellAllNameIndex.Key
36 | }
37 | }
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/highlighter/HaskellSyntaxHighlighterFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2020 Rik van der Kleij
3 |
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package intellij.haskell.highlighter;
18 |
19 | import com.intellij.openapi.fileTypes.SyntaxHighlighter;
20 | import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
21 | import com.intellij.openapi.project.Project;
22 | import com.intellij.openapi.vfs.VirtualFile;
23 | import org.jetbrains.annotations.NotNull;
24 | import org.jetbrains.annotations.Nullable;
25 |
26 | public class HaskellSyntaxHighlighterFactory extends SyntaxHighlighterFactory {
27 | @NotNull
28 | @Override
29 | public SyntaxHighlighter getSyntaxHighlighter(@Nullable Project project, @Nullable VirtualFile virtualFile) {
30 | return new HaskellSyntaxHighlighter();
31 | }
32 | }
--------------------------------------------------------------------------------
/src/main/scala/intellij/haskell/runconfig/console/HaskellConsoleConfiguration.scala:
--------------------------------------------------------------------------------
1 | package intellij.haskell.runconfig.console
2 |
3 | import java.lang
4 |
5 | import com.intellij.execution.Executor
6 | import com.intellij.execution.configurations._
7 | import com.intellij.execution.runners.ExecutionEnvironment
8 | import com.intellij.openapi.project.Project
9 | import intellij.haskell.external.component.HaskellComponentsManager
10 | import intellij.haskell.runconfig.HaskellStackConfigurationBase
11 |
12 | import scala.jdk.CollectionConverters._
13 |
14 | class HaskellConsoleConfiguration(name: String, project: Project, configurationFactory: ConfigurationFactory)
15 | extends HaskellStackConfigurationBase(name, project, configurationFactory) {
16 |
17 | private var stackTarget: String = ""
18 | val replCommand = "ghci"
19 |
20 | override def getConfigurationEditor = new HaskellConsoleConfigurationForm(getProject)
21 |
22 | override def getState(executor: Executor, environment: ExecutionEnvironment) = new HaskellConsoleState(this, environment)
23 |
24 | def getStackTargetNames: lang.Iterable[String] = {
25 | HaskellComponentsManager.findCabalInfos(project).flatMap(_.cabalStanzas.map(_.targetName)).asJava
26 | }
27 |
28 | def setStackTarget(target: String): Unit = {
29 | stackTarget = target
30 | }
31 |
32 | def getStackTarget: String = {
33 | stackTarget
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/gen/intellij/haskell/psi/HaskellDataDeclaration.java:
--------------------------------------------------------------------------------
1 | // This is a generated file. Not intended for manual editing.
2 | package intellij.haskell.psi;
3 |
4 | import com.intellij.navigation.ItemPresentation;
5 | import org.jetbrains.annotations.NotNull;
6 | import org.jetbrains.annotations.Nullable;
7 | import scala.Option;
8 | import scala.collection.immutable.Seq;
9 |
10 | import java.util.List;
11 |
12 | public interface HaskellDataDeclaration extends HaskellDataConstructorDeclarationElement {
13 |
14 | @Nullable
15 | HaskellCcontext getCcontext();
16 |
17 | @NotNull
18 | List getConstrList();
19 |
20 | @Nullable
21 | HaskellDataDeclarationDeriving getDataDeclarationDeriving();
22 |
23 | @NotNull
24 | List getKindSignatureList();
25 |
26 | @NotNull
27 | List getPragmaList();
28 |
29 | @NotNull
30 | List getQNameList();
31 |
32 | @NotNull
33 | HaskellSimpletype getSimpletype();
34 |
35 | @Nullable
36 | HaskellTtype getTtype();
37 |
38 | @NotNull
39 | List getTypeSignatureList();
40 |
41 | String getName();
42 |
43 | ItemPresentation getPresentation();
44 |
45 | Seq getIdentifierElements();
46 |
47 | Option getModuleName();
48 |
49 | HaskellNamedElement getDataTypeConstructor();
50 |
51 | }
52 |
--------------------------------------------------------------------------------