Skip to content

Commit 0b938ae

Browse files
committed
Fix remote links in config link provider
1 parent cbd7b4e commit 0b938ae

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/nextflow/lsp/services/config/ConfigLinkProvider.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ public void visitConfigInclude(ConfigIncludeNode node) {
102102
}
103103

104104
protected static URI getIncludeUri(URI uri, String source) {
105+
// return source URI if it is already an absolute URI (e.g. http URL)
106+
try {
107+
var sourceUri = new URI(source);
108+
if( sourceUri.getScheme() != null )
109+
return sourceUri;
110+
}
111+
catch( Exception e ) {
112+
// ignore
113+
}
114+
// otherwise, resolve the source path against the including URI
105115
return Path.of(uri).getParent().resolve(source).normalize().toUri();
106116
}
107117

0 commit comments

Comments
 (0)