|
27 | 27 | import nextflow.lsp.ast.ASTNodeCache;
|
28 | 28 | import nextflow.lsp.compiler.LanguageServerCompiler;
|
29 | 29 | import nextflow.lsp.compiler.LanguageServerErrorCollector;
|
| 30 | +import nextflow.lsp.file.FileCache; |
30 | 31 | import nextflow.lsp.services.LanguageServerConfiguration;
|
31 | 32 | import nextflow.script.ast.FunctionNode;
|
32 | 33 | import nextflow.script.ast.IncludeNode;
|
33 | 34 | import nextflow.script.ast.ProcessNode;
|
34 | 35 | import nextflow.script.ast.ScriptNode;
|
35 | 36 | import nextflow.script.ast.WorkflowNode;
|
| 37 | +import nextflow.script.control.ModuleResolver; |
36 | 38 | import nextflow.script.control.PhaseAware;
|
37 | 39 | import nextflow.script.control.Phases;
|
38 | 40 | import nextflow.script.control.ResolveIncludeVisitor;
|
@@ -86,7 +88,13 @@ public void initialize(String rootUri, LanguageServerConfiguration configuration
|
86 | 88 | }
|
87 | 89 |
|
88 | 90 | @Override
|
89 |
| - protected Set<URI> analyze(Set<URI> uris) { |
| 91 | + protected Set<URI> analyze(Set<URI> uris, FileCache fileCache) { |
| 92 | + // recursively load included modules |
| 93 | + for( var uri : uris ) { |
| 94 | + var source = compiler().getSource(uri); |
| 95 | + new ModuleResolver(compiler()).resolve(source, (includeUri) -> compiler().newSourceUnit(includeUri, fileCache)); |
| 96 | + } |
| 97 | + |
90 | 98 | // phase 2: include checking
|
91 | 99 | var changedUris = new HashSet<>(uris);
|
92 | 100 |
|
|
0 commit comments