Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AST support : Add ADT, type alias, function/value to module declaration exposing node #242

Open
rundis opened this issue Sep 28, 2016 · 0 comments

Comments

@rundis
Copy link
Contributor

rundis commented Sep 28, 2016

Summary:

It would be nice to be able to add or remove a top level definition to/from what is exposed for a given module.

Details:

Given the following example: http://peg.arcanis.fr/3bbplj/4/

  1. If a user positions the cursor somewhere within the range covered by the add function and selects to expose the function
  2. add is added to the exposing clause (if not already present) for the module

Alternatively if add is already present and the user with the cursor in range of the add function selects to unexpose the function, it is removed from the exposing clause for the module

You would need at least the following:

  • A way to identify that the user by cursor location is in an applicable top level def.
  • A way to list what is already exposed
  • A given node format to be able to add a new node to the exposing node of a module declaration
  • Preferable a way to print the module declaration node in a elm-formatted manner, alternatively print the whole module, but then you also need to send current cursor position and get back new cursor position.
  • For ADTs you would like to be able to do the same thing, but also for each type in the union type

Discussion

  • If the module is already exposing everything (..) it should probably be a no-op (and/or a warning in the editor)
@avh4 avh4 added the discussion label Mar 8, 2017
@avh4 avh4 modified the milestone: 2.0.0 public AST Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants