Repository navigation
Conversation
FASTAgnosticImporter finds the classes that use the FASTTImporter class trait, and picks the importer whose extensions match the file. Two importers for the same extension raise FASTAmbiguousImporterError. The trait's extensions default to none, and its isAbstract answers false, so abstract importers can be skipped
…aded A description is loaded when an importer handling one of its extensions is present in the image. Checking the baseline name was not reliable, since a baseline can be loaded without its importer. Descriptions no longer name their importer class, so renaming a class does not require any change in them.
loadMissingImporterFor: finds a working description that handles the file's extension and whose importer is not present. In an interactive image the user is asked first, with a Spec confirmation dialog. Otherwise the project is loaded directly. The decision is a parameter, so the two paths can be tested without a UI or the network.
The importer section now describes the FASTTImporter trait on both sides, FASTAgnosticImporter with its class-side helpers, the loading of missing projects, and the working flag of the descriptions. The tools group now contains the importer packages, and All is core, tools and deprecated.
…ow to import a file without choosing its importer, what happens when no loaded importer handles it or several do, how to write an importer with the FASTTImporter trait, and which importers are listed but not loaded.
FASTAgnosticImporter parseFolder: and parseFiles: group the files by importer, and each importer fills one model. The answer is a dictionary from each model to the files that filled it, with the files that no importer handles under nil. Whether a missing project may be loaded is decided by a strategy set on the instance side: FASTAskOrLoadStrategy (the default), FASTAlwaysLoadStrategy or FASTNeverLoadStrategy. The README has a quickstart, and the full guide is in resources/doc/importers.md.
The tests used the Java and CSS importers, which are not loaded in the CI, so they failed there. They now use FASTExampleLoneImporter and FASTLoneImporterDescription from the test package.
Coverage Report for CI Build 43892867334Coverage increased (+1.9%) to 26.132%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR moves the importer API into FAST, so that a language importer and its users share one entry point.
FASTTImportertrait, used on the instance side and the class side of each importer. A language importer implementsparse:into:and may overrideextensions.FASTAgnosticImporterimports files and folders without choosing the importer. It groups the files by importer, one model per language, and answers a dictionary from each model to its files, with the files that no importer handles undernil.FASTAskOrLoadStrategy(default),FASTAlwaysLoadStrategyorFASTNeverLoadStrategy.isWorkingandisProjectLoaded, andloadAllskips the descriptions that do not work. FAST-Pharo and FAST-Fortran are flagged for now.resources/doc/importers.md, andAGENTS.mddescribes the rules.