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

Completion of imported module name can produce invalid syntax if block already present #58

Open
davidmichaelkarr opened this issue Dec 2, 2015 · 0 comments

Comments

@davidmichaelkarr
Copy link
Contributor

Start with the following block of non-red code in a module named "bar":

    import baz {
        prefix "baz";
    }

Where "baz" is the name of an existing module.

Now, put the cursor just past the "z" of "import baz". Press backspace to delete the "z". This properly produces a semantic error, as the referenced module name doesn't exist.

Now, press Ctrl-space to get a list of completion possibilities. This will product a list of two items, being "bar" and "baz". Now select "baz". This produces the following:

    import baz { prefix baz; revision-date 2014-03-21; } {
        prefix "baz";
    }

This obviously reports a syntax error.

This happens whether the block is already in "one-line mode" or not. It inserts the block whether one exists already or not.

Despite the fact that this result is obviously wrong, I'm not certain what it should actually do. It might be reasonable to say that if it finds an existing block, it should immediately delete the block before reinserting the new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant