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

Javascript completing after semi-colon #461

Closed
peterorum opened this issue Jan 18, 2015 · 26 comments
Closed

Javascript completing after semi-colon #461

peterorum opened this issue Jan 18, 2015 · 26 comments

Comments

@peterorum
Copy link

Hi,

Now at the end of a line (;), the auto-completer always pops up, and if I press enter as usual, I get length added. How can I stop auto-completion after a semi-colon?

Thanks,
Peter

@kzinglzy
Copy link

kzinglzy commented Jan 19, 2015

try to add this to your user setting

{
    "codeintel_live": false
}

it works for me.@peterorum

@peterorum
Copy link
Author

Thanks, @kzinglzy . That stopped the auto-completion on semi-colon. I also had to change my manual completion key as ctrl+shift+space wasn't coming up with anything. (Don't know what else it's assigned to). It also only happened on 2 or my 3 projects, so perhaps there's something not parsing appropriately. I deleted the index, but it still happened after re-indexing. Anyway, I'll see how it goes now.

@peterorum peterorum reopened this Jan 19, 2015
@Kronuz
Copy link
Member

Kronuz commented Jan 22, 2015

I can't reproduce this. Can you provide an example of code with this problem, please.

@peterorum
Copy link
Author

image

This is from the project https://github.com/peterorum/random

Thanks,
Peter

@Kronuz
Copy link
Member

Kronuz commented Jan 24, 2015

Can you try with the newest release, please? I think this is fixed. Reopen if the problem is still there.

@Kronuz Kronuz closed this as completed Jan 24, 2015
@peterorum
Copy link
Author

image

Hi,

I'm using v2.1.6, & deleted ~/.codeintel. But the issue remains.

Cheers,
Peter

@Kronuz
Copy link
Member

Kronuz commented Jan 26, 2015

Hmm, this seems to be native or fast trigger autocompletion a (SublimeCodeIntel autocomplete show the type; i.e. [function], [variable], [method]). I wonder why this is happening. In v2.1.6, fast trigger are not shown after stop characters and I believe semicolon is a stop character for JavaScript. Weird. Even worst, I can't make it fail here... even with that repo you mentioned.

@66beta
Copy link

66beta commented Jul 23, 2015

same issue with CSS

@waynedunkley
Copy link

I am experiencing the same issue (with Javascript files). I have updated SublimeCodeIntel to the latest version

@michaelgmcd
Copy link

Same issue here, using v2.2.0+st3. Tried uninstalling, deleting cache, reinstalling, removing all user settings, and still pops up on semi-colon. Love the package but this makes it unusable for me.
screen shot 2015-08-07 at 10 44 05 am

@yduman
Copy link

yduman commented Oct 3, 2015

Same issue here, using latest version on Sublime Text 3. After I press the semicolon it always pops up with some hints (see image). Anybody knows how to fix this ?
image

@ebertmi
Copy link

ebertmi commented Oct 3, 2015

Same here -.-

@zhengminhui
Copy link

I got the same problem with yduman.

@lockz
Copy link

lockz commented Jan 15, 2016

Same problem
clipboard01

@catgsmith
Copy link

Here's a workaround :
Select Package Settings > SublimeCodeIntel > Key Bindings - User, and add the following to the Default (OSX).sublime-keymap - User:

[
    { "keys": ["super+;"], "command": "insert", "args": {"characters": ";\n"} },
    { "keys": [";"], "command": "run_macro_file", "args": {"file": "Packages/User/unAutoSemiColon.sublime-macro"} }
]

Here is the file (OSX) Mac: Library>Application Support>Sublime Text 3>Packages>User>
save file unAutoSemiColon.sublime-macro:

[
    {
        "args":
        {
            "characters": ";"
        },
        "command": "insert"
    },
    {
        "args":
        {
            "by": "characters",
            "forward": false
        },
        "command": "move"
    },
    {
        "args":
        {
            "by": "characters",
            "forward": true
        },
        "command": "move"
    }
]

@richbon75
Copy link

thanks, @catgsmith - that solved the issue for me!

@anorudes
Copy link

Thanks, @catgsmith, nice idea

@Molunerfinn
Copy link

Molunerfinn commented May 6, 2016

Thanks to @catgsmith ,I find a similar way to solve this problem in Windows:
Select Package Settings > SublimeCodeIntel > Key Bindings - User, and add the following to the Default (Windows).sublime-keymap - User:
{ "keys": [";"], "command": "run_macro_file", "args": {"file": "Packages/User/unAutoSemiColon.sublime-macro"} }.
And then Select Preferences -> Browser Packages -> Users,save file unAutoSemiColon.sublime-macro:

[
    {
        "args":
        {
            "characters": ";"
        },
        "command": "insert"
    }
]

Finnally, restart your sublime and the problem will be solved~

@Rishi321
Copy link

@Molunerfinn That works great, is there a way to modify it for any characters eg, for ":" and " " (space)
I cannot find anyway to pass an argument to the macro, or take the currently added character.
Thoughts..

@zachradtka
Copy link

I am using version 2.2.0 and still have the same problem as others. Any reason this issue is not re-opened?

The workaround is great, BTW!

@evaldeslacasa
Copy link

It worked for me as well on Windows, ### BUT adding the command in Preferences -> Package Settings -> SublimeCodeIntel -> Key Bindings - Default instead of -User.

@jimmychan999
Copy link

jimmychan999 commented May 30, 2017

@Molunerfinn @catgsmith , I've done exactly what you guys told me, but it turns out that
{ "keys": [";"], "command": "run_macro_file", "args": {"file": "Packages/User/unAutoSemiColon.sublime-macro"} }
and saving the unAutoSemiColon.sublime-macro file in the indicated location wont help but will prevent me from adding semicolon anywhere. I want the semicolon to be added, just without the autocomplete suggestions popping up. Anyone could solve this?

@edyshor
Copy link

edyshor commented Jun 19, 2017

I had the same problem, a popup as soon as I typed a semicolon (see image), but I had installed a bunch of other packages, so, after I disabled "tern for sublime" the problem disappeared.

popup after semicolon

@wanradt
Copy link

wanradt commented Nov 6, 2017

I am sure, that this problem involves "tern for sublime", cause it appeared after installing it, but disabling tern is not solution I am looking for.

So "why" and "how" are still eligible questions, I think.

@sawyna
Copy link

sawyna commented May 2, 2018

@QinDynastyDragon have you seen if console gives any error when you try typing semicolon? I got the same error as you got. It was preventing me from entering semicolon. Turns out the file location path was not correct. Console clear says it's unable to read the macro.

@wanradt I have tern_for_sublime as well running and the issue got resolved for me with the macro solution proposed above.

@SystemDisc
Copy link

Add this to your settings:

  "auto_complete_selector": "meta.tag, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc - punctuation.terminator - punctuation.separator"

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