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

Scala-mode: Period key triggering autocompletion. #2702

Closed
siegelzero opened this issue Aug 19, 2015 · 7 comments
Closed

Scala-mode: Period key triggering autocompletion. #2702

siegelzero opened this issue Aug 19, 2015 · 7 comments

Comments

@siegelzero
Copy link

When the auto-completion window pops up, pressing the . key triggers completion. This doesn't happen in other major modes that I've used - only scala mode.

In a situation where you have objects foo and foobar, this can cause serious headaches. Trying to type foo.attribute is impossible, since the . key expands foo to foobar whenever foobar is at the top of the completion candidate list.

@Kethku
Copy link
Contributor

Kethku commented Aug 19, 2015

In the meantime, control g could exit the auto-completion and allow you to press . again. Agreed that its an issue though.

@chrisbarrett
Copy link

Yep, I never bothered to fix that one. I've got muscle memory at this point to just C-g out of the popup, but you could also use C-q . to just insert a period char literally.

@chrisbarrett
Copy link

I have vague recollections of Visual Studio doing the same thing so it's never really bothered me, but YMMV.

@StreakyCobra
Copy link
Contributor

Is this a Spacemacs issue, or should it be reported upstream to ??? ?

@chrisbarrett
Copy link

Yeah, it's a layer issue. The period key is bound to trigger company completions. The problem is when the company popup is already open--it gives undesired behaviour. I'll have a look at it today.

@StreakyCobra
Copy link
Contributor

Ok, I haven't look at it before. Probably removing these 3 lines should do the trick: https://github.com/syl20bnr/spacemacs/blob/develop/layers/+lang/scala/funcs.el#L94-L96

d1egoaz added a commit to d1egoaz/spacemacs that referenced this issue Nov 25, 2015
@d1egoaz
Copy link

d1egoaz commented Nov 25, 2015

I just pushed a PR fixing that because it's causing a lot of headaches as @siegelzero suggested.

Speaking of autocomplete, I'm wondering why scala/java layers are the only ones that have a function to complete with period? https://github.com/syl20bnr/spacemacs/blob/develop/layers/+lang/scala/funcs.el#L87

How are others layers using company to accomplish that behavior?

TheBB pushed a commit that referenced this issue Nov 27, 2015
d12frosted pushed a commit to d12frosted/spacemacs that referenced this issue Nov 30, 2015
d1egoaz added a commit to d1egoaz/spacemacs that referenced this issue Feb 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants