CodeEdit icon indicating copy to clipboard operation
CodeEdit copied to clipboard

[WIP] Command palette

Open avdept opened this issue 2 years ago • 14 comments

Description

This PR adds command palette and keybindings

Related Issue

  • #ISSUE_NUMBER

Checklist

  • [x] I read and understood the contributing guide as well as the code of conduct
  • [ ] My changes generate no new warnings
  • [ ] My code builds and runs on my machine
  • [ ] I documented my code
  • [ ] Review requested

Screenshots

avdept avatar Apr 25 '22 15:04 avdept

This also brings up a question. How do we store initial default values and how to easier add new? I couldn't find in vscode repo how do they handle this case(but I suspect it might be json file too)

For now I see 2 ways:

  • json file with list of shortcuts, which gets imported into UserDefaults on first app launch, and then on every all launch keybindings gets pulled from UserDefaults to memory
  • Have a file with keyboard shortcut definitions, which can be used at any moment in runtime, however it has limitations on persisting changes

avdept avatar Apr 25 '22 15:04 avdept

It looks like VS Code stores a keybindings.json file. (reference)

Play with that in VS Code and I would do something along those lines.

austincondiff avatar Apr 26 '22 06:04 austincondiff

It looks like it is stored in ~/Library/Application Support/Code/User/keybindings.json, so we might store it in ~/Library/Application Support/CodeEdit/User/keybindings.json or ~/.codeedit/keybindings.json.

This is a bigger issue here but I think we need to delineate between Application Support and .codeedit. (and possibly evaluate if we want to go with Application Support instead of .codeedit)

I think VS Code is changing this because I noticed settings.json is no longer stored in .vscode as it was. They are now also putting it in ~/Library/Application Support/Code/User/settings.json. I think this makes sense because that is what that folder is for on a Mac. The only thing left in .vscode currently is downloaded extensions and even that is arguable that it could live in Application Support.

@lukepistrol Thoughts?

austincondiff avatar Apr 26 '22 07:04 austincondiff

It looks like it is stored in ~/Library/Application Support/Code/User/keybindings.json, so we might store it in ~/Library/Application Support/CodeEdit/User/keybindings.json or ~/.codeedit/keybindings.json.

This is a bigger issue here but I think we need to delineate between Application Support and .codeedit. (and possibly evaluate if we want to go with Application Support instead of .codeedit)

I think VS Code is changing this because I noticed settings.json is no longer stored in .vscode as it was. They are now also putting it in ~/Library/Application Support/Code/User/settings.json. I think this makes sense because that is what that folder is for on a Mac. The only thing left in .vscode currently is downloaded extensions and even that is arguable that it could live in Application Support.

@lukepistrol Thoughts?

Well, the .vscode dir contains only workspace specific settings(which also can be alternative keybindings), while ~/Library/... contains default values

avdept avatar Apr 26 '22 07:04 avdept

For me, settings.json (user overrides) is located in ~/Library/Application Support/Code/User/settings.json and not in ~/.vscode/settings.json as it once was.

austincondiff avatar Apr 26 '22 07:04 austincondiff

I guess we could start with json file located inside app folder for now, and later extract to any other path if we decide so. What do you think @austincondiff ?

avdept avatar Apr 26 '22 07:04 avdept

image

https://code.visualstudio.com/docs/getstarted/settings

austincondiff avatar Apr 26 '22 07:04 austincondiff

That works. Completely agree. This is a larger issue out of scope of this PR.

austincondiff avatar Apr 26 '22 07:04 austincondiff

Yeah for now put it in ~/.codeedit/. Once we decided where we want to put it for release we can move all files at once to minimize confusion among other contributors.

lukepistrol avatar Apr 26 '22 07:04 lukepistrol

What is the status of this PR? It was opened three weeks ago and is still a draft. I just wanted to make sure it doesn't go stale.

austincondiff avatar May 17 '22 19:05 austincondiff

What is the status of this PR? It was opened three weeks ago and is still a draft. I just wanted to make sure it doesn't go stale.

Yeah I'm working on it, but unfortunately not that often. Feel free to close it if you want to clear prs and I will reopen in when I'm done

avdept avatar May 18 '22 04:05 avdept

Hi @avdept,

What is the status? the last commit was 27 days ago.

0xWDG avatar Jun 22 '22 15:06 0xWDG

@wdg Its not abandoned, just had no time to work on this. Plan to resume the work in few days

avdept avatar Jun 23 '22 08:06 avdept

@wdg Its not abandoned, just had no time to work on this. Plan to resume the work in few days

Great 👍

0xWDG avatar Jun 23 '22 08:06 0xWDG

Small update: I've resumed work on this, dealing with UI part.

avdept avatar Aug 09 '22 08:08 avdept

@allcontributors add @avdept for code

austincondiff avatar Sep 06 '22 21:09 austincondiff

@austincondiff

I've put up a pull request to add @avdept! :tada:

allcontributors[bot] avatar Sep 06 '22 21:09 allcontributors[bot]