Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Porting notational-velocity-like atom-notes to VSCode #29

Closed
robwalton opened this issue Mar 22, 2018 · 7 comments
Closed

Porting notational-velocity-like atom-notes to VSCode #29

robwalton opened this issue Mar 22, 2018 · 7 comments
Labels

Comments

@robwalton
Copy link
Contributor

For some reason I've switched to vscode. The one thing I'm really missing is atom-notes. I'm looking into creating a package with the same functionality. I would of course mention atom-notes loudly in any documentation!

It would be nicer to share code with atom-notes rather than copying it; possibly by pulling the core note-handling functionality into a package. It would add some complexity to atom notes. Does the atom-notes community have any interest in this?

At first glance the code with a good ratio of functionality to atom API code is:

  • interlink.js
  • notes-fs.js
  • notes-store.js
  • notes-view-list.js
@lexicalunit
Copy link
Owner

lexicalunit commented Mar 22, 2018

Exciting! I would have already done this myself if I had the time.

One thing I've been meaning to do for a while now is have a backend process that does all the note searching and indexing, as well as filesystem watching. It would then communicate search results back to the editor on command. This would avoid editor hitches when indexing or searching by taking that processing out of the main editor's thread. We could even implement the backend process in something lightening fast like rust.

If I understand the way plugins in code work (I've never written one myself), this functionality will be required anyway to implement an atom-notes-like plugin in code. That is because plugins for code are not given access to the DOM and run in their own thread.

So depending on how you implement this, there's high potential for some code written for the code plugin to make its way back into this repository. 🎉

@robwalton
Copy link
Contributor Author

robwalton commented Mar 23, 2018

Great, I'll see how it goes. I'll start by working in atom-notes to pull out the 'backend' type code into a package. To keep things simple I'll let it pull in config from whichever of atom or vscode is available.

On the vscode front... The first issue is that the only thing that looks usable in vscode is a QuickPick list. It does the search for you, but you need to transfer all the file names a and file contents for it to search. I tested this with dummy data with 1000 items each with 20 paragraphs of text (totalling ~10000 characters per item). The speed was fine; but it does limit search options: it seems to:

  1. match only within the field I'm using for the file name or the the one I'm using for the text,
  2. only match forwards,
  3. only fuzzy search across word boundaries

I think it should be good to go though! There is some discussion about improved fuzzy searching: microsoft/vscode#34088 .

@robwalton
Copy link
Contributor Author

robwalton commented Mar 23, 2018

I've just realised that vscode's QuickPick list won't return anything but an item from the list; so it can't return the search string so we can use it to make a new note. That might put an end to this project for now, unless vscode supports another way of extending things. I can't see another way of extending vscode that would work though. There are currently 81 open issues labelled quick-pick so it would requires some strong will to get this added I imagine! There seems to be one meta-ticket microsoft/vscode#45589 indicating the developers are considering enhancing it.

Ahh, and it won't autofill the search field either with the best match; which would slow adding new notes into a hierarchy down.

And, nor will it yet us pre-populate the search field with the last used search.

I'm pretty sure there is currently no way to contribute new views (microsoft/vscode#710) other than trees.

@robwalton robwalton changed the title Interest in porting to VSCode Porting notational-velocity-like atom-notes to VSCode Mar 23, 2018
@robwalton
Copy link
Contributor Author

Hi @lexicalunit, looks like this project is paused indefinitely. Feel free to close this ticket so it doesn't clutter up your issues list!

@lexicalunit
Copy link
Owner

Thanks @robwalton! Hopefully one day this will be possible in VS Code.

@robwalton
Copy link
Contributor Author

Agreed, would be good. Vscode feels more solid and I like the settings file for configuration. Back to atom for atom-notes it is.

@rajalokan
Copy link

Landed here after looking for atom-notes replacement in VSCode. Good to see I'm on correct path of using VSCode.

If anyone can check if now can it be done or any similar package in vscode marketplace. TIA

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

No branches or pull requests

3 participants