Commit Graph

534 Commits

Author SHA1 Message Date
Fedor Isakov 4755c0dfa0 Extract test helper classes into separate redistributable module 2021-02-14 15:12:58 +01:00
Fedor Isakov d25158b39f Change plugin packaging and versioning
All modules are to be located under languages/.
Version to be RELEASE-0.9-bBUILD
2021-02-13 10:20:09 +01:00
Fedor Isakov bd1753e2ef Fix plugin version number, ensure compatibility with MPS starting from 211 2021-02-08 10:11:58 +01:00
Fedor Isakov a3aa92e60a Temporarily disable test until problems with MPS build are fixed 2021-02-07 19:17:08 +01:00
Fedor Isakov 54cadb200a Repackage plugin 2021-02-06 15:28:03 +01:00
Fedor Isakov ed55370a01 Fix model imports (hamcrest lib has been moved to another solution) 2021-02-04 12:27:55 +01:00
Fedor Isakov 7fe5a5ad7a Auto-updated files after migrating to MPS 2021.1 EAP 2021-02-04 12:26:59 +01:00
Fedor Isakov 676645fad2 Refactor DataForm presentation mechanism, drop unused code
Rewrite most of DataFormPrinter for simplicity.

Reformat presentation of terms, so that the specification comes at the beginning.
2021-02-04 09:16:10 +01:00
Fedor Isakov e06916b184 Refactor TypecheckingService: move logic into Request
Straighten up the code organization by consolidating logic
implementing a request within the corresponding Request
instance.
2021-02-04 09:16:09 +01:00
Fedor Isakov 0e50b0e1b4 Support coerce query to specified (pattern) type
Coerce with pattern expects resulting type to be matched with a node
specified in the pattern.
2021-02-04 08:51:00 +01:00
Fedor Isakov ad269bb6b5 Ensure typechecking state is properly disposed of on reload 2021-02-04 08:51:00 +01:00
Grigorii Kirgizov b1d81ef683 Fix apparent type in DataFormPrinter test 2021-01-29 16:21:57 +03:00
Grigorii Kirgizov 148223a842 Add incremental tests for lambda calc. Enable ignored tests for closures. 2021-01-29 13:39:35 +03:00
Grigorii Kirgizov d1b5c5b477 minor fix in tests: propely hack finding needed aspect clique. allow custom type matchers (for lc) 2021-01-29 13:39:35 +03:00
Grigorii Kirgizov ccecb50fc2 Fix handling of invalidated feedback for effects of Rewind Stage to be visible (MPSCR-67, MPSCR-21) 2021-01-29 13:39:35 +03:00
Fedor Isakov 240fed8f63 Drop Finders feature: unused 2021-01-23 16:59:46 +01:00
Fedor Isakov 536e1aa1c2 Introduce helper methods to factor out creation of terms 2021-01-23 16:59:45 +01:00
Fedor Isakov b3c57465fc Minor refactoring: extract constants for building terms 2021-01-23 16:59:45 +01:00
Fedor Isakov 13627568df Ensure input is processed for fresh cache by setting invalidated to false 2021-01-18 10:59:03 +01:00
Fedor Isakov acc9477512 Drop invalidated flag from cache (unused) 2021-01-18 10:59:02 +01:00
Fedor Isakov dc7a06c685 Ensure typechecking queries get appropriately disposed of for editor session 2021-01-18 10:59:00 +01:00
Fedor Isakov 4be723c09e Introduce programEvaluated flag to strategy, only display traces for real programs 2021-01-18 10:59:00 +01:00
Fedor Isakov 3a5c5dcec4 Avoid keeping cached data by aspect+query kind
This optimization doesn't have any tangible effect.
2021-01-13 17:32:23 +01:00
Fedor Isakov c9f2a34b53 Ensure shared state for basic queries, fix performance of model checker 2021-01-12 22:55:42 +01:00
Fedor Isakov baae5c5bf0 Several interconnected changes to optimize performance in incremental mode
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.
2021-01-12 22:55:42 +01:00
Fedor Isakov d88acbe0f4 Introduce trivial result state 2021-01-12 22:55:40 +01:00
Fedor Isakov 93cbb90fec Avoid aborting execution of helpers in case of error
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.
2021-01-12 22:55:40 +01:00
Fedor Isakov 62e8e7d013 Switch to MPS 2020.3 release. 2021-01-08 11:00:02 +01:00
Fedor Isakov 603787ab2b Fix test that expects same type to be returned from cache, no longer true 2021-01-07 17:04:27 +01:00
Fedor Isakov abb76e68b5 Refactor changes tracking in UpdatesRecorder, use model instead of a ref
Using a model reference require resolving via a repository, which
is unnecessary in case model objects are stored directly.
2021-01-07 13:31:37 +01:00
Fedor Isakov 77b02a4e0e Drop tracking unit cache, rely on UpdatesRecorder to provide incrementality
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.
2021-01-07 13:31:37 +01:00
Fedor Isakov 4c82ddd622 Autofix references to method decl 2021-01-07 13:31:37 +01:00
Fedor Isakov 0315fca5fa Fix ghost artefacts in activation trace appearing on moving selection up
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).
2021-01-06 12:43:55 +01:00
Fedor Isakov 26b0f4ac87 Fix helper action items not appearing in inspector 2020-12-27 16:04:06 +01:00
Fedor Isakov eb03d7d218 Include languages imported to all imported models of the model that contains node to check
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.
2020-12-27 16:04:05 +01:00
Fedor Isakov 64b33d1a88 Refactor RulesPlanHandler to not depend on AspectClique 2020-12-27 10:36:04 +01:00
Fedor Isakov 43ad19494b Refactor rule processing: straightforward dependencies, simplify code
Enable rule index to be updated during rules application.
Make RuleProcessingSession depend on AspectClique.
Enable updating of rule/macro/query indices.
2020-12-27 10:36:00 +01:00
Grigorii Kirgizov ba8ccfce03 minor: Disable incremental option (that controls Preamble also) for lambdacalc tests
Preamble optimization requires same contracts from programs as full incrementality.
2020-12-15 17:59:10 +03:00
Grigorii Kirgizov 8022fa4203 Add tests for local typeOf query with occurrence cache 2020-12-15 17:59:10 +03:00
Grigorii Kirgizov 27ed01c447 refactoring: Adjust uniqueTag usages for Rule.Tag refactoring
Fix rule basetag generation to coincide with templateName

Needed for PrincipalStore (occurrence cache) which uses
info about occurrence source rule template name.
2020-12-15 17:59:09 +03:00
Grigorii Kirgizov 3eccaf81a1 Introduce occurrence store as cache for their reuse in Queries strategy
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).
2020-12-15 17:59:05 +03:00
Grigorii Kirgizov c455514325 Get more precise info on invalidated nodes (fixes MPSCR-82)
Get information on invalidated nodes from EvaluateStep & incr processing
instead of UpdatesRecorder, which has only partial info and can't handle
all cases.
2020-12-15 17:51:23 +03:00
Fedor Isakov 8dd43190b4 Switch to finding aspect clique for subject node in local typechecking
During generation, the imports set of a transient model doesn't always
reflect the actual set of imported languages.
2020-12-15 13:32:54 +01:00
Fedor Isakov 159de90e6f Exclude free floating nodes from required set
Required nodes w/o a model, or "free floating" nodes
are excluded from the required set.
Instead all their valid references are processed.
2020-12-12 13:48:15 +01:00
Fedor Isakov d4f0c9741f Enable reuse of locally calculated types.
Typechecking results cache is consulted on a request to
locally calculate the type.
2020-12-11 12:03:17 +01:00
Fedor Isakov c7eaa1dbf3 Clean up ProgramEvaluator API. Straighten up passing of session token. Drop RulesDiff usages. 2020-12-08 22:57:36 +01:00
Fedor Isakov 4eab445aa9 Introduce overloaded "require" methods to keep track of dependencies.
TemplateApplicationSession allows to invoke require with the
input node as the first parameter, which is then forwarded as
a "requirement" (TODO: rename to dependency).
2020-12-08 22:57:35 +01:00
Fedor Isakov 616c39ae38 Fix incremental test launcher
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.
2020-12-08 22:57:35 +01:00
Fedor Isakov 59db13bf41 Simplify UpdatesRecorder implementation. Fix input processing by ProgramFactory.
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
2020-12-08 12:50:36 +01:00
Fedor Isakov d637bed114 Enable cache data to be accesible with an Object key. Drop usages of PreambleSet.
PreambleSet exists only to allow to multiplex cached values by
query. There is no need for this now that the key can be a compound one.
2020-12-06 16:14:28 +01:00