Git Product home page Git Product logo

elm-plugin's Introduction

elm-plugin

Elm language plugin for IntelliJ IDEA. This repository is no longer maintained due to lack of resources. If you need an Elm language support in IntelliJ - please consider using this plugin instead.

Features

This plugin supports Elm 0.18.0. If you need to have different version supported, see this link.

  • Parsing the syntax
  • Syntax highlighting and color settings page
  • Going to declaration
  • Highlighting unresolved references
  • Code completion
  • Brace matching
  • Spellchecking
  • Rename refactoring

Formatting is currently not a feature of the plugin, but elm-format can be used instead. If you don't know how to configure IntelliJ to use elm-format you can find some information here

Building from sources

  1. Setup your development environment according to this instruction.
  2. Clone this repository.
  3. Open it as a Plugin Project in IntelliJ IDEA (either Community or Ultimate version).
  4. Make sure you have Grammar-Kit and PsiViewer plugins installed.
  5. Delete the content of gen directory if you have previously generated parser code from another version of the BNF file.
  6. Open src/main/java/org/elmlang/intellijplugin/Elm.flex file and generate lexer code (*)
  7. Open src/main/java/org/elmlang/intellijplugin/Elm.bnf file and generate the parser code - twice, if needed (*)
  8. Open File -> Project Structure under Project set the Projekt SDK to the (in Step 1) configured IntelliJ Platform Plugin SDK, the Project language level at least to 8 and the Project compiler output to out
  9. Create a Plugin-Run Configuration

(*) either from a context menu or by keyboard shortcut ⇧⌘G

Contributing

Please do not contribute to this repository directly - fork it and contribute to your fork instead.

License: MIT

elm-plugin's People

Contributors

durkiewicz avatar ianp avatar klazuka avatar paplorinc avatar

Stargazers

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

Watchers

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

elm-plugin's Issues

Support hex literals

The following is a valid Elm program:

import Html exposing (text)
import List exposing (map)

main =
  text <| toString (map (\a -> a * 2) hexList)

hexList : List Int
hexList = [0xDEAD, 0xBEEF]

xDEAD and xBEEF are tokenized as symbols.

Generated import clauses should be above non-module-doc-comments

When adding an import clause with the unresolved reference Quick Fix, the generated import clause is currently being inserted after any comments following the module declaration. This behavior is correct when the comment is a module doc comment, but it is undesirable for regular one-line or multi-line comments.

BAD:
screen shot 2016-09-29 at 7 40 44 am

The line import Dict exposing (Dict) should be above the line
-- TYPES

@durkiewicz please assign to me

Function/code folding

I'm unable to fold functions to their signatures. The menu options are not disabled but they do not have any effect on the code.

image

Since a function name and it's signature are very good at describing what it does, most of the time I do not need to see it's implementation, so ideally, I'd like all functions folded by default!

Love this plugin, is the reason why I went back to webstorm for Elm.

port module declaration flagged as error

It seems in Elm 0.17 any module that declares a port needs to start like:

port module MyModule exposing (..)

This causes the plugin to flag errors on the module keyword

LOWER_CASE_IDENTIFIER expected, got 'module'

As well as a few other subsequent errors in following lines (eg. on import). Removing the initial "port" before "module" removes all errors.

How to Build

Hi! First of all, thanks for your effort on this plugin!

I went with Building from sources instruction but couldn't get the final step. How do I actually build the *.jar file here?

Correct auto indentation

In almost all cases when I'm typing the auto indentation is wrong.
For example:

inc : Int -> Int
inc n =
<caret>

expected:

inc : Int -> Int
inc n =
    <caret>

For if then else and case of expressions it also doesn't work as expected.

Renaming files / modules.

Rename refactoring doesn't work for files nor module names. Renaming a file should trigger renaming a module and vice versa.

Picks up the wrong definition for Test type of elm-test

webstorm underlines Test and tells me it 'cannot find symbol Test'

image

when I click on the import Test exposing (..) line, it takes me to a Test module defined in the "krisajenkins/elm-astar" which doesn't have a definition for Test.
however, what it should take me to is elm-test/Test

elm-package.json

{
    "version": "1.0.0",
    "summary": "Sample Elm Test",
    "repository": "https://github.com/user/project.git",
    "license": "BSD-3-Clause",
    "source-directories": [
        ".",
        "../src"
    ],
    "exposed-modules": [],
    "dependencies": {
        "elm-community/elm-test": "2.0.0 <= v < 3.0.0",
        "rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0",
        "elm-community/list-extra": "3.1.0 <= v < 4.0.0",
        "elm-community/random-extra": "1.0.0 <= v < 2.0.0",
        "elm-lang/core": "4.0.5 <= v < 5.0.0",
        "elm-lang/html": "1.1.0 <= v < 2.0.0",
        "elm-lang/keyboard": "1.0.0 <= v < 2.0.0",
        "elm-lang/mouse": "1.0.0 <= v < 2.0.0",
        "elm-lang/navigation": "1.0.0 <= v < 2.0.0",
        "elm-lang/window": "1.0.0 <= v < 2.0.0",
        "krisajenkins/elm-astar": "2.0.3 <= v < 3.0.0"
    },
    "elm-version": "0.17.0 <= v < 0.18.0"
}

Checklist for Elm 0.18

Unlike Elm 0.17, version 0.18 will not require an immediate plugin update as it doesn't break the overall syntactic structure, but there are a few things that would be nice to do:

  • remove backtick syntax
  • disallow primes in identifiers
  • remove [..] List range syntax (was it ever supported by the plugin?)
  • proposed changes to the set of default imports

False import error

For some reason this line gives an error "Cannot find module Material.Helpers":
import Material.Helpers exposing (map1st, map2nd)

(I use https://github.com/debois/elm-mdl library in my project).

Nevertheless, compilation is successfull, and the code runs well, so this is not a real error.

Execute elm-make on save

I have forked your code and created a pull request which executes elm-make for the changed files when saving them to disk. The error output from elm-make is used to annotate the file in the editor and add problems in IntelliJ. When hovering the annotations you will see the error output elm-make would also show.

I have also created a settings page where the elm-make can be enabled (It's disabled by default) and the location of the elm-make binary can be selected.

Would you be willing to include this functionality?

master doesn't build because of missing classes

Trying to build master today gives the following errors:

/elm-plugin/src/org/elmlang/intellijplugin/psi/impl/ElmPsiImplUtil.java
Error:(76, 56) java: cannot find symbol
  symbol:   class ElmBacktickedFunction
  location: class org.elmlang.intellijplugin.psi.impl.ElmPsiImplUtil
Error:(70, 32) java: cannot find symbol
  symbol:   method getBacktickedFunctionList()
  location: variable element of type org.elmlang.intellijplugin.psi.ElmExpression
Error:(80, 30) java: invalid method reference
  non-static method getReferencesList() cannot be referenced from a static context
/elm-plugin/gen/org/elmlang/intellijplugin/psi/impl/ElmUpperCaseIdImpl.java
Error:(42, 26) java: cannot find symbol
  symbol:   method getReference(org.elmlang.intellijplugin.psi.impl.ElmUpperCaseIdImpl)
  location: class org.elmlang.intellijplugin.psi.impl.ElmPsiImplUtil
/elm-plugin/gen/org/elmlang/intellijplugin/psi/impl/ElmLowerCaseIdImpl.java
Error:(42, 26) java: cannot find symbol
  symbol:   method getReference(org.elmlang.intellijplugin.psi.impl.ElmLowerCaseIdImpl)
  location: class org.elmlang.intellijplugin.psi.impl.ElmPsiImplUtil

Something went wrong

String index out of range: -5
java.lang.StringIndexOutOfBoundsException: String index out of range: -5
	at java.lang.String.substring(String.java:1967)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.addCompletions(ElmCurrentModuleCompletionProvider.java:38)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.lambda$addCompletions$0(ElmCurrentModuleCompletionProvider.java:26)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.addCompletions(ElmCurrentModuleCompletionProvider.java:26)
	at org.elmlang.intellijplugin.features.completion.ElmMainCompletionProvider.addTypeOrModuleCompletions(ElmMainCompletionProvider.java:80)
	at org.elmlang.intellijplugin.features.completion.ElmMainCompletionProvider.addCompletions(ElmMainCompletionProvider.java:59)
	at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
	at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:151)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:138)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:131)
	at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$2.addCompletions(LiveTemplateCompletionContributor.java:88)
	at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
	at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:151)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81)
	at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:110)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.a(CompletionProgressIndicator.java:831)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.access$600(CompletionProgressIndicator.java:93)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator$1CalculateItems.run(CompletionProgressIndicator.java:813)
	at com.intellij.codeInsight.completion.AsyncCompletion.a(CompletionThreading.java:108)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:931)
	at com.intellij.codeInsight.completion.AsyncCompletion.b(CompletionThreading.java:105)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:176)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:556)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
	at com.intellij.codeInsight.completion.AsyncCompletion.a(CompletionThreading.java:103)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)


java.lang.StringIndexOutOfBoundsException: String index out of range: -5
	at java.lang.String.substring(String.java:1967)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.addCompletions(ElmCurrentModuleCompletionProvider.java:38)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.lambda$addCompletions$0(ElmCurrentModuleCompletionProvider.java:26)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.addCompletions(ElmCurrentModuleCompletionProvider.java:26)
	at org.elmlang.intellijplugin.features.completion.ElmMainCompletionProvider.addTypeOrModuleCompletions(ElmMainCompletionProvider.java:80)
	at org.elmlang.intellijplugin.features.completion.ElmMainCompletionProvider.addCompletions(ElmMainCompletionProvider.java:59)
	at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
	at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:151)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:138)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:131)
	at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$2.addCompletions(LiveTemplateCompletionContributor.java:88)
	at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
	at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:151)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81)
	at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:110)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.a(CompletionProgressIndicator.java:831)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.access$600(CompletionProgressIndicator.java:93)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator$1CalculateItems.run(CompletionProgressIndicator.java:813)
	at com.intellij.codeInsight.completion.AsyncCompletion.a(CompletionThreading.java:108)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:931)
	at com.intellij.codeInsight.completion.AsyncCompletion.b(CompletionThreading.java:105)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:176)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:556)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
	at com.intellij.codeInsight.completion.AsyncCompletion.a(CompletionThreading.java:103)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)


java.lang.StringIndexOutOfBoundsException: String index out of range: -5
	at java.lang.String.substring(String.java:1967)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.addCompletions(ElmCurrentModuleCompletionProvider.java:38)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.lambda$addCompletions$0(ElmCurrentModuleCompletionProvider.java:26)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.addCompletions(ElmCurrentModuleCompletionProvider.java:26)
	at org.elmlang.intellijplugin.features.completion.ElmMainCompletionProvider.addTypeOrModuleCompletions(ElmMainCompletionProvider.java:80)
	at org.elmlang.intellijplugin.features.completion.ElmMainCompletionProvider.addCompletions(ElmMainCompletionProvider.java:59)
	at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
	at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:151)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:138)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:131)
	at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$2.addCompletions(LiveTemplateCompletionContributor.java:88)
	at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
	at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:151)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81)
	at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:110)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.a(CompletionProgressIndicator.java:831)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.access$600(CompletionProgressIndicator.java:93)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator$1CalculateItems.run(CompletionProgressIndicator.java:813)
	at com.intellij.codeInsight.completion.AsyncCompletion.a(CompletionThreading.java:108)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:931)
	at com.intellij.codeInsight.completion.AsyncCompletion.b(CompletionThreading.java:105)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:176)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:556)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
	at com.intellij.codeInsight.completion.AsyncCompletion.a(CompletionThreading.java:103)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)


java.lang.StringIndexOutOfBoundsException: String index out of range: -5
	at java.lang.String.substring(String.java:1967)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.addCompletions(ElmCurrentModuleCompletionProvider.java:38)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.lambda$addCompletions$0(ElmCurrentModuleCompletionProvider.java:26)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.addCompletions(ElmCurrentModuleCompletionProvider.java:26)
	at org.elmlang.intellijplugin.features.completion.ElmMainCompletionProvider.addTypeOrModuleCompletions(ElmMainCompletionProvider.java:80)
	at org.elmlang.intellijplugin.features.completion.ElmMainCompletionProvider.addCompletions(ElmMainCompletionProvider.java:59)
	at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
	at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:151)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:138)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:131)
	at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$2.addCompletions(LiveTemplateCompletionContributor.java:88)
	at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
	at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:151)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81)
	at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:110)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.a(CompletionProgressIndicator.java:831)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.access$600(CompletionProgressIndicator.java:93)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator$1CalculateItems.run(CompletionProgressIndicator.java:813)
	at com.intellij.codeInsight.completion.AsyncCompletion.a(CompletionThreading.java:108)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:931)
	at com.intellij.codeInsight.completion.AsyncCompletion.b(CompletionThreading.java:105)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:176)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:556)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
	at com.intellij.codeInsight.completion.AsyncCompletion.a(CompletionThreading.java:103)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)


java.lang.StringIndexOutOfBoundsException: String index out of range: -5
	at java.lang.String.substring(String.java:1967)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.addCompletions(ElmCurrentModuleCompletionProvider.java:38)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.lambda$addCompletions$0(ElmCurrentModuleCompletionProvider.java:26)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.addCompletions(ElmCurrentModuleCompletionProvider.java:26)
	at org.elmlang.intellijplugin.features.completion.ElmMainCompletionProvider.addTypeOrModuleCompletions(ElmMainCompletionProvider.java:80)
	at org.elmlang.intellijplugin.features.completion.ElmMainCompletionProvider.addCompletions(ElmMainCompletionProvider.java:59)
	at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
	at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:151)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:138)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:131)
	at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$2.addCompletions(LiveTemplateCompletionContributor.java:88)
	at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
	at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:151)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81)
	at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:110)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.a(CompletionProgressIndicator.java:831)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.access$600(CompletionProgressIndicator.java:93)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator$1CalculateItems.run(CompletionProgressIndicator.java:813)
	at com.intellij.codeInsight.completion.AsyncCompletion.a(CompletionThreading.java:108)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:931)
	at com.intellij.codeInsight.completion.AsyncCompletion.b(CompletionThreading.java:105)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:176)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:556)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
	at com.intellij.codeInsight.completion.AsyncCompletion.a(CompletionThreading.java:103)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)


java.lang.StringIndexOutOfBoundsException: String index out of range: -5
	at java.lang.String.substring(String.java:1967)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.addCompletions(ElmCurrentModuleCompletionProvider.java:38)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.lambda$addCompletions$0(ElmCurrentModuleCompletionProvider.java:26)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.elmlang.intellijplugin.features.completion.ElmCurrentModuleCompletionProvider.addCompletions(ElmCurrentModuleCompletionProvider.java:26)
	at org.elmlang.intellijplugin.features.completion.ElmMainCompletionProvider.addTypeOrModuleCompletions(ElmMainCompletionProvider.java:80)
	at org.elmlang.intellijplugin.features.completion.ElmMainCompletionProvider.addCompletions(ElmMainCompletionProvider.java:59)
	at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
	at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:151)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:138)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:131)
	at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$2.addCompletions(LiveTemplateCompletionContributor.java:88)
	at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
	at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:151)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81)
	at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:110)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.a(CompletionProgressIndicator.java:831)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.access$600(CompletionProgressIndicator.java:93)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator$1CalculateItems.run(CompletionProgressIndicator.java:813)
	at com.intellij.codeInsight.completion.AsyncCompletion.a(CompletionThreading.java:108)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:931)
	at com.intellij.codeInsight.completion.AsyncCompletion.b(CompletionThreading.java:105)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:176)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:556)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
	at com.intellij.codeInsight.completion.AsyncCompletion.a(CompletionThreading.java:103)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Hope, it helps.

Valid let-in is marked as invalid

For the following valid code

a = let b = 0
        c = 1
    in b + c

I get the error at the c = 1 line:

BACKSLASH, CASE, CHAR_LITERAL, DOT, IF, IN, LEFT_BRACE, LEFT_PARENTHESIS, LEFT_SQUARE_BRACKET, LET, LIST_CONSTRUCTOR, LOWER_CASE_IDENTIFIER, MINUS, NUMBER_LITERAL, OPERATOR, SEPARATION_BY_INDENTATION, STRING_LITERAL or UPPER_CASE_IDENTIFIER expected, got '='

The workaround is simple:

a = let 
        b = 0
        c = 1
    in b + c

I would gladly provide a PR for it, if needed :)

type alias doesn't find constructors

module A exposing ( T(X,Y) )
import B exposing (T(X,Y))

type alias T = B.T

along with

moduel B exposing (T)

type T = X | Y

It gives me an error, claiming it cannot find X and Y in module B. It offers to import it for me, and if I let it import Y, it changes

import B exposing (T(X,Y))

to

import B exposing (T(X,Y,Y))

adding what you ask it to import, even though it's already imported.

I'm running version 0.7.2 on PyCharm 2017.1.1

Feature request: parameter names

This is possibly one for the future once Elm has a more easily queryable IDE server, but the Symfony 2 plugin for IntelliJ has recently started to add in greyed out hints telling you the names of parameters. I imagine that if this could be done for Elm it would be super helpful!

It looks like this:

screen shot 2017-04-20 at 10 02 44

References are being resolved without going through import clauses

@durkiewicz commit 8d247e8 introduced a pretty big regression in the PsiReference system. The plugin is incorrectly marking qualified references ("absolute references") as resolved regardless of whether the module that exposes the target value/type is actually imported.

Example

This can be seen with a very simple program (assuming that you have already install the Html package):

main = Html.text "foo"

Prior to commit 8d247e8, Html was correctly marked as unresolved (because the developer forgot to import the Html module). But after that commit, the reference is no longer unresolved, and the user will not find out about the problem until they go to compile (at which point elm-make will complain that Html has not been imported).

Scope of the Problem

It affects qualified references to both values and types (or what you call AbsoluteValueReference and AbsoluteTypeReference) when the target module is present in the project, but is not actually imported in the reference's source file. It does not affect unqualified references (what you call an Exposed reference).

Root Cause

It appears that the problem is that ElmMixedCasePathImpl and ElmUpperCasePathImpl no longer provide the (now-deleted) ElmPartOfPathModuleReference in their reference stream. Instead they use the new ElmContainingModuleReference, which resolves the reference that it contains using the project module index (ElmModuleIndex.getFilesByModuleName())—thereby ignoring whether the user has actually imported the module into the source file that contains the referencing element. As best I can tell, the code which was deleted in ElmPartOfPathModuleReference does look for import clauses when resolving a reference.

Solution

This code is too tricky for me to attempt a fix. I wish I had a better understanding of the reference system architecture. (Perhaps you can write up some quick notes and check them in to a docs folder?) If you have time to fix the root cause, that'd be great. Otherwise, I would recommend reverting this change as it breaks a very common scenario (basic development using qualified references) while fixing a much rarer scenario (issue #30).

As always, thank you for the work you've done on this plugin.

Elm v0.17.0

Hello,

Can you please update the plugin to support Elm 0.17.0?

For example:
image

Thank you.

Aliasing a module with same name as another confuses auto-complete

So, I often will do this

import List.Extra as List
import Maybe.Extra as Maybe

to merge the functions into just List or Maybe
But, this confuses the auto-complete. It appears to only keep the last one imported, and it stops being able to recognize the functions on the previous module. So, if I do this

import List.Extra as List

then it will stop knowing about things like List.map in the auto-complete and also put a red squiggle under List.map
I can fix this by doing

import List.Extra as List
import List

but then it loses track of the functions in List.Extra.

Would be great if aliasing was additive!

Feature Request: Project Structure

The "Structure" pane shows nothing in my project. Is this user error, or does such a thing not yet exist?

If not, I'd like to add a request for this.

show actual errors in IntelliJ

Do I need to set something up to get actual errors displayed, or is this something that isn't possible yet?

For example, is there a way to get this red squiggly underlined?

x : Int
x = "Hello"

type checking

Are you planning on type checking elm files? It would be nice if the elm compiler could be run, any errors underlined with squiggly red and the compiler error shown on hover. This is one feature that would make me switch from LightTable for sure.

Calls to imported ports are underlined

Now that the "port module" declaration is recognised properly no errors show up in that module, and if I import that module in another module, the import itself does not show as an error. But if I put in a call to an outgoing port (i.e. one that returns a Comnmand) or to an incoming port (i.e. one that returns a Subscription) in the other module then the point at which I call the port is underlined, with the error "Cannot find symbol ". Still compiles and runs fine.

If I wrap the calls within functions in the Ports module itself, no errors are reported, either at the port call point (now in the Ports module) or at the point that the imported wrapper function is called.

Implement add-import-statement intention

Feature Proposal

Intention Action: Add Import Statement

When the cursor is over an unresolved reference which could be resolved by importing a module in the project, an intention should be provided to easily add the import.

Details

  • We should look for candidate modules in the user's source files as well as from elm-package.json. I think this is already handled by the plugin since we treat elm-stuff as a source-root.
  • If the selected element is a "dotted" name (e.g. String.length), then just the module name should be imported (e.g. import String)
  • If the selected element is a "bare" name (e.g. length), then the value's name itself should be imported (e.g. import String exposing (length))

The last example, length, would presumably have many candidates. The user should be shown the list of candidate modules to select from.

Related Work

  • optimize imports
  • convert between importing a value name in a qualified manner (String.length) and unqualified (length)
  • assuming that we extend code completion to present currently-unresolvable-references, selecting such a result would add an import in a manner similar to this intention
  • add-to-exports (see #18)

Atom Color Scheme

Is there a easy easy to configure the Atom Color Scheme using this plugin?

Atom

Elm doesn't participate in view provider SingleRootFileViewProvider

Hey,

First, thank you for this plugin !

I just installed it, and after restart I got this error:

Language Language: Elm doesn't participate in view provider SingleRootFileViewProvider{myVirtualFile=file:///var/www/html/src/elm/User/Model.elm, content=VirtualFileContent{size=432}}: [Language: Elm]
  • Details:
Language Language: Elm doesn't participate in view provider SingleRootFileViewProvider{myVirtualFile=file:///var/www/html/src/elm/User/Model.elm, content=VirtualFileContent{size=432}}: [Language: Elm]
java.lang.AssertionError: Language Language: Elm doesn't participate in view provider SingleRootFileViewProvider{myVirtualFile=file:///var/www/html/src/elm/User/Model.elm, content=VirtualFileContent{size=432}}: [Language: Elm]
    at com.intellij.extapi.psi.PsiFileBase.a(PsiFileBase.java:58)
    at com.intellij.extapi.psi.PsiFileBase.<init>(PsiFileBase.java:40)
    at org.elmlang.intellijplugin.psi.ElmFile.<init>(ElmFile.java:14)
    at org.elmlang.intellijplugin.ElmParserDefinition.createFile(ElmParserDefinition.java:65)
    at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:412)
    at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:353)
    at com.intellij.psi.SingleRootFileViewProvider.a(SingleRootFileViewProvider.java:331)
    at com.intellij.psi.SingleRootFileViewProvider.getPsiInner(SingleRootFileViewProvider.java:176)
    at com.intellij.psi.SingleRootFileViewProvider.getPsi(SingleRootFileViewProvider.java:160)
    at com.intellij.psi.impl.file.impl.FileManagerImpl.findFile(FileManagerImpl.java:410)
    at com.intellij.psi.impl.PsiDocumentManagerBase.b(PsiDocumentManagerBase.java:164)
    at com.intellij.psi.impl.PsiDocumentManagerBase.getPsiFile(PsiDocumentManagerBase.java:118)
    at com.intellij.psi.impl.PsiDocumentManagerImpl.getPsiFile(PsiDocumentManagerImpl.java:94)
    at com.intellij.codeInsight.folding.impl.DocumentFoldingInfo$1.run(DocumentFoldingInfo.java:294)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:943)
    at com.intellij.codeInsight.folding.impl.DocumentFoldingInfo.readExternal(DocumentFoldingInfo.java:284)
    at com.intellij.codeInsight.folding.impl.CodeFoldingManagerImpl.readFoldingState(CodeFoldingManagerImpl.java:382)
    at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorProvider.readState(PsiAwareTextEditorProvider.java:107)
    at com.intellij.openapi.fileEditor.impl.HistoryEntry.<init>(HistoryEntry.java:79)
    at com.intellij.openapi.fileEditor.impl.EditorsSplitters$UIBuilder.processFiles(EditorsSplitters.java:872)
    at com.intellij.openapi.fileEditor.impl.EditorsSplitters$UIBuilder.processFiles(EditorsSplitters.java:831)
    at com.intellij.openapi.fileEditor.impl.EditorsSplitters$ConfigTreeReader.process(EditorsSplitters.java:822)
    at com.intellij.openapi.fileEditor.impl.EditorsSplitters.openFiles(EditorsSplitters.java:244)
    at com.intellij.openapi.fileEditor.impl.OpenFilesActivity.runActivity(OpenFilesActivity.java:35)
    at com.intellij.ide.startup.impl.StartupManagerImpl$2.run(StartupManagerImpl.java:147)
    at com.intellij.ide.startup.impl.StartupManagerImpl.b(StartupManagerImpl.java:342)
    at com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartupActivitiesFromExtensions(StartupManagerImpl.java:152)
    at com.intellij.openapi.project.impl.ProjectManagerImpl$5.run(ProjectManagerImpl.java:384)
    at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:227)
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
    at com.intellij.openapi.progress.impl.CoreProgressManager$8.run(CoreProgressManager.java:357)
    at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
    at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:446)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
    at com.intellij.openapi.application.impl.ApplicationImpl$14$1.run(ApplicationImpl.java:626)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:365)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)



java.lang.AssertionError: Language Language: Elm doesn't participate in view provider SingleRootFileViewProvider{myVirtualFile=file:///var/www/html/src/elm/User/Model.elm, content=VirtualFileContent{size=432}}: [Language: Elm]
    at com.intellij.extapi.psi.PsiFileBase.a(PsiFileBase.java:58)
    at com.intellij.extapi.psi.PsiFileBase.<init>(PsiFileBase.java:40)
    at org.elmlang.intellijplugin.psi.ElmFile.<init>(ElmFile.java:14)
    at org.elmlang.intellijplugin.ElmParserDefinition.createFile(ElmParserDefinition.java:65)
    at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:412)
    at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:353)
    at com.intellij.psi.SingleRootFileViewProvider.a(SingleRootFileViewProvider.java:331)
    at com.intellij.psi.SingleRootFileViewProvider.getPsiInner(SingleRootFileViewProvider.java:176)
    at com.intellij.psi.SingleRootFileViewProvider.getPsi(SingleRootFileViewProvider.java:160)
    at com.intellij.psi.impl.file.impl.FileManagerImpl.findFile(FileManagerImpl.java:410)
    at com.intellij.psi.impl.PsiDocumentManagerBase.b(PsiDocumentManagerBase.java:164)
    at com.intellij.psi.impl.PsiDocumentManagerBase.getPsiFile(PsiDocumentManagerBase.java:118)
    at com.intellij.psi.impl.PsiDocumentManagerImpl.getPsiFile(PsiDocumentManagerImpl.java:94)
    at com.intellij.openapi.editor.impl.SettingsImpl.a(SettingsImpl.java:329)
    at com.intellij.openapi.editor.impl.SettingsImpl.reinitSettings(SettingsImpl.java:318)
    at com.intellij.openapi.editor.impl.EditorImpl.reinitSettings(EditorImpl.java:793)
    at com.intellij.openapi.editor.impl.EditorImpl.setHighlighter(EditorImpl.java:1183)
    at com.intellij.openapi.fileEditor.impl.text.TextEditorComponent.b(TextEditorComponent.java:168)
    at com.intellij.openapi.fileEditor.impl.text.TextEditorComponent.<init>(TextEditorComponent.java:100)
    at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl$PsiAwareTextEditorComponent.<init>(PsiAwareTextEditorImpl.java:62)
    at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl$PsiAwareTextEditorComponent.<init>(PsiAwareTextEditorImpl.java:55)
    at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl.createEditorComponent(PsiAwareTextEditorImpl.java:44)
    at com.intellij.openapi.fileEditor.impl.text.TextEditorImpl.<init>(TextEditorImpl.java:46)
    at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl.<init>(PsiAwareTextEditorImpl.java:38)
    at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorProvider$1.build(PsiAwareTextEditorProvider.java:77)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$13.run(FileEditorManagerImpl.java:873)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at com.intellij.ide.IdeEventQueue.f(IdeEventQueue.java:861)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:649)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:380)
    at com.intellij.ide.IdeEventQueue.pumpEventsForHierarchy(IdeEventQueue.java:948)
    at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:210)
    at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:197)
    at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:642)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:354)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:76)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:230)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:183)
    at com.intellij.openapi.project.impl.ProjectManagerImpl.openProject(ProjectManagerImpl.java:369)
    at com.intellij.platform.PlatformProjectOpenProcessor.doOpenProject(PlatformProjectOpenProcessor.java:220)
    at com.intellij.ide.RecentDirectoryProjectsManager.doOpenProject(RecentDirectoryProjectsManager.java:56)
    at com.intellij.ide.RecentProjectsManagerBase.doReopenLastProject(RecentProjectsManagerBase.java:554)
    at com.intellij.ide.RecentProjectsManagerBase$MyAppLifecycleListener.appStarting(RecentProjectsManagerBase.java:588)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:116)
    at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:368)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:355)
    at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:334)
    at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:42)
    at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:223)
    at com.sun.proxy.$Proxy41.appStarting(Unknown Source)
    at com.intellij.idea.IdeaApplication$IdeStarter$2.run(IdeaApplication.java:354)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.a(LaterInvocator.java:337)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:321)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at com.intellij.ide.IdeEventQueue.f(IdeEventQueue.java:861)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:649)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:380)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Any suggestions ?

effect keyword causing problems with Return.effect

I started using a package (Return) that has a method called effect. I'm not sure what the keyword effect has in Elm, since I have never come across it. But, when ever I call the Return.effect it breaks any syntax after it. Is there a way to check if effect is used as a method, and if so, allow it. The code compiles with 0.17.1.

String literal occasional parsing issue

I encountered this bug while testing the latest unstable release (issue #42), but I've noticed it in the current stable release as well.

Occasionally, while typing a string literal, the editor incorrectly displays red-squigglies:

screen shot 2016-11-05 at 5 19 20 pm

I don't have exact reproduction steps yet, but will reply here when I do.

Erroneously reports a syntax error on backticked functions

elm-plugin erroneously reports a syntax error on the following code:
Task.sleep time Task.andThen \_ -> task

Looking briefly at the elm-plugin lexer, it looks like BACKTICKED_FUNCTION is defined as:
BACKTICKED_FUNCTION=""{LOWER_CASE_IDENTIFIER}""

Implement rename refactoring.

It should work in standard IntelliJ-way - when user presses shift+F6 then either a modal window pops up or the symbol to be renamed is highlighted to enable entering a new name.

How to build

I followed all steps in README but when I finally build it using: Build -> Make Project, I always get:

All files are up-to-date

I even added errors to some source file but still I get this all files up-to-date on build. So, how to really build this plugin?

Kotlin and the future of the plugin

@durkiewicz I'm working on support for Structure View, and I'm doing it in Kotlin—a language which I know much better than Java, and whose Collections library I find much simpler than Java 8 Streams.

I have 2 questions:

  1. Would you reject a PR written in Kotlin?
  2. Do you see yourself working on this plugin much more in the future?

Implement add-to-module-exports

Feature Proposal

Overview

Provide an intention to add a value/function declaration to the module's list of exports. Currently there is a lot of dancing around as you add/remove new code and want to control its visibility to other modules.

Example

For instance, if my file looks like this:

module Villains exposing ( madScientist )

madScientist : String
madScientist =
    "Mad Scientist"

And now I define another villain:

lexLuther : String
lexLuther =
    "Lex Luther"

In order to add lexLuther to the module's exposing list, all I should have to do is put the cursor over lexLuther, press option-enter to invoke IntelliJ's intentions system, and then select an action to expose the declaration.

The end result would look like this:

module Villains exposing
    ( madScientist
    , lexLuther
    )

madScientist : String
madScientist =
    "Mad Scientist"

lexLuther : String
lexLuther =
    "Lex Luther"

Cannot find module "Css"

I am getting this error when using "rtfeldman/elm-css". The dependency is present in elm-package.json and is also installed. Not only that, but I can import some sub-modules of the same dependency without any warnings, but not the root one, so:

import Css exposing (..) gives me errors and does not allow any code completion, but

import Css.Structure exposing (..) works just fine.

Oh, and project compiles and works just fine. This gives me so much grief right now that I am forced to use Sublime and Atom instead of my all-time favorite IDEA. I would get on my fours and beg for this issue to be addressed and fixed.

The error is being caused by Css module exposing (.). It's totally valid (https://github.com/rtfeldman/elm-css) but I get LIST_CONSTRUCTORE or OPERATOR expected error. If remove this from the list of things exposed by Css (or just expose everything), all works just fine.

Exports of Css: https://gyazo.com/1942e17281a432f3b8fdb4aa246862d6

How to get started?

Thanks for your efforts. I am normally an emacs user but I have a set of projects that I use intellij for. One of those projects is an elm project so I thought I would try out this plugin. I can't figure out how to get started. There doesn't seem to be any ability to create or import an elm project. I can import an empty project and edit the elm files, but the plugin seems to be confused about finding my elm-package.json and the various dependencies.

So my question is, how do I actually use this plugin? What am I missing?

Exploring contributing: JFlex.jar could not be downloaded

Hey I'm following your steps to try to contribute. I was following your steps, but got stuck at "Open src/org/elmlang/intellijplugin/Elm.flex file and generate lexer code (*)"

I'm getting "Failed to download ..." and it shows a URL that I can't copy, but is supposed to point at this: https://github.com/JetBrains/intellij-community/blob/webstorm/162.104/tools/lexer/jflex-1.4/lib/JFlex.jar
However the link points to the master branch rather than the 162.104 tag, and on that branch the jflex-1.4 directory doesn't exist https://github.com/JetBrains/intellij-community/tree/webstorm/162.374/tools/lexer

How do I get this project properly set up?

Find usages

First of all, thanks for working on this! Super psyched to see it.

Go to definition works great, but I'm used to being able to right click > find usages on symbols in my editor and have the find pane pop up. It seems like with the PSI parsing in place, the foundation is there — what more is required for find usages to work?

Thanks!

Parsing issue with case in a let

The attached file compiles, but the Elm plugin shows an error. Being new to Elm, I may have done something that isn't good practice, but if it compiles and runs, it should either be OK or a warning.
Main.txt

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.