-
Notifications
You must be signed in to change notification settings - Fork 40
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
Features from Atom: Improve hints and search while typing #5457
Comments
ST has those completion but somehow they have to be triggered manually in your provided context. Update: Oh... it turns out that when the view is empty, the top scope is not |
Just typing ST just doesn't bother you with a completion panel with just one item.
Same here, just type Whether auto-completion panel is triggered while typing or not depends on Completion panel can be enabled in HTML code by ... "auto_complete_selector": "meta.tag, text.html, source - comment - string", ... which ends up with
ST shipps various snippets out of the box, but as those are often part of personal taste with mixed feedback about their presence its unlikely more of them will be added. You can always and easily add more if needed by either looking for snippet related packages on https://packagecontrol.io/ or crafing your own. (HOWTO: https://docs.sublimetext.io/guide/extensibility/snippets.html)
Auto completions use indexed variables to add kind info, but only for tokens which already exist in current buffer. It's controlled via The main argument for not doing more (listing all relevant tokens from index, ...) have always been performance. The best option to get well IntelliSense like completions is LSP and corresponding language specific helper packages (e.g. LSP-typescript at the moment. |
Good to know that Sublime makes the completion hitting the tab, but this is not very user friendly. One have to be aware early that the editor has such suggestions. For new users who does not know, it's more like a trial and error. I prefer the panel is always shown, even with one item.
Crafting my own snippet is a very good feature I'd like to try.
I don't get it. Are you saying the search is limited to variables and functions in the current file only because of performance reasons? That's unfortunate because Atom can search everything out of the box even if it's an IDE written in Javascript on Electron. Anyway if I set
I suppose I would be able to search in comments, but it's still not working. |
I can't remember of any discussions about gathering completions from different open files, but core devs argued not to use indexed symbols is for performance reasons, yes. It has to do with the quite generic approach of indexing tokens and the lag of deep knowledge about semantics. Lists of completions would therefore probably be huge in larger projects with lots of false positives and/or noice. I am not too happy with it, too, but LSP is a good alternative most of the time.
Sublime Text users have much higher expectations with regards to speed and snappiness than any Electron app could ever deliver. Waiting more than 100ms for results is often unnaccepted and ends up in heavy discussions. ST is not an IDE either. It calls itself a code editor.
Nope. It just controls when auto completion panel is displayed automatically while typing. What words are picked up from buffer is fully up to ST. I am not aware of any possibility to tweak that behavior, but comments and strings are handled special in many ways. |
Word completions can be used by disabling index-based completions, see the
Index-based completions provide this feature. It works on a project-basis by indexing all your files in order to provide context-relevant completions. We use issues for tracking specific features, so this kind of "wishlist" issue hampers that. As such I'm going to close it. If you have any more specific feature requests please post them as separate issues. |
My every day experience with index based completions is the following: Completions pickup kind info from index, but I haven't seen any words being provided by index unless that word already exists in current buffer. Means, "my_func" is only provided as completion if it already exists in current view/buffer (like word completions). If it is found in index, completions also display kind info. I've never seen ST suggesting words from other open files (or index), which don't already exist in current buffer. I am pretty sure jps called that working as expected due to performance considerations at some point during ST4 dev cycle. The way ST currently seems to pick random completions from index is one of the biggest show stoppers of this function, IMHO. Note: I rely on ST's completions/goto.../ in my every day work as there are no other tools which support the CNC/PLC sources I work with. So I am faced with its limitations often. To proof that, have a look at the following screencast.
Depending on size of source and already used tokens it results in a pretty random picking completions experience! Related with #5041 |
@deathaxe I can't reproduce this, I'm definitely getting suggestions from other files in the project in a new unsaved file. |
Certainly not until the same word exists in current file. (Actually, current view being unsaved or representing a file doesn't really matter) Maybe there's something wrong with my package, but I've seen exact same behavior in other languages as well. Steps to reproduce:
And this is what everyone calls a bug, because it is expected to see suggestions for all global symbols, not just those which already exist in current buffer. It should probably be posible to specify selectors for which symbols to suggest from index, because in a multi-language project I probably don't want to see suggestions from JavaScript in a PLC cylce, but maybe CSS classes in HTML or vice versa. At least an API end point to query index for various aspects such as selectors, kinds, etc. to be able to write custom completion plugins leveraging ST's index. A build-in configuration based solution would however perform way more performant, I guess. We'd just need a wy to express relationships. |
Problem description
Since Atom sunset, I'm looking for an alternative. Unfortunately there's none at the moment. Anyway as I shared on vscode issue tracker, I'd like to report here what can be implemented in Sublime to get it better and maybe be an option for me and others in the future.
Sublime does not:
Suggest php tags
Suggest php contidional syntax. Not the simple
if ()
, but the conditional statements that can mixed with HTML code.Hint words from any part of the code, like comments, not only variables and function names.
Suggest class syntax for Javascript
Search also in other opened files, not only in the current one. Maybe also in other languages, but just showing hints from other opened files of the same language would be a good starting point. VS Code is supposed to have an option to do that, but it's currently broken and don't work. When I gave a look into Sublime configurations, didn't find something similar.
Preferred solution
Implement the features shown above already available in Atom, if they're really missing.
If I'm wrong and the same result can be achieved in Sublime, please explain. Thanks.
Alternatives
Using Atom at the moment.
Additional Information
No response
The text was updated successfully, but these errors were encountered: