-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request - live autocomplete #5
Comments
Do you want to have a capability to activate the following options: |
I've released |
I'm running your example but don't get autocompletion. I have an example that I have to port to Elm and it's initiated like below. It sends completion request to the RServe: var langTools = ace.require("ace/ext/language_tools");
var pre_process = ace.edit('pre_process');
pre_process.setTheme('ace/theme/crimson_editor');
pre_process.getSession().setMode('ace/mode/r');
pre_process.setOptions({
enableBasicAutocompletion: true
, enableLiveAutocompletion: true
});
var Rcompleter = {getCompletions: getCompletions}
langTools.addCompleter(Rcompleter);
function getCompletions(editor, session, pos, prefix, callback) {
console.log("POS: " + JSON.stringify(pos) + " prefix: " + prefix);
if (prefix.length === 0) {
let range = {
start: {
row: pos.row,
column: 0
},
end: {
row: pos.row,
column: pos.column
}
}
prefix = editor.session.getTextRange(range);
if (prefix.length === 0) {
callback(null, []);
return;
}
}
var completionObj = {
"rserveHost": $('#rserveHost').val() || "localhost",
"rservePort": $('#rservePort').val() || 6311,
"prefix": prefix,
"pos": pos.column
};
console.log("completionObj: " + JSON.stringify(completionObj));
$.post( '/rserveCommand/completion', completionObj)
.done(function( data ) {
console.log("in done");
if (data.cmdList && data.cmdList !== null) {
callback(null, data.cmdList.map(function(val) {
return {caption: val, value: val}
}));
}
if (data.err)
console.log("ERROR: \n" + data.err);
}).fail(function(xhr) {
console.log("ERROR: \n" + JSON.stringify(xhr));
});
} |
You use custom code completion feature. I need to think how to implement it with Elm. |
On every keystroke or |
Resonable. I will take this into account in the implementation. |
Could you please let me know the status of this feature ? |
It would be nice to have it. I still hasn't learned elm native to make pull request though.
The text was updated successfully, but these errors were encountered: