IntelliJ - when I organise imports Standard Library Extra imports disappear

Steps to recreate:

  1. Create a new npl file

  2. Add code that uses one or more of the standard library extra functions and make sure you have an import statement for each function you use e.g.

    use stdlib.v1.text.matchesPattern
    use stdlib.v1.text.startsWith
    use stdlib.v1.text.replaceAll

    function validateRegex(text: Text, regex: Text) returns Boolean → text.matchesPattern(regex);

    function removeSpaces(text: Text) returns Text → text.replaceAll(" ", “”, ignoreCase = true)

    function startsWith(prefix: Text, text: Text) returns Boolean → text.startsWith(prefix, true)

  3. Organise imports - CTRL + OPTION + O (on mac)

Actual result:
all stdlib imports disappear

Expected result:
imports should just be sorted

Hi Stuart,

This is true for all imports as long as they are not used. We will discuss this and come back to you if we want to change it.

Ah, okay sorry, I should have been more explicit in my initial description. This does happen when the functions are used. I’ll update the description.