Intellij-elixir: At unqualified calls should be marked by ModuleAttribute annotator

Created on 1 Dec 2017  路  3Comments  路  Source: KronicDeth/intellij-elixir

Because the Elixir in EEx templates doesn't know it's in a template, the ModuleAttribute Annotator marks the @conn assigns as unresolved module attributes.

screen shot 2017-11-30 at 9 06 18 pm

The ModuleAttribute Annotator should either be disabled when it detects it's Elixir in EEx OR changed to look for missing assigns.

Bug Enhancement EEx

Most helpful comment

Please work on this! The little red squiggly lines are annoying by their own right, but what really gets me is the fact that I can't perform code analysis before committing without seeing a bunch of errors.

I 鉂わ笍 this project, by the way. Keep it up! 馃憤 馃榿

All 3 comments

Please work on this! The little red squiggly lines are annoying by their own right, but what really gets me is the fact that I can't perform code analysis before committing without seeing a bunch of errors.

I 鉂わ笍 this project, by the way. Keep it up! 馃憤 馃榿

I just did some digging into how this might be solved, but given how long this has been sitting here I'm wondering if I'm missing something others have already run into.

For disabling the annotator within EEx, it seems like this should work (file is org.elixir_lang.annotator.ModuleAttribute):

    public void annotate(@NotNull final PsiElement element, @NotNull final AnnotationHolder holder) {
        if (!element.getContainingFile().getFileType().getName().equals("EEx")) {
            element.accept(
                ...
            );
        }
    }

Obviously the if condition is brittle and needs work, but if this general concept would work, I'd be happy to figure out what condition should go there. I just want to know if I'm missing something on a high level before pursuing it further.

The naive solution above didn't work properly, but I was able to find a function to check which languages are available in the element's file, which should only contain EEx in an EEx file. The fix works, but if it doesn't line up with what you had in mind, let me know!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kandeshvari picture kandeshvari  路  5Comments

mariuszzak picture mariuszzak  路  6Comments

merqlove picture merqlove  路  4Comments

Istiakmorsalin picture Istiakmorsalin  路  4Comments

develop7 picture develop7  路  8Comments