Skip to content

Commit

Permalink
Only use basename of $import-ed SchemaDef for types
Browse files Browse the repository at this point in the history
Closes #80
  • Loading branch information
Kaushik Ghose committed Feb 6, 2020
1 parent d4e29e7 commit a8ee30a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion benten/cwl/linkedschemadeftype.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Copyright (c) 2019 Seven Bridges. See LICENSE

import pathlib
from urllib.parse import urlparse

from .linkedfiletype import CWLLinkedFile
from .basetype import IntelligenceContext, Intelligence, MapSubjectPredicate
from ..langserver.lspobjects import Diagnostic, DiagnosticSeverity, Range
Expand Down Expand Up @@ -36,7 +39,9 @@ def parse(self,
]
return

fname = pathlib.Path(urlparse(self.prefix).path).name

for _type in _type_list:
if "name" in _type:
name = self.prefix + "#" + _type.pop("name")
name = fname + "#" + _type.pop("name")
code_intel.type_defs[name] = _type
2 changes: 1 addition & 1 deletion tests/cwl/misc/cl-schemadef-import.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ requirements:
- class: InlineJavascriptRequirement
- class: SchemaDefRequirement
types:
- $import: paired_end_record.yml
- $import: ./paired_end_record.yml

0 comments on commit a8ee30a

Please sign in to comment.