Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow DSLs deployments to load a parser from the precompiled file without waiting for evaluators to load #297

Merged
merged 16 commits into from
Sep 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions rascal-vscode-extension/src/lsp/ParameterizedLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,36 @@ export class ParameterizedLanguageServer implements vscode.Disposable {

}


/**
* Define a DSL that the DSL multiplexer has to load
*/
export interface LanguageParameter {
pathConfig: string // rascal pathConfig constructor as a string
name: string; // name of the language
extension:string; // extension for files in this language
mainModule: string; // main module to locate mainFunction in
mainFunction: string; // main function which contributes the language implementation
precompiledParser: ParserSpecification | undefined; // optionally configure a precompiled parser function
/** rascal pathConfig constructor as a string */
pathConfig: string
/** name of the language */
name: string;
/** extension for files in this language */
extension:string;
/** main module to locate mainFunction in */
mainModule: string;
/** main function which contributes the language implementation */
mainFunction: string;
/** optionally configure a precompiled parser function */
precompiledParser: ParserSpecification | undefined;
}

/**
* Define precompiled parser to load before the modules have loaded.
* This helps reduce the time an IDE is shown without syntax highlighting
*/
export interface ParserSpecification {
parserFile: string; // which file contains the grammars
startTerminal: string; // which terminal to extract from the list of parsers in that file
/** absolute path to the file containing the precompiled parsers */
parserFile: string;
/** terminal to use from the defined parsers */
DavyLandman marked this conversation as resolved.
Show resolved Hide resolved
terminalName: string;
/** is the terminal a `start` terminal, default: true */
terminalIsStart: boolean | undefined;
DavyLandman marked this conversation as resolved.
Show resolved Hide resolved

}

function languageKey(lang: LanguageParameter) {
Expand Down