Skip to content

Commit

Permalink
Rename extensions to fileExtensions
Browse files Browse the repository at this point in the history
  • Loading branch information
msujew committed Jul 20, 2021
1 parent 89beafd commit b69a0a4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/arithmetics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"langium": {
"languageId": "arithmetics",
"grammar": "src/language-server/arithmetics.langium",
"extensions": [".calc"],
"fileExtensions": [".calc"],
"out": "src/language-server/generated",
"textMate": {
"out": "syntaxes/arithmetics.tmLanguage.json"
Expand Down
2 changes: 1 addition & 1 deletion examples/domainmodel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"langium": {
"languageId": "domain-model",
"grammar": "src/language-server/domain-model.langium",
"extensions": [".dmodel"],
"fileExtensions": [".dmodel"],
"out": "src/language-server/generated",
"textMate": {
"out": "syntaxes/domain-model.tmLanguage.json"
Expand Down
2 changes: 1 addition & 1 deletion examples/statemachine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"langium": {
"languageId": "statemachine",
"grammar": "src/language-server/statemachine.langium",
"extensions": [".statemachine"],
"fileExtensions": [".statemachine"],
"out": "src/language-server/generated",
"textMate": {
"out": "./syntaxes/statemachine.tmLanguage.json"
Expand Down
2 changes: 1 addition & 1 deletion packages/generator-langium/langium-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"langium": {
"languageId": "<%= language-id %>",
"grammar": "src/language-server/<%= language-id %>.langium",
"extensions": <%= file-extension %>,
"fileExtensions": <%= file-extension %>,
"out": "src/language-server/generated",
"textMate": {
"out": "syntaxes/<%= language-id %>.tmLanguage.json"
Expand Down
6 changes: 3 additions & 3 deletions packages/langium-cli/src/generator/module-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ export function generateModule(grammar: langium.Grammar, config: LangiumConfig):
"import { Parser } from './parser';", NL, NL
);

node.append('const metaData = {', NL);
node.append('export const languageMetaData = {', NL);
node.indent(metaData => {
metaData.append(`languageId: '${config.languageId}',`, NL);
metaData.append(`fileExtensions: [${config.extensions && config.extensions.map(e => appendQuotesAndDot(e)).join(', ')}]`, NL);
metaData.append(`fileExtensions: [${config.fileExtensions && config.fileExtensions.map(e => appendQuotesAndDot(e)).join(', ')}]`, NL);
});
node.append('};', NL, NL);

Expand All @@ -41,7 +41,7 @@ export function generateModule(grammar: langium.Grammar, config: LangiumConfig):
'},', NL,
'GrammarAccess: () => new ', grammar.name, 'GrammarAccess(),', NL,
'AstReflection: () => new ', grammar.name, 'AstReflection(),', NL,
'LanguageMetaData: () => metaData', NL
'LanguageMetaData: () => languageMetaData', NL
);
});
node.append('};', NL);
Expand Down
2 changes: 1 addition & 1 deletion packages/langium-cli/src/generator/textmate-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function generateTextMate(grammar: langium.Grammar, config: LangiumConfig
const json: TextMateGrammar = {
name: config.languageId,
scopeName: `source.${config.languageId}`,
fileTypes: config.extensions ?? [],
fileTypes: config.fileExtensions ?? [],
patterns: getPatterns(grammar, config),
repository: getRepository(grammar, config)
};
Expand Down
2 changes: 1 addition & 1 deletion packages/langium-cli/src/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface LangiumConfig {
/** Path to the grammar file */
grammar?: string
/** File extensions with leading `.` */
extensions?: string[]
fileExtensions?: string[]
/** Main output directory for TypeScript code */
out?: string
/** Enable generating a TextMate syntax highlighting file */
Expand Down
2 changes: 1 addition & 1 deletion packages/langium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"langium": {
"languageId": "langium",
"grammar": "src/grammar/langium-grammar.langium",
"extensions": [
"fileExtensions": [
"langium"
],
"out": "src/grammar/generated",
Expand Down

0 comments on commit b69a0a4

Please sign in to comment.