Skip to content
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

ACE Editor Autocomplete to open on . #3690

Closed
ktalebian opened this issue Jun 21, 2018 · 3 comments
Closed

ACE Editor Autocomplete to open on . #3690

ktalebian opened this issue Jun 21, 2018 · 3 comments

Comments

@ktalebian
Copy link

If you enable live autocomplete, the tooltip opens up as you type things. However, it will never open up on pressing . until you type something else after.

So if I were to type fo there will be a tooltip trying to match fo to something (for or function, etc). However, if type fo. then the tooltip disappears, and it will not open until I type a further letter.

I have custom autocompletion keys, and I really want the tooltip to open up with all my suggestions.

Let's say I have user as a special key with name, age, profile as the suggestions. I want to be able to type event. and the tooltip to show name, age, profile. Right now, I have to type event.n for example to get name to show as a suggestion

@maxHoo
Copy link

maxHoo commented Aug 8, 2018

I am in the similar situation for a long time and made many posts, but still get no answer yet. It seems except modify source code, cannot solve this problem.

I hope it can set different identifier-cut to each custom autocomplete function. But when using live autocomplete, the prefix will not update until the string ends or it has no match. For example, type "cat." the prefix is "c", but actually I want detect "cat" end with "."

@github-actions
Copy link

github-actions bot commented May 9, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@mkslanc
Copy link
Contributor

mkslanc commented Jun 22, 2024

Fixed by #5147 . To use this feature you just need to register completer with triggerCharacters similar to

 editor.completers = [
            {
                getCompletions: function (editor, session, pos, prefix, callback) {
                    var completions = [
                        {
                            caption: "append",
                            value: "append"
                        }, {
                            caption: "all",
                            value: "all"
                        }
                    ];
                    callback(null, completions);
                },
                triggerCharacters: ["."]
            }
        ];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants