-
Notifications
You must be signed in to change notification settings - Fork 32
feature: paste json as code #308
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
Comments
Looks really cool, IIRC I looked into something like this previously. It would be interesting to make a POC to test out the idea. im not really sure what the user flow should be. Usually in C# one class == one file. So do you create a file from clipboard contents or do you create the file first and then paste the json into the file and the plugin magically turns it into a class? |
I'm a bit torn here. Direct paste from clipboard would require guessing namespace. Creating a class beforehand sort of overrules the purpose. Maybe cut some corners and paste class into a temp buffer to let user yank and paste into a position suitable? Would love to get rid of external dependency on node and quicktype but as it is available... |
I'm not sure I follow, how would you provoke this temp buffer? Command? |
sorry, been zoomed out for a while. best way to incorporate I believe should be:
|
I stumbled upon json-to-types.nvim.
Works sort of. Only supports Newtonsoft.Json and namespace is off OOTB.
Under the hood it relies on quicktype.js wich can be configured to work nicely with System.Text.Json too and accepts namespace as input.
Is this something you would consider bringing into easy-dotnet?
I'm a bit torn. On one hand it would make a nice addition to the toolbox but on the other hand there is already an existing plugin (which would need some tweaking to make it work the way I want it too for c#).
quicktype.js is a ready lib to use and I don't really see an easy way to implement in lua so it would add a dependency on node.
idk, it would be neat to have a tailored c# implementation with all the goodies from easy-dotnet, namespace recognition, configurable implementation (NJ/STJ).
The options are:
None which are configurable in
json-to-types.nvim
.Thoughts?
The text was updated successfully, but these errors were encountered: