Skip to content

Commit 3fc9881

Browse files
committed
Fix clickable keywords on build
1 parent 9ed8a79 commit 3fc9881

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

web/mta_highlighting/generate-lua-tmlanguage.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const __dirname = path.dirname(__filename);
1010
const functionsDir = path.resolve(__dirname, '../../functions');
1111
const basePath = path.resolve(__dirname, './lua-base.tmLanguage.json');
1212
const outputPath = path.resolve(__dirname, '../src/grammars/lua-mta.tmLanguage.json');
13+
const publicPath = path.resolve(__dirname, '../public/lua-mta.tmLanguage.json');
1314

1415
const mtaKeywords = ['string','bool','boolean','number','int','float','element','player','vehicle','ped','object','building'];
1516

@@ -57,6 +58,10 @@ async function generateTmLanguage() {
5758
baseGrammar.patterns = [...patterns, ...(baseGrammar.patterns || [])];
5859

5960
fs.writeFileSync(outputPath, JSON.stringify(baseGrammar, null, 2));
61+
62+
// Create file also in public directory for clickable keywords (public/mta-keywords_linker.js)
63+
fs.copyFileSync(outputPath, publicPath);
64+
6065
console.log(`Done!`);
6166
}
6267

0 commit comments

Comments
 (0)