alienhard / sublimeallautocomplete Goto Github PK
View Code? Open in Web Editor NEWExtend Sublime autocompletion to find matches in all open files of the current window
Extend Sublime autocompletion to find matches in all open files of the current window
Adding that bit from the default keymap file
{ "keys": ["tab"], "command": "commit_completion", "context":
[
{ "key": "auto_complete_visible" },
{ "key": "setting.auto_complete_commit_on_tab" }
]
}
to the end of Tabs.sublime-keymap
allows us to use tab to trigger autocomplete as well as to apply a completion when sublimetext native completion popup appears.
I came up with this because the popup still appeared althgough I had no way to pick a completion (I'm using auto_complete_commit_on_tab)
Great plugin! But if I don't know the first letter of the function or variable I'm looking for you need to start guessing. Is it possible to open autocompletion automatically, or even have it assigned to popup once CTRL+SPACE is pressed as it's normally?
For example typing "this." will not open the autocompletion, you need to type another letter after that to get the list.
is there a way to manually add files or directories to the search. I want auto completion for SDL graphics lib and respective header files, but I don't want to have to open every header file.
Lets say that I have 2 files opened - main.html and main.js.
In main.html I have an element ID that's called 'big-video'.
In the main.js file, the autocomplete would only suggest 'big', instead of 'big-video'.
I checked if an underscore works and it does, but the dash seems to be breaking the autocompletion feature.
After a couple of years of using All AutoComplete I have finally decided to look at the code carefully to see how I might explain some things I have seen over the years.
The first thing I noticed was the 20 view limit. I often have way more views open than that and I found it very confusing when some things completed but others did not. Also I saw the code that works around a "sublime bug" relating to words that are missing the last letter, or other words that just don't show up at all.
So I decided to write my own all autocomplete as part of the sublemacspro plugin with the following properties:
This is a different approach (not using view.extract_completions) but I have found it to be more to my liking. Shall I try to apply what I've learned and issue a pull request, or does this sound like too much of a departure?
Commoooooonn, really ,it's just wrong........... -___-
Hi,
I have my sublime customized autocomplete and sublime default autocomplete. They work great. Now I have this tabs related autocomplete, great too.
One problem, allAutoComplete will suggest what I already had by default, in a different way.
I normally have completion like console.log($0)
, what I do is I press con
+ tab
to get that.
Now when I do that, I get console.log
or console
. You can see there is missing ()
I understand this plugin will suggest keyword using indexing from open tabs. Now if you could teach the plugin to ignore the autocompletes already in in the system, don't try to suggest that. It will awesome.
When I start typing with a dot to write a class, the autocomplete doesn't kick in, I have to force it manually with ctrl+space. But if instead, I start writing the name of the class, without the dot, it works normally.
I'm in ST3 build 3047. (When I was in ST2 this worked normally)
If I have a string "FORMAT_JSON" in one open file, and type lowercase "format" in another file, the uppercased "FORMAT_JSON" is not showing in suggestion list.
I love this plugin for all my coding, but it really gets in the way when I'm writing.
Whenever I want to indent a hyphen list like…
- A
- B
- C
… I end ud with something like this…
- A
- B
--verbose C
I tried disabling All Autocomplete for Markdown and Plain Text documents:
{
"exclude_from_completion": [
"md",
"txt"
]
}
I also tried using the Syntax Names ("Plain Text", etc.), but I still get the lovely autocompletion.
Am I doing something wrong here?
Example code
def name
# ...
end
When typing def name
, there's no autocomplete when i write the first letter n
:(
Your project doesn't have a license, you should consider adding one, and preferably not a bad one like GPLv3 ;)
Great package.
Any auto completeion for switch statements?
If so how can i add it manually?
Hi,
I do web development; when it makes sense, I put images in CSS encoded with base64. SublimeAllAutocomplete picks up these (usually very long) strings. This causes a significant slowdown.
How can I set the maximum length of characters that SublimeAllAutocomplete will autocomplete?
Thanks in advance!
Martin
I have performance issue after several minutes of working with ST3. After module disabling and ST fully restarted, issues leave off. In work I can open many JavaScript files.
I'm using ST on my MacMini, but with more powerfull machine under Ubuntu I have not this problem with many files.
I really like this plugin but I can't use it because it breaks the AdvancedNewFile plugin.
Without AllAutocomplete, AdvancedNewFile autocompletes based on my folder structure and is really fast an efficient for creating new files.
When I enable AllAutocomplete, AdvancedNewFile uses all the files that are open to autocomplete and is impossible to create a file in the folder I want without typing the whole path. This makes the AllAutocomplete plugin useless for me as my directory structure can be deep and I don't want to type out all the directories.
AllAutocomplete should only work in the code your working on. Not outside inputs.
This plugin works great for most things. I like it. 👍
However, in CSS (or SCSS) files I prefer sublime's own auto-completion because it recognizes keywords, inserts colons, spaces and semicolons.
Sublime's options are still available, but they aren't the ones first selected so you would need to scroll down.
/* · = space */
/* | = cursor */
/* CSS keywords */
padding| /* AllAutoComplete */
padding:·| /* Sublime built in completion */
/* CSS values */
padding:·inherit| /* AllAutoComplete */
padding:·inherit;| /* Sublime built in completion */
Unfortunately it's not working for me, I've tried these keywords: allautocomplete, autocomplate, sublimeautocomplete
I've installed from git...
I have the all autocomplete plugin installed
I type in $sc and press tab or enter to choose "$scope" from the suggestions, the characters that I typed in simply get erased.
So far this is the only variable that this happens w/, it works fine all other words.
These are my installed packages beyond the defaults:
{ "auto_upgrade_last_run": null, "installed_packages": [ "Alignment", "All Autocomplete", "AngularJS", "BracketHighlighter", "Color Highlighter", "ColorPicker", "DocBlockr", "Git", "HTML5", "Indent XML", "Markdown Preview", "Package Control", "Phpcs", "Pretty JSON", "sublime-github", "Sublime-HTMLPrettify", "SublimeCodeIntel", "SublimeLinter", "Theme - Soda", "Web Inspector", "xmllint" ] }
I'm using ST 2.0.2 on OSX 10.8.4
Suggestions?
I have a trouble with this plugin (AllAutocomplete). When i write in my CSS file some emmet alias, like "dib" and press a tab key, i get some words from my files, but not required property. Can i create some settings to your plugin for press some else button for call plugin work? Or maybe you know better solution. I am very grateful for the help.
While it incudes autocompletions from .sublime-snippet files in the list, it does not do this for .sublime-completions files. Would be nice to address this.
completely not working with ST3 Dev Channel, Build 3053
This is really strange bug, and requires a bit strange sequence to reproduce. And probably it's a conflict with some other plugin, but here it is:
If you have 2 files: one_file_with.html
and another_one_with.coffee
script
in html file put: stc.someVar
in coffee file: @somevar
now when you are in coffee file and type @som
you only get suggestion for stc.someVar
and not @someVar
... I got really annoyed by this because it would not suggest a variable from current file.
SublimeText3 on Ubuntu 16.04
Here's an example: I have an HTML file open and a CSS file that it links to. If I add a class to the body tag, AllAutocomplete will return all class names from the open CSS file. But, if I create an anchor and try the same, not all class names will be returned - sometimes none of the class names will appear at all. It seems that only certain entities will return all the class names.
Just as if we are develop Python code, we can specify *.py file to be scanned. So that can filter some file we don't want to included.
The plugin works fine with ST3, mentioning Sublime Text 2 in the description is a bit misleading.
It would seem this plugin overrides php autocomplete from CodeIntel. For example, if I type "in_array" I will be given the autocomplete. I press enter, but do not get the variables. If I backspace part of the function name, I then get two autocomplete suggestions, the second being the one I actually want.
Maybe it could be set so autocomplete is never overriden from other already set autocomplete items? Sorry I don't have time to delve into the code to look at making a pull request right now.
Thanks in advance for your work on this plugin =]
Hi!
I seem to have a problem, where the autosuggest does not include words from the active tab - only all others.
I tried changing
views = [v for v in sublime.active_window().views() if v.id() != view.id()]
to
views = [v for v in sublime.active_window().views()]
and it seems to solve the problem. But as I have no experience with neither Python nor Sublime plugin development, I don't know if this is a good idea or not.
I found a (strange) issue in using this plugin.
Without the plugin, this is the autocomplete shown by ST3:
When "All Autocomplete" is active, this is the list of suggestions shown:
In here, the problem for me is that the item "IfxScuEru_InputChannel_4", which is what I meant to write, is missing.
The strange behaviour is this: with the plugin, pressing CTRL+Space shows this list (different from above, and the missing item is now there!!)
Today, whenever I am typing in Sublime Text 2 the program hangs turns dark grey with the text I am inputting not visible on the screen. When I stop typing and wait patiently, the text will eventually appear again. I watched the CPU activity while typing and it would jump up to 95%+ until it calmed down again. This appears to be caused by the All Autocomplete package - when I uninstall it, ST2 works fine, and when I reinstall it, the problem returns.
If I have "FooBar" specified in in my sublime-completions file and I have "FoorBarSomeText" that exists thecurrently open file, the completion "FooBar" will not even show up in the completions list.
If I uninstall All Autocompletions, both entries properly show up, and the proper priority is given to "Foobar" first, and then to "FooBarSomeText".
I'm running build 3065 on Linux (elementary OS 0.2) and I can't seem to get this package to work.
I type and nothing happens, I'm not even sure how this package should work because I see nothing.
Other packages installed:
Still not work. I have latest version SublimeAllAutocomplete.
Helps only the removal dash from settings sublime - word_separator (Which is not quite right.)
Solution? Thx.
Hey there,
Will this work with Sublime Text 3? I tried installing it via package control, but couldn't find it. Assuming it's because Package Control filters out stuff that isn't supported on your platform.
If not, can I help port it to ST3? I really want this feature!
Missing in Package Control (ST3)
could you makeup a usage to complete the matching string in the files under all the open folder.:)
We've split our Sass into multiple files; one of the files contains all our variables. The variables look like this $variable-name-example
. Unfortunately dashes seam to be a problem currently.
Testcase:
$button-color-secondary: #f00 /* will auto complete only the word $button */
$button_color_main: #0f0 /* works as expected */
Thank you for your plugin, Adrian. Keep up the good work.
I can't find any Extension like this, can you port to Visual Studio Code please!!!
This plugin is great. What would make it greater is to add auto complete for all files in a project (not just those open in the window)
To reproduce you must change settings parameter word_separators
and remove character $
there, like this (in Preferences.sublime-settings
):
"word_separators": "./\\()\"'-:,.;<>~!@%^&*|+=[]{}`~?",
After that create new file with the following content:
<?php
$test = 'aaaaa'
and try to auto-complete word $test
there, you should fail, word just disappears.
It looks like somethere inside sublimetext character $
treated as something special (incorrect regexp generation maybe) so if returned value from on_query_completions
starts with $
it will break the completion.
A trie style datastructure would be great for improving the efficiency. a ~1s pause when typing any word in a file is not ideal, and it hardly takes more than 20k lines of opened files to cause this.
It looks like an O(n^2) approach is used (bad!!) and the hard limits placed on number of words and number of views is basically the only factor that is limiting the pause to around 1s.
Is it possible to autocomplete not only open tabs, but autocomplete from any file in Sublime project folder?
It would be great if it was possible to exclude some path / drive from the search (for empty drives, like SD readers etc. checking for file names will cause a "No Disk" error!)
thx,
,m
Thanks.
Best regards
Hi, would it be possible to add support for syntax exclusions? So that for example I can disable completions in javascript or css? Thank you.
I got strange issue -- some words in two variants in list like "is_owne" and "is_owner"
and i am sure there is no "is_owne" in my project.)
Do you know what it could be?
Hello
With the new SublimeText Build 2221, the automatically opening Autocomple-dropdown does not include the AllAutomplete results. I need to close it with [esc], and reopen it with [ctrl-space] to get them.
Thanks for help
I get the following backtrace when using SublimeAllAutocomplete with the new Sublime Text 3 beta:
Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 238, in on_query_completions
res = callback.on_query_completions(v, prefix, locations)
File "/home/rrerolle/.config/sublime-text-3/Packages/SublimeAllAutocomplete/all_views_completions.py", line 23, in on_query_completions
views = set(views[0:MAX_VIEWS])
TypeError: unhashable type: 'View'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.