Skip to content

Commit a8ee30a

Browse files
author
Kaushik Ghose
committed
Only use basename of $import-ed SchemaDef for types
Closes #80
1 parent d4e29e7 commit a8ee30a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

benten/cwl/linkedschemadeftype.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Copyright (c) 2019 Seven Bridges. See LICENSE
22

3+
import pathlib
4+
from urllib.parse import urlparse
5+
36
from .linkedfiletype import CWLLinkedFile
47
from .basetype import IntelligenceContext, Intelligence, MapSubjectPredicate
58
from ..langserver.lspobjects import Diagnostic, DiagnosticSeverity, Range
@@ -36,7 +39,9 @@ def parse(self,
3639
]
3740
return
3841

42+
fname = pathlib.Path(urlparse(self.prefix).path).name
43+
3944
for _type in _type_list:
4045
if "name" in _type:
41-
name = self.prefix + "#" + _type.pop("name")
46+
name = fname + "#" + _type.pop("name")
4247
code_intel.type_defs[name] = _type

tests/cwl/misc/cl-schemadef-import.cwl

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ requirements:
1010
- class: InlineJavascriptRequirement
1111
- class: SchemaDefRequirement
1212
types:
13-
- $import: paired_end_record.yml
13+
- $import: ./paired_end_record.yml

0 commit comments

Comments
 (0)