Commit Graph

329 Commits

Author SHA1 Message Date
Grigorii Kirgizov f343ba0d3b Adjust to changes in SessionToken & RulesDiff interfaces 2019-11-06 19:10:29 +03:00
Grigorii Kirgizov 9b61c6a2d3 Move RulesListIImpl out of RulesListBuilder
For later Program modification by RulesDiff and preserved rules from prev Program
2019-11-06 19:10:29 +03:00
Fedor Isakov 3f1b65ada2 Fix the structural errors introduced by a badly run migration. 2019-11-06 12:05:18 +01:00
Fedor Isakov ad90a4cb77 Apply migration that replaces all instances of NodeAnchor with .pointer op. 2019-11-06 11:21:57 +01:00
Fedor Isakov daa1bdceb6 Update default jvm options for running tests to "-Xmx2048m". 2019-11-05 20:53:01 +01:00
Fedor Isakov bb8fffc7ea Enable to use origin{} block to specify no origin.
Rules that are used only as auxiliary resolvers don't have an associated
origin node, even though they are produced from a specific location.
To enable tracking of correct origin to report errors to one can use
origin(no origin){} to override the default behaviour.
2019-11-05 18:46:02 +01:00
Fedor Isakov 76739d20d9 Minor refactoring and renaming in coderules runtime. Documentation.
Rename classes and methods to better reflect the intent.
Move test-related stuff to test util model.
2019-11-05 18:46:02 +01:00
Fedor Isakov e32ff36d1b Allow node-ptr<> to be specified in require statement. 2019-11-04 17:10:34 +01:00
Fedor Isakov 48375c4d14 Extend RuleBuilder with template app session: automatically require node ponters passed as args to constraints.
Every node pointer (SNodeReference) specified as an arg to a constraint causes the (resolved) target to be included
into template application session (required).
Reduce NodeAnchor to .pointer call.
Deprecate Reporting interface and context repository in rule definitions.
2019-11-04 16:20:57 +01:00
Fedor Isakov cc8cf72819 Minor code cleanup: get rid of MacroTemplate.ID, simplify templates. Systemize RuleBuilder usages. 2019-11-04 16:20:57 +01:00
Fedor Isakov 84162b9097 Deprecate NodeAnchor, provide migration to .pointer operation.
A usage of .pointer op as an argument to a constraint invokes require() on template application session.
2019-11-04 16:20:38 +01:00
Fedor Isakov a0b2af95c9 Revert "MPSCR-4: Upd refs to new RuleIndex on Dispatcher construction in incremental case."
This reverts commit 0dd7f8c70f.
2019-11-04 15:58:54 +01:00
Grigorii Kirgizov 0dd7f8c70f MPSCR-4: Upd refs to new RuleIndex on Dispatcher construction in incremental case.
Slightly extend RuleMatcher interface.
Store RuleMatcher instances instead of RuleMatcherProbe in SessionToken.
2019-10-31 22:20:19 +03:00
Grigorii Kirgizov 1a720dd76e Fix RuleBuilder.uniqueTag computation: consider SNodeReference not only inside DataNode but also raw 2019-10-31 18:07:31 +03:00
Grigorii Kirgizov 0e33bffa96 Handle additional case of constructing ListNodeCons 2019-10-26 16:17:37 +03:00
Fedor Isakov 3092fa3635 Fix all templates with broken scopes for logical variables. 2019-10-25 22:45:55 +02:00
Fedor Isakov c797b5d2ad Breaking change: logical vars must be declared by constraint rule that uses them.
Stronger rules for logical variables scope: constraint rule can't reference logical variable defined in another constraint rule. Logical variable definitions are localized to ConstraintRule template.
Simplify/cleanup the logic of searching for available logical variables.
2019-10-25 22:45:55 +02:00
Fedor Isakov 4160c186e1 Introduce dependency to Config in typechecking options and service. Avoid relying on static getInstance() method to access Config.
Config is an application-level "component" initialized from an application plugin.
All usages on application/project-level should declare explicit dependency on it.
Tests can either create a new instance or access the shared one.
2019-10-23 15:39:17 +02:00
Fedor Isakov 1534864ffb Separately register USER-level typechecking options, drop synch barrier. Keep it simple and stupid.
Options providers are registed in application plugin and project plugin.
Application plugin registers the USER level options, project plugin
is responsible for UI level.
Option providers are cleard on closing project/closing app.
2019-10-22 21:20:15 +02:00
Fedor Isakov b2139c4648 Fix typechecking in incremental mode. Cache type collector and smartly cache session token.
Keep cached session token with regard to aspect clique.
Keep type collector object in the typechecking cache.
The rationale: in incremental mode the parameters passed to query template are ignored, and essentially the parameters passed to the original query are re-used.
2019-10-19 22:19:53 +02:00
Fedor Isakov 6af78d1b94 Make CoderulesHelper reference the relevant aspect clique.
It's important to keep reference to the aspect clique that used to instantiate
a particular helper. Later it can be used to identify the correct session token.
2019-10-19 22:15:52 +02:00
Fedor Isakov 6eb1e06013 Add a unique key to identify an aspect clique. 2019-10-19 22:12:34 +02:00
Fedor Isakov 4e892ea5aa Drop additional "enabled" flag, superceded by Config. 2019-10-19 11:04:14 +02:00
Fedor Isakov 3fb8df4af4 Fix CheckProjectModules test. Drop usages of deprecated API. 2019-10-19 11:03:30 +02:00
Fedor Isakov fc4ff2875c Implement more fine-grained Config reset: drop all levels >= given. 2019-10-19 10:22:17 +02:00
Fedor Isakov 44d9d9e6b2 Avoid processing empty aspect clique. 2019-10-19 09:54:15 +02:00
Fedor Isakov 7705e911c5 Avoid failure on missing effect value. 2019-10-18 21:18:00 +02:00
Fedor Isakov d8243a5bf4 Fix the typechecking cache: avoid clearing all type assignments, ensure incremental update. 2019-10-18 18:22:07 +02:00
Fedor Isakov 51cc3a7afc Simplify working with SessionToken, drop a supefluous step. 2019-10-18 18:22:07 +02:00
Fedor Isakov 1e5c83dd93 Avoid failing with NPE if a project pref component is not available. 2019-10-18 17:03:56 +02:00
Fedor Isakov 2c514f08fd Fix Config initialization from tests. Replace init/deinit with single reset method. 2019-10-18 17:03:18 +02:00
Fedor Isakov 6c63cb409f Introduce Config component. Make typechecker pref page nicer. Consolidate all typechecking options.
A reusable Config app component to be responsible for all level of configurations: default/system/user/ui.
Swith to Config interface instead of map<string,Object> for options.
Add an UI option to control whether trace is enabled.
2019-10-18 11:58:51 +02:00
Grigorii Kirgizov 439599d726 Fix Analyses test (fix recover constraint signature) 2019-10-15 21:30:00 +03:00
Grigorii Kirgizov bc06bf39cc Handle one more case of finding principal constraints in Query rules with an additional heuristic. 2019-10-15 21:15:38 +03:00
Grigorii Kirgizov 28a82fd443 Revert "Temporarily disable failing tests in BLIncrTypecheck test case."
This reverts commit 1c1ddd6e
2019-10-15 18:01:21 +03:00
Fedor Isakov 6372f5a4a4 Experimental: cache the results of convertsTo/coerceTo queries.
The cache is repository-local and is invalidated on every command in that repository.
2019-10-12 09:35:09 +02:00
Fedor Isakov 0b037d9702 Code cleanup: remove unused effect values, ensure Reporting.assignType() throws an UOE.
Reporting interface is to be phased out.
2019-10-12 09:35:09 +02:00
Fedor Isakov 54c9ff4698 Switch "show type" action's implementation to use TypecheckingService.
Tried also to register TypesModule with the repository, in vain.
2019-10-12 09:35:09 +02:00
Fedor Isakov 06076860ed Deprecate SNodeSetType operation in typechecking lang. This lang exists now only for the sake of "types" aspect. 2019-10-12 09:35:09 +02:00
Fedor Isakov 1c1ddd6e5d Temporarily disable failing tests in BLIncrTypecheck test case.
Tests started to fail after an argument was introduced to a constraint that is being
activated from a query -- recoverAll/1 now has a parameter.
2019-10-12 09:35:09 +02:00
Fedor Isakov 5258a9343f Switch to collecting types during typechecking using the explicit type collector.
Use the parameter to typechecking query TYPECHECK to collect types.
Stop highlighting every expression with its type.
2019-10-10 17:30:11 +02:00
Fedor Isakov f8dcf127db Extend typechecking query TYPECHECK with a parameter to report types.
Reporting of calculated types is to be more explicit.
The not-so-obvious _type_.set() operation is to be phased out.
2019-10-10 17:30:11 +02:00
Fedor Isakov 8e4daab3c7 Stop using IMakeService.INSTANCE. 2019-10-07 11:27:32 +02:00
Fedor Isakov 50c0130138 Fix memory leak: leaked through toolbar actions. 2019-09-30 16:44:36 +02:00
Fedor Isakov a0405839b3 Necessary plumbing for rules segmentation. Off for now.
Turns out this feature actuall worsens the performance.
2019-09-30 16:44:36 +02:00
Fedor Isakov 49518e0704 Switch to reactor version 0.9.14. 2019-09-30 16:44:36 +02:00
Fedor Isakov 30e3400859 Implement isUpToDate check for types index cache. 2019-09-16 11:02:59 +02:00
Fedor Isakov b46c394aba Minor refactoring: consolidate trace events and report items together. 2019-09-15 14:12:47 +02:00
Fedor Isakov 9f7b14ef8b Refactorings in coderules helper to better handle effects.
Introduce failure as effect value.
Avoid throwing exceptions on normal evaluation completion.
Drop ResumeNextStepException.
2019-09-15 10:14:04 +02:00
Fedor Isakov 0b917fea92 Fix memory leak in Action Trace. Closing the tool itself closes all tabs.
The default functionality of "Close" action provided for tools is not enough to implement
a close action: the contents are still registered in the Disposer and the memory is leaked
as a result.
2019-09-13 15:56:11 +02:00