CODE COMPLETION
Hey guys, I wanted to implement the code completion. The basics didnt sound crazy to implement.
Add:
@editor.getSession().setOptions
tabSize: 2
useSoftTabs: true
useWorker: false # disables lua autocorrection ; preserves syntax coloring
enableBasicAutocompletion: true
enableSnippets: true
enableLiveAutocompletion: true
but -> not working
So I was asking Copilot, GPT and found some Stackoverflow answers (https://stackoverflow.com/questions/13545433/autocompletion-in-ace-editor)
The main things always said:
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ext-language_tools.js"></script>
(Copilot/GPT)require('ace/ext/language_tools');
(Stack)<script src="ace/ext-language_tools.js"></script>;
(Stack)<script src="ace/ext-language_tools.js"></script>;
(Stack)
-> Changes have to be inside the HTML (-> here I was lost, bc microscript uses pugs mostly)
unfortunatly, I'm not too deep into the microscript code. I hope some of u guys can fix the error.
Addive "cool to know": You can create own variables for codeCompletion
enableBasicAutocompletion: [{
getCompletions: (editor, session, pos, prefix, callback) => {
// note, won't fire if caret is at a word that does not have these letters
callback(null, [
{value: 'hello', score: 1, meta: 'some comment'},
{value: 'world', score: 2, meta: 'some other comment'},
]);
},
}],