Skip to content
This repository has been archived by the owner on Dec 4, 2022. It is now read-only.

Commit

Permalink
Final touches
Browse files Browse the repository at this point in the history
  • Loading branch information
0aoq committed Oct 24, 2021
1 parent 79a30ae commit d4dd4e0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 14 deletions.
5 changes: 5 additions & 0 deletions 0aEditor.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:: Launch the editor from a .bat file
start "WebEditor" https://0aoq.github.io/?webeditor

:: exit console
exit
2 changes: 1 addition & 1 deletion app/editor/content/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ function __worker_1() {
const extensions = element.getAttribute(`data-${__isProtected()}file`).split(".")

element.addEventListener('click', () => {
// settings file
// settings file
if (window.localStorage.getItem("settings.json") == null) {
loadFile(settingsFile, "json", "settings.json", false, false, isProtected)
window.location.reload()
Expand Down
50 changes: 37 additions & 13 deletions app/editor/content/languages/lua.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,44 @@

monaco.languages.registerCompletionItemProvider("lua", { // Or any other language...
provideCompletionItems: (model, position) => {
let build = []

let keywords = [
'and',
'break',
'do',
'else',
'elseif',
'end',
'false',
'for',
'function',
'goto',
'if',
'in',
'local',
'nil',
'not',
'or',
'repeat',
'return',
'then',
'true',
'until',
'while'
]

for (let keyword of keywords) {
build.push({
label: keyword,
kind: monaco.languages.CompletionItemKind.Keyword,
insertText: keyword,
preselect: true
})
}

return {
suggestions: [{
label: "local",
kind: monaco.languages.CompletionItemKind.Keyword,
insertText: "local",
preselect: true
},
{
label: "function",
kind: monaco.languages.CompletionItemKind.Keyword,
insertText: "function",
preselect: true
},
]
suggestions: build
}
}
})

0 comments on commit d4dd4e0

Please sign in to comment.