snakecharm
snakecharm copied to clipboard
Implicit Includes support
Code insight support for case
# foo.smk
rule foo:
output: "foo.out"
# boo.smk
rule boo:
input: rules.foo.output
output: "out"
# Snakefile
include "foo.smk"
include "boo.smk"
# other.smk
rule other:
output: "other.out"
In this case all rules from foo.smk
and rules defined before include "boo.smk"
will be accessible inside boo.smk
file although boo.smk
doesn't include 'foo.smk`.
We likely need to cache information about which files includes the current file. E.g it could be done lazily by inspection in thread-safe way. E.g. like PyTypes cache.
So we need
- [ ] Update rule redeclaration inspection to handle such implicit redeclaration (likely weak warning)
- [ ] Implement inspection which checks whether rule is
implicitly
included into current context or not. E.g. it is ok to usefoo
rule inboo.smk
but we cannot useother
rule inboo.smk
- [ ] Optionally update default autocompletion mentioned in #173
Related to #155, #173
Related commits:
https://github.com/JetBrains-Research/snakecharm/pull/164/commits/3a650a3034a5596b5ca1d84d81dbb44d2b21d244
https://github.com/JetBrains-Research/snakecharm/pull/164/commits/828750cc3fb66bcb3341c8d79caf597abece17f3