nested prefix alternatives analysis
now flattenPaths() considers following repetitions
new problem: unordered groups and non-trivial cardinalities without
non-optional elements causes explosion of generated alternatives, which
in turn cause the identity analysis to go out of control
example: S: ('a'? | 'b'?)+
with a token limit of 10 the nested prefix alternatives analysis would
generate over 1300 alternatives
current quick fix: limit of alternatives
after minimal path difference analysis failed, flatten paths (limited by
token limit; justification: identity check would error out if paths are
not distinguishable within the limit) and recompute alternative guard.
now nested prefixes will be collapsed with all corresponding guard
conditions
This change introduces an explicit validation context that is used by the INamesAreUniqueValidationHelper. This allows to fine tune the scope of the validation in various ways. Default contexts are available to validation uniqueness in the current container, along the chain of visible containers or local to the current resource (the default).
Local unique name validation can be implemented now based on the LocalUniqueNameContext.
closes#1466
- Modify the FormattingConfigBasedStream to handle the different line
endings properly.
- Implement corresponding XtextFormatterTest and
GrammarAccessExtensions2Test test cases.
Signed-off-by: Tamas Miklossy <miklossy@itemis.de>
- Improve the serializeReplacement implementation by modifying the
ReplaceRegion length calculation so that it takes not only the
ICompositeNode.getTotalLength() into account, but considers if the new
text contains additional whitespaces and the old text is also followed
by white spaces, than the whitespaces contained by the original document
is also consumed by the quickfix.
- Implement corresponding SerializerReplacementCalculationTest test case
based on the NoJdtTestLanguage.
Signed-off-by: Tamas Miklossy <miklossy@itemis.de>
Don't call a value converter if nothing was matched. Also don't assign naively true for boolean values without checking if there was a token consumed.
closes#1462
Throw NullPointerException if null is passed to NodeIterator constructor
to prevent iterator state where hasNext() and hasPrevious() always
return true, but getNext() and getPrevious() always return null.
Similarly, throw NPE for null passed to constructors of NodeIterable,
BasicNodeIterator and BasicNodeIterable. Added unit tests for all four
classes.
Signed-off-by: Robert Lewis <rablewis@algo-pop.com>
Throw NullPointerException if null is passed to NodeIterator constructor
to prevent iterator state where hasNext() and hasPrevious() always
return true, but getNext() and getPrevious() always return null.
Signed-off-by: Robert Lewis <rablewis@algo-pop.com>
[#1316] Add end line and end column positions to Issue. Also initialise lines and columns with 0.
Previously, end line and end column information was not part of Issue, IssueImpl, IssueLocation, AbstractDiagnostic, and ExceptionDiagnostic. It is helpful to have this information in these classes, because otherwise (i.e. now in LanguageServerImpl#toDiagnostic(Issue)) this information has to be computed by loading the Document again.
closes#1316
Signed-off-by: mmews <marcus.mews@numberfour.eu>