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

Make pipe completion work reliably across submodules. #663

Merged
merged 1 commit into from
Dec 22, 2022

Conversation

cristianoc
Copy link
Collaborator

Before this, a type path of non-zero length was assumed to come from the compiler, otherwise the path of the completion environment was taken verbatim.

Neither case is correct.

Now there's a single case, where one takes into account 2 inputs:

  • the current environment which gives context to the type path
  • the type path, which is interpreted as starting within that environment

Since submodules can refer to types into other submodules, the path needs to be resolved to determine the actual path starting from the root of the file. This requires keeping track of where a module is defined. It could be defined in the current env, or in a parent one. The current env is walked backwards toward the root until the required module is found, and the resulting paths combined.

Before this, a type path of non-zero length was assumed to come from the compiler, otherwise the path of the completion environment was taken verbatim.

Neither case is correct.

Now there's a single case, where one takes into account 2 inputs:
- the current environment which gives context to the type path
-  the type path, which is interpreted as starting within that environment

Since submodules can refer to types into other submodules, the path needs to be resolved to determine the actual path starting from the root of the file. This requires keeping track of where a module is defined. It could be defined in the current env, or in a parent one. The current env is walked backwards toward the root until the required module is found, and the resulting paths combined.
@cristianoc cristianoc merged commit 89c90e1 into master Dec 22, 2022
@cristianoc cristianoc deleted the pipe-submodules branch December 22, 2022 16:28
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

Successfully merging this pull request may close these issues.

1 participant