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

Remove node references from Talon spoken form reader #2480

Merged
merged 13 commits into from
Jul 11, 2024

Conversation

AndreasArvidsson
Copy link
Member

Checklist

  • [/] I have added tests
  • [/] I have updated the docs and cheatsheet
  • [/] I have not broken the cheatsheet

@pokey
Copy link
Member

pokey commented Jul 10, 2024

Can you elaborate a bit on why you've gone this route? The idea was for this to be node-specific and move it into a separate package

@AndreasArvidsson
Copy link
Member Author

Definitely. I aim for all Cursorless features to be available in a non node environment. Since we already have a file system representation this was an easy win to share as much functionality as possible between different implementations while still supporting non node environments.

@pokey
Copy link
Member

pokey commented Jul 10, 2024

Do you have an example of a non-node environment where we might need to do this via file system?

@AndreasArvidsson
Copy link
Member Author

AndreasArvidsson commented Jul 10, 2024

Talon js for example. Can read the file via a talon action, but not via node.

But I'm not against making it more abstract.

@pokey
Copy link
Member

pokey commented Jul 10, 2024

But wouldn't talon js just get the spoken forms from talon?

@AndreasArvidsson
Copy link
Member Author

In the long run maybe, but that would require changes to cursorless-Talon. Today the source of truth for the spoken forms is a json file and it's much easier to just read that.

Let's look at it from another angle. Why even have a file system abstraction if all file system interaction is gonna be via node?

I'm starting to lean towards actually removing the file system interface and have more custom interfaces for the editor to provide the specific data in a more environment agnostic way.

@pokey
Copy link
Member

pokey commented Jul 11, 2024

In the long run maybe, but that would require changes to cursorless-Talon. Today the source of truth for the spoken forms is a json file and it's much easier to just read that.

Yeah I'm ok with keeping the file thing in the short term if it's a lot easier, but does feel weird to use file-based rpc when you're in the same process

I'm starting to lean towards actually removing the file system interface and have more custom interfaces for the editor to provide the specific data in a more environment agnostic way.

Exactly. That's what I was proposing Tuesday

@AndreasArvidsson AndreasArvidsson added the to discuss Plan to discuss at meet-up label Jul 11, 2024
@AndreasArvidsson
Copy link
Member Author

AndreasArvidsson commented Jul 11, 2024

This latest version I like. Create engine gets the Talon spoken form as an argument and vscode has its own implementation. Then later in a separate pull request we can I remove the file system abstraction since that is used in other places as well that needs to be updated.

@pokey
Copy link
Member

pokey commented Jul 11, 2024

update from meet-up:

  • move json reader to a new package called file-system-common

@pokey pokey removed the to discuss Plan to discuss at meet-up label Jul 11, 2024
@AndreasArvidsson
Copy link
Member Author

@pokey ready

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good but just want to make sure you had a chance to try this locally; see comment below

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@AndreasArvidsson AndreasArvidsson added this pull request to the merge queue Jul 11, 2024
Merged via the queue into main with commit c530f04 Jul 11, 2024
15 checks passed
@AndreasArvidsson AndreasArvidsson deleted the spokenFormReader branch July 11, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants