-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
[Feature Request] Add a "source code" field #14
Comments
This would be really cool @Ced-Sharp - how do you think that data should be stored in the data file itself. Woudl you think it's just a string? But the editor itself is monaco? |
I see this as 2 different requests actually:
|
The JSON storage itself (2) is achieved imo by the List field type - is there something else that you would want there? For (1) yeah I think having a MonacoEditor as a FieldType would be a good addition. I'm not sure how that's implemented though. I also see that for Webviews in code it's not a feature they've added in yet: microsoft/vscode#87282 |
Monaco is available for browsers outside of vscode, maybe you could simply use it like you would in a browser with <script> and tags, but it would bring a lot of overhead. I guess I could use lists for json, I might have misunderstood what they were. |
Based off of that linked issue it seems like it isn't as easy as that due to the sandbox that webviews are forced to run inside of for VS Code. For something like CDB I think this works because it's just an actual website, but VS Code's view is a bit more limited for security reasons. However there is a proposal on that site to just expose the editor via an API, which would ideally be how this happens as it would reduce the overhead of needing to repackage monaco for this extension (which like you said would bloat the install size and likely affect performance). And yeah Lists I think would be a good use case for JSON schema that is shared between lines. You couldn't do fully arbitrary JSON yet with them (as in, totally unique per line), but something like that could be achieved with just using a longtext field or text field and parsing the JSON at your consumption point. |
I see, I've never developped a vscode extension, so I had no idea of webview's limitations. |
It giveth and taketh, that's for sure. Marked as on hold for now |
Since this is an extension to vscode, we should be able to use the vscode editor (monaco) as a field type.
A simple example would be adding complex data as json. I would prefer using monaco as a field rather than longtext
because it has color highlight and folding.
The text was updated successfully, but these errors were encountered: