feat: add capability to skip loading the AST from storage#1101
feat: add capability to skip loading the AST from storage#1101ava-fred merged 1 commit intodsldevkit:masterfrom
Conversation
| resourceSet.getLoadOptions().put(INSTALL_DERIVED_STATE, installDerivedState); | ||
| } | ||
|
|
||
| public static boolean skipAST(final @NonNull ResourceSet resourceSet) { |
There was a problem hiding this comment.
and change the name and default here as well
There was a problem hiding this comment.
What would I need to change it to?
| return object != null && (boolean) object; // default is false | ||
| } | ||
|
|
||
| public static void setSkipAST(final @NonNull ResourceSet resourceSet, final @Nullable Boolean installDerivedState) { |
There was a problem hiding this comment.
the name installDerivedState needs to be changed, right?
There was a problem hiding this comment.
I don't understand why it needs to be changed, please explain.
There was a problem hiding this comment.
the second parameter installDerivedState should be named installAST, shouldn't it? Or with the naming I suggest, installModel and the method called setSkipModel
There was a problem hiding this comment.
Yes it should. I have done the rename you suggested and used "model" instead of "AST".
...rc/com/avaloq/tools/ddk/xtext/resource/persistence/DirectLinkingResourceStorageLoadable.java
Show resolved
Hide resolved
| BasicEList<InternalEObject> internalEObjectList = new BasicEList<InternalEObject>(); // NOPMD LooseCoupling | ||
| internalEObjectList.setData(1, values); | ||
| @SuppressWarnings("unchecked") | ||
| InternalEList<InternalEObject> internalEObjects = (InternalEList<InternalEObject>) (InternalEList<?>) resource.getContents(); |
There was a problem hiding this comment.
what about adding subclassed BasicEList which throws an UnsoportedOperationException in all operations? That way we are sure that we are not getting wrong results because we access a partially loaded resource.
There was a problem hiding this comment.
No, that's not going to work: this list is returned from Resource.getContents(), the inference container is contained in it
This commit introduces a new ResourceSetOption, using which it is possible to skip loading the AST when loading a resource from binary storage.
This commit introduces a new ResourceSetOption, using which it is possible to skip loading the AST when loading a resource from binary storage.