The templates that typechecking relies upon are generated
into the user model as synthetic constructs. These later
need to be discovered by the generator to establish
correct references.
Request is no longer dependent on `TypecheckingService`.
Only single request can be processed at a time, which helps
prevent recursion.
All facade method in `TypecheckingService` now return instance
of `Response` instead.
Drop hacks that try to figure out the active project.
Instead introduce new ones that cache the instance of `ProjectRepository`
(unfortunately, there is no way around that now).
Stop accessing and modifying the singleton `Config` instance,
instead make an instance of `Config` a parameter to `TypecheckingService`.
Rule's unique_tag is important for update procedure
implemented by RulesPlanHandler. Only when we can guarantee
that an argument to constraint/predicate has not changed
we can save on re-building a rule from template.
Ignoring LateExpression was a mistake.
While check/checkTypeOf queries are required to
process a whole root, other types of queries
can be sensitive to what aspects to include in
the processing.
Aspects are sorted in strongly-connected components,
among which the relevant one is selected.
The deisgn decision to have only one instance of QueryTemplate
leads to the necessity to keep AspectClique separated for
every "typesystem". Whereas QueryTemplate are really perfectly
composable, and thus only one AspectClique is neeeded.
Also drop a rudimentary unused feature.
The older technique that passed "typeCollector" to query is replaced
with passing this object as a session parameter.
Can be accessed with "CustomSessionParameter".
Instead of the hack that that uses session parameters to pass
parameters to expandMacro, use directly `withParams` method
on macro token. All parameters are mapped to corresponding fields.
Introduce CustomSessionParameter to access parameters in
TemplateApplicationSession.
Expand macro passes the rule's input to nested macro calls.
This adds the macro input as the dependency of the rule's input.
As a result, incremental processing starts working in some cases.
Ignore all contents of a pattern but the top level.
This covers most situations.
The pattern ought to provide information as to which
nodes are capturing variables.
A node from a pattern with antiquotations is treated as a "hollow"
type with only the form defined, and all parameters being capturing
variables.
This is a workaround for certain kinds of coerce queries that define
unsound pattern nodes.
The incremental algorithm using history and replay/revalidate of
matches is deprecated and will be removed soon. The incremental tests
are now relying on the UpdataRecorder and RulePlanHandler to
implement incrementality.
Invalidated rules set invalidates feedback that has any of them it in its basis.
Validated rules invalidates feedback that has all of validated
rules in its basis set.
Refactor supervisor/feedback consumer to support feedback basis.
Track (in)validated rules tags in RulePlanHandler.
Both (in)- and validated rules cause associated feedback to be cleared.
Disable passing SessionToken in WatchingIncremental strategy;
this forces the correct journal recording but turns off incrementality.
Optionally produce partial program in incremental mode.
A partial program includes all "static" rules plus the "required closure"
of all changed nodes.
Produce program for required nodes unconditionally.
Mark all rule updates as validated only if exlicitly asked for it.
Enable recording the dependencies while expanding macro.
Rename/refactor operations in UpdatesRecorder to reflect the intent
of adding the dependencies.
Introduce invalidated flag to program producer to control whether to
only process invalidated nodes in incremental mode.
Update validated flag in RulesPlanHandler to reflect the finalized
state, after the plan has been built.
Refactor ProgramProducer/Factory to avoid enumerating the source
root in case no changes have been detected (in incremental mode).
Avoid relaunching program in case the producer did nothing.
BlockingExecutor must not block other helpers from being executed
if a error is detected by one of them.
Since helpers are built in unpredictable order, there can be situations
when an (unrelated) error causes intermittent failures.
The idea to use "tracking" cache to save on typechecking operations is obsolete.
There is conflict of responsibilities with UpdatesRecorder,
which is to be solely relied upon for all things related to tracking changes.
StyledTreeCellRenderer component received wrong bounding box
because of top border's inset to be set to 1 (see DefaultTreeUI.paint()).
This border is the default set by LookAndFeel.installBorder()
in case the border on tree component is set to null,
which is explicitly set to null in TreeTableTree's constructor (go figure).
Some language imports necessary for correct typechecking are obscure.
Example may be a closure type, which requires the type of the operand
(receiver) of the method it serves a parameter to. That, in turn, may
require some type defined in another root and perhaps some other model.
Enable rule index to be updated during rules application.
Make RuleProcessingSession depend on AspectClique.
Enable updating of rule/macro/query indices.
Fix rule basetag generation to coincide with templateName
Needed for PrincipalStore (occurrence cache) which uses
info about occurrence source rule template name.
It's important that program that uses occurrences from cache
shouldn't include rules that could produce their duplicates.
So implementation of occurence cache includes 2 parts:
on reactor level & in ProrgramFactory.
When RuleBuilders are produced, cache is queried whether
there're already occurrences associated with the rule template
in question. If so -- then those RuleBuilders are not included
into the program (as well as all RuleBuilders required by it).
Get information on invalidated nodes from EvaluateStep & incr processing
instead of UpdatesRecorder, which has only partial info and can't handle
all cases.
TemplateApplicationSession allows to invoke require with the
input node as the first parameter, which is then forwarded as
a "requirement" (TODO: rename to dependency).
The use of ProgramProducer and other stuff have new requirements.
The program is now produced incrementally, with UpdatesRecorder
playing a major role in keeping track of changes.
Move invalidation logic inside UpdatesRecorder from elsewhere.
Drop type parameters.
Avoid recording dependencies for null input.
ProgramFactory: always process input, not only the first time
A query may be invoked without the input node, thus dispatching
macros by the specified concept. The concept must be taken into
account when calculating the "diff", so that the old (stale)
rules don't override the updated ones.
This query kind is to be used in local typechecking.
The idea is to do away with constraints that are not essential for
typechecking a single node, thus making local type computation faster.
Consolidate options, configure all from typechecking plugin.
Introduce a computable option to control using traces.
Introduce shared state to be used at generation time.
Drop repository cache holder, replace with a field in state.
Fix singleton type collector.
Fix memory leak in strategy by cleaning it up after execution.
Avoid dereferencing DynamicReference from OriginIndex as it involves typechecking computation.
Aviod enqueing type nodes with TypesModelHandler during generation,
a workaround for "mature" references unable to be resolved
if target is in a transient (unpublished) model. (MPS-32709)
Ensure "local" typeof computation is used when queries a created with null root.
It might be necessary to look a little further into the input node's
referenced nodes to gather all relevant models for recovering
types aspects. Example: a type in BL may extend another BL type
parameterized by a non-BL type, such as node<>.
Also process expand macro input for rule hash,
so that changed query rules (like one in testlang) get into
RulesDiff and could be updated with Preamble processing.
Program Preamble consists of 2 parts: rules & Journal.
Preamble rules are no-input rules with rules for their required nodes.
Preamble journal is journal part with results of executing these rules.
Preamble is defined per-Query, because Journal differs for Queries.
Repository CacheHolder is used for storing them b/w sessions.
Rules are stored and retrievied with Memoizer.
Journal is stored as SessionToken in PreambleSet (map Query->SessionToken).
Add option to IncrementalSpec -- incrementality level (Preamble or Full).
Ensure the order of rules in the resulting plan follows the priorities
set forward by extends relationship b/w languages. So that even if
rule template tables are unrelated, they are still ordered according to
language extension graph.
Ensure the order of rule lists in the resulting plan is stable b/w invocations of
RulesPlanHandler.allPlans().
Ensure the order of aspects in AspectClique is stable b/w invocations
of buildClique().
Associate RuleTemplatesTable with Manifest, and Manifest with CoderulesAspect.
Tentatively rename RulesList (the runtime object) to RulesPlan,
RulesListTable to RulesPlanHandler.
Too many nodes get into tmpl application process, which is unnecessary.
Many of those nodes are required actually only for correctly tracking
changes to nodes with WatchingTypecheckingStrategy.
Now implicitly required only nodes which are mentioned inside
constraint arguments. In other cases user must require them explicitly.
Alter the way invalidated nodes are handled by UpdatesRecorder.
A set of "source" nodes is now maintained, which helps to
detect the appropriate input for a changed node.
Templates are applied only to "new" or "invalidated" nodes.
Rename TypeDependenciesNodeTracker to RelevantNodesMonitor and
have it the only implementation.
The "stub" implementation was never really used.
Simplify creation of and access to the monitor.
Instead of copying cached data just re-plant the fields to the new cache.
The new types-model to contain only the newly reported types. Types reported on earlier invocations are retained
in previously created models.
Refactor whe way TypecheckingResultsCache is updated:
all mutatiting methods extracted to Update subclass, which is
only available to the updater.
Make TypecheckingState a regular container for (unit) caches.
Make TypecheckingService responsible for managing caches.
Extract TypeModuleOwner and TypeModelHandler classes.
Get rid of QueryResultsCache, merge into TypecheckingResultsCache.
TypeModuleOwner to manage "repository" cache.
When running typechecking with trace=on too much memory is taken up
by the traces, the new option enables to see the evaluation results
without collecting the traces.