Skip to content

Consider unpinning SourceFile and io.spine.code.fs from base #942

Description

@alexander-yevsyukov

Follow-up to the moves in #938#941; requires an API decision, so filed separately.

io.spine.code.fs (AbstractFileName, AbstractSourceFile, FsObject) and io.spine.code.proto.SourceFile are imported only by tooling (ToolBase; SourceFile also by the dormant mc-js), yet they cannot move today:

  1. FileSet.topLevelMessages() and FileSet.findMessageTypes(Predicate) construct SourceFile, and FileSet is runtime-essential — KnownTypes.load()FileSet.load() runs at application startup.
  2. io.spine.code.proto.FileName (runtime: used by MessageFile, Type, FileSet) extends code.fs.AbstractFileName.

If the two FileSet methods are relocated to ToolBase (e.g. as extension functions over FileSet), SourceFile, AbstractSourceFile, and FsObject could follow to ToolBase. AbstractFileName stays in base regardless, because of FileName.

This changes the public API of a runtime type (FileSet), so it needs a design decision rather than a mechanical move. Pre-2.0 is the cheapest time if we want it at all.

Metadata

Metadata

Labels

No labels
No labels

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions