Open josecanciani opened 9 years ago
You can do the menu modification already with is_visible
or is_enabled
callbacks in the referenced command's class.
I don't understand what you mean with "refresh triggers".
If we're collecting ideas for a sidebar API, I propose the ability to create a sidebar (and sidebar items) entirely by plugin code. For example a virtual SFTP file tree or a code outline.
See also http://www.sublimetext.com/forum/viewtopic.php?f=2&t=17470&p=65484&hilit=sidebar#p65484 and http://www.sublimetext.com/forum/viewtopic.php?f=2&t=17470&p=65775&hilit=sidebar#p65775.
Thanks for your comments. By "refresh triggers" I meant to be able to listen when things change in the side bar. Sublime listens for changes in the directories you are showing, so if I have a plugin that colourize a file, I would like that new files appearing in the sidebar are also colourized properly. So a listener would allow my plugin to "redraw" or "theme" it even if it's a new item.
Can you explain or provide a link to the is_visible/is_enabled callbacks you mention? What kind of modification can already be done? I have only found tmThemes that allow some kind of visual manipulation of the file list in the sidebar, but I yet have to found a programmatic approach to it.
Refresh triggers would then be something similar to https://github.com/SublimeTextIssues/Core/issues/626.
It's kind of a mixed thing. You add the menu item as you do normally, via Sidebar.sublime-menu
, and then specify a command name. In the command's class you then define an is_visible
method that is called (with all parameters, notably files
) and should return a boolean.
You can find an example in Default/open_context_url.py
, except that this is in the general context menu.
Related: Issue #328 - Sidebar Sort Options
+1 for Style items to allow Git integration showing modified files and folders.
Git integration on the sidebar would be great
Styling items for Git integration is extremely appreciated.
i hope you can get the sidebar api into the latest release soon.
This needs to be implemented! it would be great!
+1 👍 Only thing missing from my Sublime Text setup :)
I can count 3 or 4 fellow devs who've asked how I cope without it - would make a huge difference!
Well, we are on sublime text 3 and I thought that maybe this feature would be already implemented =/
Is it so hard to do it?
As with others who have posted, the lack of any feedback on file change status on the sidebar (i.e., an api to support such features) is a major drawback that I've been working around since switching to sublime several years ago. Is there any intention of putting this on the roadmap? It would be good to know one way or the other so folks can assess whether it is worth it to continue living with it or seek out alternatives.
@wbond Are you there buddy? I just updated to version 3.1 and I expected that including theme changes you could have done something about that too, can we help and be able to code it ourselves? Is there any date we can expect this to be implemented?
I am here, and I am just as interested as you are for a sidebar API. We definitely have some plans for some good stuff coming up, and I will certainly update this issue when there is more info about the sidebar.
A lot of the work in this dev cycle went into making some core elements of the editor more polished so that we can set the stage for some bigger changes. We didn't want to keep adding new things on top of a base that needed some foundational work.
Awesome @wbond. That is like that one thing missing from ST that would make it perfect.
+1
3181 added git status indicators to the sidebar.
There is no API yet, however.
I'm waiting for this for a long time, I think it's been 2, almost 3 years, I hope it comes with next update!
I downloaded the beta to check it out. Here's what it looks like as of Build 3183.
Git ignored files have lighter text. Unstaged files have an empty circle next to it, and modified files have a blur filled circle next to it.
Default Theme
Adaptive Theme
Just a question about the beta, any anotation about deletion, or creation?
In advance, it looks awesome!
Now testing Build 3184
It seems there is a difference between "added" and "modified", however I appear to have run into a bug though.
If you only have "Modified / Staged" and "Added", it'll show "Added" correctly as green. However if you also stage a git removed file, it'll treat it the added file as just "Staged".
However if you have staged a "removed" file in the folder, it will treat it as "Staged".
Build 3184 mentions "Improved visualization of ignored files" but I don't see any difference from my previous screenshots.
+1 for an API to resolve the following
https://forum.sublimetext.com/t/are-unique-folder-icons-possible-for-specific-folders/41455/2
A sidebar API would be unlikely to modify existing functionality of the Folder tree. Instead, it is more likely there would be the ability to create a custom tree. We would possibly allow providing VCS statuses for non-Git version control systems.
@wbond since we're bringing the sidebar, would you add the ability to move files with drag and drop, that would be very appreciated.
@AmjadHD we have a separate issue for that: https://github.com/SublimeTextIssues/Core/issues/16
I'm working on a build system and I'd like to integrate it into Sublime. It would be really useful to me if there was a sidebar API with the following features:
Ability to customize items, similar to the newly introduced git integration: de-emphasize items, add badges.
Custom data providers for the sidebar. I would use this to display build targets which can be expanded to show their dependency trees. If the default filesystem provider is made public, plug-ins can also derive from it to implement filtered views (e.g. remove files which do not participate in the build, or add entries for source controlled but locally deleted files). Data providers should also be able to style the items they output (and customizations are applied on top of that).
Multiple sidebar tabs, each with its own data provider (similar to the solution explorer/resource view/class view in Visual Studio).
Point 1 may be a bit tricky in case multiple plug-ins want to customize the same item (e.g. the git integration and my build system). Maybe plug-ins should only be allowed to add badges (but you can end up with 15 badges per item), or only one customization plug-in can be active at a given time (but then you need to allow the user to pick), or you just hope plug-in writers will pick non-conflicting customizations (yeah, right).
Please? :)
The reasons, I would like a sidebar API, are:
Having an input for filtering expressions, would also be cool.
It's really the item I am most missing from Sublime Text (the other ones being dialogs for plugins (good for defining presets/ passing values in complex build scenarios) and a bottom pane, that could show live documentation, relative to the expression under the cursor, like function signatures). So, kudos for considering it! Very much appreciated!
@wbond I was looking for Sidebar API on the sublime forum and end up getting here. Looking forward for implementing something like this. whether it is possible in sublime ?
@Ajinkz Though he said https://github.com/SublimeTextIssues/Core/issues/867#issuecomment-456092599. But now, no.
I'd love to be able to add arbitrary trees to the sidebar. Any traction on this one?
A good addition would be to allow plugins to create their commands that work on sidebar items, without triggering the sidebar menu, possibly binding it to a key. For that a sidebar_focused
context should be added.
e.g backspace
(or delete
) key bound to a delete_file
command, deletes the selected files.
I would really like to see at least a simple API where plugins (particularly LSP) can display an icon at least. The only thing I (personally) need so I can use ST almost full time is for files that LSP says have errors to display a red dot next to their names in the sidebar - this is super duper incredibly handy for doing refactoring work.
Yea. Me too.
That's why I left ST for visual studio code a long time ago. I still miss sublime. It was a lot faster. But some features just stuck over time and I was tired trying to wait for them to release it....
Em seg., 2 de mai. de 2022 08:10, Luke Jones @.***> escreveu:
I would really like to see at least a simple API where plugins (particularly LSP) can display an icon at least. The only thing I (personally) need so I can use ST almost full time is for files that LSP says have errors to display a red dot next to their names in the sidebar - this is super duper incredibly handy for doing refactoring work.
— Reply to this email directly, view it on GitHub https://github.com/sublimehq/sublime_text/issues/867#issuecomment-1114731044, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP6KHUDEHMTQY4PLT3C56DVH6ZYZANCNFSM4BGMBQKQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I keep coming back to ST4 because VSCode is terrible on Wayland. And then leaving because it becomes too difficult to track a multi-file error.
I know there are several sidebar related issues opened, but I could not find any related specifically to an API.
I'll be glad to maintain a list of features we would like for a Sidebar API here. Here is a short list with my own:
Thanks!