Coder Social home page Coder Social logo

brpaz / ulauncher-vscode-projects Goto Github PK

View Code? Open in Web Editor NEW
44.0 3.0 15.0 1.97 MB

Integrates with VSCode Project Manager extension allowing you to open your projects from anywhere using Ulauncher

Home Page: https://ext.ulauncher.io/-/github-brpaz-ulauncher-vscode-projects

License: MIT License

Makefile 10.79% Python 89.21%
ulauncher ulauncher-extension vscode

ulauncher-vscode-projects's Introduction

Ulauncher VSCode Projects Extension

Ulauncher extension that allows you to quickly open your VSCode projects, either managed by [VSCode Project Manager] (https://github.com/alefragnani/vscode-project-manager) extension or from VSCode Recent workspaces.

Ulauncher Extension CI Status License

Demo

demo

Requirements

  • Ulauncher 5
  • Python 3
  • Visual Studio Code
  • Project Manager extension, if you want to use it. otherwise you can configure the extension to look only to the VSCode workspaces.

Install

You must install the following Python packages required by this extension. You can run the following command in the terminal:

pip install --user memoization==0.4.0

In some Operating systems, you might have to run pip3 instead of pip

Open ulauncher preferences window -> extensions -> add extension and paste the following url:

https://github.com/brpaz/ulauncher-vscode-projects

Usage

Type vsp into ulauncher input, to trigger this extension. You can optionally keep typing to filter the projects list.

Project Manager managed projects will appear with the "briefcase" icon, while "Recent workspaces" will have a dark VSCode icon.

If you want to only see projects from one of these sources, you can configure it in the extension settings.

Extension Settings

Name Description Default value
Config path The path to VSCode's config folder. You can change this value if to point to your Codium install for example. ~/.config/Code/
Projects File path The location of of projects file cache created by Project Manager VSCode Extension "~/.config/Code/User/globalStorage/alefragnani.project-manager/
VS Code executable path The path to the VSCode executable. You might want to change is if using Codium or VSCode from Flatpa code
Include recent workspaces "When to include recent workspaces true
Include project manager projects Include projects from the Project Manager extension true

Development

git clone https://github.com/brpaz/vscode-projects
make link

The make link command will symlink the cloned repo into the appropriate location on the ulauncher extensions folder.

The make link command will symlink the cloned repo into the appropriate location on the ulauncher extensions folder.

To see your changes, stop ulauncher and run it from the command line with: make dev.

The output will display something like this:

2020-11-15 10:24:16,869 | WARNING | ulauncher.api.server.ExtensionRunner: _run_process() | VERBOSE=1 ULAUNCHER_WS_API=ws://127.0.0.1:5054/ulauncher-vscode-projects PYTHONPATH=/usr/lib/python3.8/site-packages /usr/bin/python3 /home/bruno/.local/share/ulauncher/extensions/ulauncher-vscode-projects/main.py

Open another terminal window and execute the command displayed, "starting at VERBOSE=1". This will activate the extension.

To see your changes, CTRL+C the previous command and run it again to refresh.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ’› Support the project

If this project was useful to you in some form, I would be glad to have your support. It will help to keep the project alive and to have more time to work on Open Source.

The sinplest form of support is to give a โญ๏ธ to this repo.

You can also contribute with GitHub Sponsors.

GitHub Sponsors

Or if you prefer a one time donation to the project, you can simple:

Buy Me A Coffee

Author

๐Ÿ‘ค Bruno Paz

License

Copywright @ 2019 Bruno Paz

This project is MIT Licensed.

ulauncher-vscode-projects's People

Contributors

brpaz avatar chrisgavin avatar evilhamsterman avatar feitosa-daniel avatar jamespotz avatar therj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ulauncher-vscode-projects's Issues

Stuck on loading

Unfortunately the extension is still stuck on loading ๐Ÿ˜ข

May 16 18:45:35 Kuba-PC ulauncher.desktop[32134]: Traceback (most recent call last):
May 16 18:45:35 Kuba-PC ulauncher.desktop[32134]:   File "/usr/lib/python2.7/dist-packages/ulauncher/api/client/Client.py", line 52, in on_message
May 16 18:45:35 Kuba-PC ulauncher.desktop[32134]:     self.extension.trigger_event(event)
May 16 18:45:35 Kuba-PC ulauncher.desktop[32134]:   File "/usr/lib/python2.7/dist-packages/ulauncher/api/client/Extension.py", line 52, in trigger_event
May 16 18:45:35 Kuba-PC ulauncher.desktop[32134]:     action = listener.on_event(event, self)
May 16 18:45:35 Kuba-PC ulauncher.desktop[32134]:   File "/home/jsarnowski/.cache/ulauncher_cache/extensions/com.github.brpaz.ulauncher-vscode-projects/main.py", line 57, in on_event
May 16 18:45:35 Kuba-PC ulauncher.desktop[32134]:     description=project['rootPath'],
May 16 18:45:35 Kuba-PC ulauncher.desktop[32134]: KeyError: 'rootPath'

Settings giving a KeyError

Having my settings like this:

image

I'm getting this error:

Message: 'com.github.brpaz.ulauncher-vscode-projects'
Error Name: UnhandledError
Type: KeyError

Stacktrace:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py", line 198, in on_scheme_callback
    resp = rt.dispatch(self, scheme_request.get_uri())
  File "/usr/lib/python3.9/site-packages/ulauncher/utils/Router.py", line 49, in dispatch
    return callback(context, url_params)
  File "/usr/lib/python3.9/site-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py", line 444, in prefs_extension_update_prefs
    controller = ExtensionServer.get_instance().get_controller(ext_id)
  File "/usr/lib/python3.9/site-packages/ulauncher/api/server/ExtensionServer.py", line 76, in get_controller
    return self.controllers[extension_id]
KeyError: 'com.github.brpaz.ulauncher-vscode-projects'

I tried escaping the spaces on the paths like so
~/.config/Code\ -\ OSS/ but no luck.

can't add addon

Hello i would like to install the addon but i get this error.

`Message: 'com.github.brpaz.ulauncher-vscode-projects'
Error Name: UnhandledError
Type: KeyError

Stacktrace:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py", line 198, in on_scheme_callback
    resp = rt.dispatch(self, scheme_request.get_uri())
  File "/usr/lib/python3/dist-packages/ulauncher/utils/Router.py", line 49, in dispatch
    return callback(context, url_params)
  File "/usr/lib/python3/dist-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py", line 444, in prefs_extension_update_prefs
    controller = ExtensionServer.get_instance().get_controller(ext_id)
  File "/usr/lib/python3/dist-packages/ulauncher/api/server/ExtensionServer.py", line 76, in get_controller
    return self.controllers[extension_id]
KeyError: 'com.github.brpaz.ulauncher-vscode-projects'

Support for VSCodium

Currently it does not appear that vscodium is supported, it would be nice to be able to use this for vscodium.

Difference launching VS Code from ulauncher as opposed to manually

For some reason, when I launch a project using this, it seems it cannot find dotnet and I am getting errors like:

It was not possible to find any installed .NET Core SDKs
Cannot start .NET Core language services because `dotnet` was not found. Consider: 
* setting the `FSharp.dotnetRoot` settings key to a directory with a `dotnet` binary, 
* including `dotnet` in your PATH, 
* installing .NET Core into one of the default locations, or 
* using the `net` `FSharp.fsacRuntime` to use mono instead

When I manually open VS Code and select the project through the extension side bar, all is fine.

I dont know enough Python, but could it be that this is losing some PATH vars along the way: https://github.com/brpaz/ulauncher-vscode-projects/blob/master/main.py#L88

To be clear, dotnet is on my PATH in my normal shell :)

What can I provide to help debug this?

[Bug]: Vscode python tests' discovery fail because of grpcio

Description?

When I launch code directly vscode tests don't fail. but if i launch from this extension it does.

Launched from the extension

image

Launched from ulauncher without extension

image

Extension Logs

    from google.cloud.exceptions import NotFound  # pylint: disable=no-name-in-module
  File "/home/alchemistake/.local/share/virtualenvs/kindly-KPEJBdOt/lib/python3.10/site-packages/google/cloud/exceptions/__init__.py", line 24, in <module>
    from google.api_core import exceptions
  File "/home/alchemistake/.local/share/virtualenvs/kindly-KPEJBdOt/lib/python3.10/site-packages/google/api_core/exceptions.py", line 29, in <module>
    from google.rpc import error_details_pb2
  File "/home/alchemistake/.local/share/virtualenvs/kindly-KPEJBdOt/lib/python3.10/site-packages/google/rpc/error_details_pb2.py", line 39, in <module>
    _RETRYINFO = DESCRIPTOR.message_types_by_name["RetryInfo"]
AttributeError: 'NoneType' object has no attribute 'message_types_by_name'

    at ChildProcess.<anonymous> (/home/alchemistake/.vscode/extensions/ms-python.python-2023.9.11461009/out/client/extension.js:2:241844)
    at Object.onceWrapper (node:events:628:26)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1112:16)
    at Socket.<anonymous> (node:internal/child_process:470:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:757:14)

stuck on Loading

screenshot

~/.config/Code/User/projects.json is there and working - permissions are correct...
I don't see why it is not working.

Old/deleted projects stills how up in search results

Hello,

How do you clean out old projects? I have folders/projects that do not exist anymore but they still show up in this extension's search results. I tried clearing the contents of ~/.config/Code/User/globalStorage/alefragnani.project-manager/ but that does not change anything.

Thank you!

Error on Gnome 40

Hello,

  • OS: Ubuntu 21.04 x86_64
  • Shell: zsh 5.8
  • Kernel: 5.11.0-17-generic

It's seems that your extension is not working on gnome 40 :

2021-05-31 17:24:19,311 | ERROR | ulauncher.api.server.ExtensionRunner: _run_process() | Extension "com.github.brpaz.ulauncher-vscode-projects" exited instantly with code 1
2021-05-31 17:24:19,311 | ERROR | ulauncher.api.server.ExtensionRunner: _run_process() | Extension "com.github.brpaz.ulauncher-vscode-projects" failed with an error: ImportError: Requiring namespace 'Gdk' version '3.0', but '4.0' is already loaded

Do you have any idea how to fix this ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.