@@ -138,7 +138,7 @@ export abstract class AbstractLangiumParser implements BaseParser {
138138 protected allRules = new Map < string , RuleResult > ( ) ;
139139 protected mainRule ! : RuleResult ;
140140
141- constructor ( services : LangiumCoreServices ) {
141+ constructor ( services : LangiumCoreServices , incomplete : boolean ) {
142142 this . lexer = services . parser . Lexer ;
143143 const tokens = this . lexer . definition ;
144144 const production = services . LanguageMetaData . mode === 'production' ;
@@ -147,13 +147,13 @@ export abstract class AbstractLangiumParser implements BaseParser {
147147 ...services . parser . ParserConfig ,
148148 skipValidations : production ,
149149 errorMessageProvider : services . parser . ParserErrorMessageProvider
150- } , services . shared . profilers . LangiumProfiler . createTask ( 'parsing' , services . LanguageMetaData . languageId ) ) ;
150+ } , incomplete , services . shared . profilers . LangiumProfiler . createTask ( 'parsing' , services . LanguageMetaData . languageId ) ) ;
151151 } else {
152152 this . wrapper = new ChevrotainWrapper ( tokens , {
153153 ...services . parser . ParserConfig ,
154154 skipValidations : production ,
155155 errorMessageProvider : services . parser . ParserErrorMessageProvider
156- } ) ;
156+ } , incomplete ) ;
157157 }
158158 }
159159
@@ -223,7 +223,7 @@ export class LangiumParser extends AbstractLangiumParser {
223223 }
224224
225225 constructor ( services : LangiumCoreServices ) {
226- super ( services ) ;
226+ super ( services , false ) ;
227227 this . linker = services . references . Linker ;
228228 this . converter = services . parser . ValueConverter ;
229229 this . astReflection = services . shared . AstReflection ;
@@ -694,6 +694,10 @@ export class LangiumCompletionParser extends AbstractLangiumParser {
694694 private nextTokenIndex = 0 ;
695695 private stackSize = 0 ;
696696
697+ constructor ( services : LangiumCoreServices ) {
698+ super ( services , true ) ;
699+ }
700+
697701 action ( ) : void {
698702 // NOOP
699703 }
@@ -809,15 +813,16 @@ class ChevrotainWrapper extends EmbeddedActionsParser {
809813 // This array is set in the base implementation of Chevrotain.
810814 definitionErrors : IParserDefinitionError [ ] ;
811815
812- constructor ( tokens : TokenVocabulary , config : IParserConfig ) {
816+ constructor ( tokens : TokenVocabulary , config : IParserConfig , incomplete : boolean ) {
813817 const useDefaultLookahead = config && 'maxLookahead' in config ;
814818 super ( tokens , {
815819 ...defaultConfig ,
816820 lookaheadStrategy : useDefaultLookahead
817821 ? new LLkLookaheadStrategy ( { maxLookahead : config . maxLookahead } )
818822 : new LLStarLookaheadStrategy ( {
819823 // If validations are skipped, don't log the lookahead warnings
820- logging : config . skipValidations ? ( ) => { } : undefined
824+ logging : config . skipValidations ? ( ) => { } : undefined ,
825+ incomplete,
821826 } ) ,
822827 ...config ,
823828 } ) ;
@@ -867,8 +872,8 @@ class ChevrotainWrapper extends EmbeddedActionsParser {
867872
868873class ProfilerWrapper extends ChevrotainWrapper {
869874 private readonly task : ProfilingTask ;
870- constructor ( tokens : TokenVocabulary , config : IParserConfig , task : ProfilingTask ) {
871- super ( tokens , config ) ;
875+ constructor ( tokens : TokenVocabulary , config : IParserConfig , incomplete : boolean , task : ProfilingTask ) {
876+ super ( tokens , config , incomplete ) ;
872877 this . task = task ;
873878 }
874879
0 commit comments