Skip to content

Documents are ignored during initial indexing when already opened in an editor during VSCode startup #788

@sailingKieler

Description

@sailingKieler

Bildschirmfoto 2022-11-28 um 12 10 04

Explanation:

  • LS initialized event causes the workspace manager beginning its initially scan for files, the subsequent start of the initially document build is guarded by https://github.com/langium/langium/blob/5ab46cf82543c75c26750a38cca4b00323fd7b2a/packages/langium/src/workspace/workspace-manager.ts#L79, which here causes a cancelation because of an immediately following
  • onDidOpenTextDocument event for trafficlight.statemachine, which (after canceling previously scheduled build activities) causes the deletion of the previously created langiumDocument and scheduling of a subsequent (still initial) build of that document via https://github.com/langium/langium/blob/5ab46cf82543c75c26750a38cca4b00323fd7b2a/packages/langium/src/workspace/document-builder.ts#L86-L92 that in turn gets canceled at the cancelation check, as a second
  • onDidOpenTextDocument event for trafficlightExtended.statemachine comes in that (again after canceling previously scheduled build activities) triggers the deletion of the previously created langiumDocument and scheduling of a subsequent (still initial) build of that document. That build will eventually be executed with the document list of [ trafficlightExtended.statemachine ].
    As a consequence, trafficlight.statemachine has never been built, especially never indexed.
    Thus, error markers on that document in the IDE are not up-to-date, and other documents suffer linking errors.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions