does builtin document has a string length limit? #1338
-
when i built in my customer language doc which like typescript's declare files. if the doc length greater than about 3200 lines, some doc content can not parse correctly. export class OneLangWorkspaceManager extends DefaultWorkspaceManager {
private documentFactory: LangiumDocumentFactory;
constructor(services: LangiumSharedServices) {
super(services);
this.documentFactory = services.workspace.LangiumDocumentFactory;
}
protected override async loadAdditionalDocuments(
folders: WorkspaceFolder[],
collector: (document: LangiumDocument<AstNode>) => void
): Promise<void> {
await super.loadAdditionalDocuments(folders, collector);
// Load our library using the `builtin` URI schema
collector(this.documentFactory.fromString(oneLangBuiltin, URI.parse('builtin:///library.onelang')));
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @hyphappy011, there is no file length limit in Langium, neither for the builtin documents nor for workspace documents. It might be that there's a parser error in your document. Can you copy the content of your builtin library to the editor and see whether any errors appear in the document? Alternatively place a breakpoint in your workspace manager when loading the document. All documents track their lexer/parser errors in the |
Beta Was this translation helpful? Give feedback.
Hey @hyphappy011,
there is no file length limit in Langium, neither for the builtin documents nor for workspace documents. It might be that there's a parser error in your document. Can you copy the content of your builtin library to the editor and see whether any errors appear in the document? Alternatively place a breakpoint in your workspace manager when loading the document. All documents track their lexer/parser errors in the
parseResult
property.