Skip to content

Commit a9d1e45

Browse files
Revert "Fix mta-keywords_linker.js"
This reverts commit 3b00c41.
1 parent 3b00c41 commit a9d1e45

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

web/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ pnpm-debug.log*
2121
.DS_Store
2222

2323
# tmLanguage file
24-
public/grammars/
24+
src/grammars/

web/ec.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default {
1010
{
1111
id: 'lua',
1212
scopeName: 'source.lua.mta',
13-
...JSON.parse(fs.readFileSync('./public/grammars/lua-mta.tmLanguage.json', 'utf-8')),
13+
...JSON.parse(fs.readFileSync('./src/grammars/lua-mta.tmLanguage.json', 'utf-8')),
1414
},
1515
],
1616
},

web/mta_highlighting/generate-lua-tmlanguage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const __dirname = path.dirname(__filename);
99

1010
const functionsDir = path.resolve(__dirname, '../../functions');
1111
const basePath = path.resolve(__dirname, './lua-base.tmLanguage.json');
12-
const outputPath = path.resolve(__dirname, '../public/grammars/lua-mta.tmLanguage.json');
12+
const outputPath = path.resolve(__dirname, '../src/grammars/lua-mta.tmLanguage.json');
1313

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

web/public/mta-keywords_linker.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
function extractFunctions(tmLanguage) {
1+
import tmLanguage from "../src/grammars/lua-mta.tmLanguage.json";
2+
3+
function extractFunctions() {
24
const wantedScopes = new Set([
35
"support.function.mta-shared",
46
"support.function.mta-server",
@@ -14,7 +16,9 @@ function extractFunctions(tmLanguage) {
1416
}, []) || [];
1517
}
1618

17-
function initKeywordLinker(allFunctions) {
19+
const allFunctions = new Set(extractFunctions());
20+
21+
function initKeywordLinker() {
1822
function onDomReady() {
1923
const spans = [
2024
...document.querySelectorAll(".examples-section .code-example pre code span"),
@@ -34,8 +38,4 @@ function initKeywordLinker(allFunctions) {
3438
: onDomReady();
3539
}
3640

37-
fetch('/grammars/lua-mta.tmLanguage.json')
38-
.then(response => response.json())
39-
.then(tmLanguage => {
40-
initKeywordLinker(new Set(extractFunctions(tmLanguage)));
41-
});
41+
initKeywordLinker();

0 commit comments

Comments
 (0)