Fix search-import-from to not break package names having an argument as a prefix #643
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When working with package-inferred systems, we have to deal with many packages and some of their names can be prefixes of another. Here is an example from a real-life application:
app/models/job
app/models/job-application
Now, let's imagine we are in the app/api/jobs package which already has a definition:
Now if we try to call
M-x sly-import-symbol-at-point
onapp/models/job:foo
symbol, then SLY will break the import-from form like thisThis commit fixes the problem and after the fix, SLY will ignore import from
app/models/job-application
and will add a newimport-from
form.For the minimal example to reproduce the problem I'm fixing, enter this code in the lisp buffer eval all package definitions and try to execute
M-x sly-import-symbol-at-point
command onfoo:minor
symbol: