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

vscode support #23

Open
erenseymen opened this issue Apr 19, 2021 · 4 comments
Open

vscode support #23

erenseymen opened this issue Apr 19, 2021 · 4 comments
Labels

Comments

@erenseymen
Copy link

Visual Studio Code doesn't show file history. Can you please add? Specifically, if we are able to access last workspaces in right click menu, it'll be much appreciated.

@maoschanz
Copy link
Owner

This extension doesn't support specific apps*, it's a very generic code which takes all recently opened files as identified by the GTK library (same list you'd get in the "recent" page of file choosers, or in nautilus "recent" view) and it filters these files according to what file types an app launcher says it can handle

if an app declares incorrect or incomplete types (e.g. Gedit doesn't declare markdown files) you can report it to its devs or edit the app launcher (.desktop file) manually to add new types

But in the case of VSCode, it isn't about opening a "classic" file, but opening a folder.

  • I doubt the folder is marked as recently opened by GTK, since IDEs tend to manage your list of projects internally
  • even if GTK knows it has been opened, the extension couldn't distinguish a folder from VSCode and one from an other app

so this kind of feature would require that the extension knows how VSCode works internally to get the list, and it isn't realistically possible to do that for all IDEs, i don't even do this for GNOME Builder. So sorry, i think this isn't possible at all.


If all your projects have a common parent folder (some ~/Code/ or ~/Projects/ or ~/VSCode/ directory) i could make it a setting and the extension would dumbly enumerate every folder in it? But even this would be a complex feature, some IDEs require CLI options to open the folder as a project workspace (-p for Builder for example)


*it does something different for a handful of apps like file managers, but even then it's reading the very generic GTK bookmarks that are in the same config file for most file managers

@erenseymen
Copy link
Author

Thanks for explaining.

I don't need folder matching. I need workspace file matching.

I want to be able to see .code-workspace files in VSCode's right click menu. I opened this type of files from Nautilus (VSCode is the default app) and I can see the files in "recent view" of Nautilus as you mentioned.

image

Unfortunately, quicklists extension doesn't give me "recent files" for .code-workspace type.

or edit the app launcher (.desktop file) manually to add new types

VSCode's desktop file (/usr/share/applications/code.desktop) includes below line:
MimeType=text/plain;inode/directory;application/x-code-workspace;

So, I added below to my ~/.config/mimeapps.list file (and restarted my pc), opened a .code-workspace file, but no luck again.
application/x-code-workspace=code.desktop

Here's code.desktop file:
code.desktop.txt

Another thing is that if I right-click to Spotify shortcut, it tells me "No recent file for this app".
image

But VSCode doesn't:
image

@maoschanz
Copy link
Owner

This special mime type is perfect, it's exactly what's needed for this extension, so it should be able to work...

maybe that line https://github.com/maoschanz/quicklists-gnome-shell-extension/blob/master/quicklists%40maestroschan.fr/content_loaders/recentFiles.js#L23 is incorrect, iirc a few apps don't open URIs but only paths, i don't remember the reason why i only support URIs

i'll install vscode tomorrow, i think i need to see the complete desktop file and experiment with it, i'll tell you if i find anything

@maoschanz maoschanz added the bug label Apr 20, 2021
@erenseymen
Copy link
Author

erenseymen commented Apr 20, 2021

Thanks for the hint. I changed %F to %U in code.desktop file and it worked.

image

Now, I'm also wondering why you intentionally only support URIs :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants