Repository navigation
fix: show per-entity schema declarations in the outline tree - #114
Merged
wisnesky merged 1 commit intoOct 8, 2026
Merged
Conversation
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.
Fixes #113
The issue
In the IDE outline a schema literal written with
entityblocks has no expand arrow. In theNewDemoexample,schema Olog1Schemaandschema Olog2Schemacannot be expanded.A schema literal can declare its entities, foreign keys and attributes in sections, as in
Abelow, or per entity, as inB. Only the per-entity form is affected.The outline takes the children of a schema node from
SchExpRaw.raw(), which the constructor fills by callingdoGuiIndexing. The constructor merges the per-entity declarations (ensSimpl) into theens,fksandattsfields, but it passesdoGuiIndexingonly the lists from the sectioned form. For schemaB, every section ofraw()stays empty, andCqlCodeEditor.adddoes not draw empty sections.Raw.findsearches the same lists, so it cannot locate a name declared per entity either. The onlyfindcall inSchExpRawlooks up observation equations, which is why the outline is the only visible symptom.The bug is not recent. The
doGuiIndexingcall is the same as in the initial commit (399f0f4, 2019-03-13). The per-entity form was added later, in eaf1813 (2021-03-11), and its declarations were never passed todoGuiIndexing.The solution
The constructor now computes the merged lists once and uses them both for the fields and for
doGuiIndexing. The private helperwhee(List<LocStr>, ...)already built anArrayList, so its declared return type changes fromCollection<LocStr>toList<LocStr>, which is the typedoGuiIndexingtakes.Each per-entity label keeps the source position of its name. Clicking it in the outline moves the caret to the declaration, as it already did for the sectioned form (
CodeEditor.java:1224).How to test it
Unit tests are added, and here are two screenshots of the problem
Before fix
After fix