possibility of creating an editor with custom markup - visual-studio-code

is it possible to create a new editor that includes custom markup? I went through the docs and couldn't find any extension to get it done.
My requirement is to develop an interactive graphical editor (with SVG) to manipulate text content in a file. I want to use third party css/js libs to implement the markup of the editor and at the same time using VS Code APIs fetch/update content of the current file, fire/listen to VS Code events, etc.

Extensions have very limited ability to manipulate the editor's UI. It seems to me that you have two choices:
If you need this capability to be unified with the editor, you will almost certainly need to fork VSCode.
If you don't mind your added functionality being external to VSCode, you could create an extension with a language server that implements your UI. The language server would run in a separate process, but would still be able to interact with VSCode through the extension.

Related

VSCode extension's API: JS contribution point

I am developing a VS Code extension that offers auto completion and hover information about my custom web components library.
I am using Custom Data Extension API to do that, but I have found that the only allowed contribution point are HTML and CSS, and that's a problem for me as I want to make my extension work in JSX files that uses my components in their React version (for instance: <MyComponent> instead of <my-component>)
I have not been able to find if this is possible, or so far, it seems not to be.
Any idea if this is supported by the current VSCode API?
Originally answered by Simon Chan on Github
Usually providing completions for JSX is by writing a TypeScript definition file. The documentation is at https://www.typescriptlang.org/docs/handbook/jsx.html#intrinsic-elements
This file is usually distributed in an NPM package. I can't remember the rule for loading ambient definitions #mjbvz. Maybe it must be a #types/X package, otherwise the user has to edit their tsconfig.json or adding a /// <reference in their source files.
If you want to go the hard way by creating a plugin for TypeScript server that provides custom completions, I can only say it's not impossible. The related contribution point is typescriptServerPlugins: https://code.visualstudio.com/api/references/contribution-points#contributes.typescriptServerPlugins.

VSCode Extension UI for multiple display langauges

My VSCode Extension contributes commands, settings, and a custom editor.
I figured out how to programmatically detect the VSCode display language and use it in the custom editor to provide multi-language UI.
However, I can't find a way to provide translation of the command title, the setting name, and its description to multiple languages and switch the language depending on the VS Code display language.
Is it possible?
The official l10n (localization) sample extension shows a good example, as the old i18n (internationalization) sample has been deprecated.
Clone it here:
https://github.com/microsoft/vscode-extension-samples/tree/main/l10n-sample

Custom VSCode extension: embed native editor in webview

Goal
I want to have a webview, that embeds the native editor (see image).
The embedded part does not need to have a tabbing-feature. It would be enough to have the editor object, that I fill and update manually per Javascript.
Question
Is that possible? How would I do that?
Background
I want to show various file contents within my own webview. These contents should be editable and have all functionality, that the vscode editor has (e.g. syntax highlighting, multiple cursors, intellisense,...). At best, also 3rd party extensions should work within them.
I don't want to start implementing the whole editor again, so I'm searching for a way to embed the editor.
It is not possible to embed the native editor that comes with VS Code. The extension API simply does not support it.
The closest you can get is to import the code of the editor into your webview. The editor is called Monaco and is available via the npm package monaco-editor. It supports most (or all?) of the features offered by VS Code editor, such as IntelliSense.
However, since this editor would be unaware of the installed VS Code extensions, themes and configuration options, it will behave differently than native editors. You might be able to improve the user experience by manually propagating configuration options and themes, but this would require a significant amount of work and might not be possible for other things, such as support for language servers or third party extensions.

ipython notebook as a web tool dev platform

I am planning to port an existing application (or at least part of it where we process data to create graphs interactively) into an ipython based UI. I am wondering if it is possible to create a menu based app using ipython notebook as an engine. Any functionality to create menu-based applications in Ipython? From my experience with Ipython so far, I guess this is not available.
I am thinking of mimicking it by creating html code in markdown cells that will produce menus as select lists, choosing and submitting from there would call some cgi on a server that would update lower parts of the notebook using AJAX. Anyone did similar stuff?
Nothing prevent you from reusing the component.
We try to make them as reusable as possible and is should be easy to use our javascript to create your own js frontend. cf #minrk example here.
If some modification make component more standalone and reusable Patches are welcomed. at some point we might even have each component (codecell, tooltip, completer) installable with bower/component.io/whatever
I would recommend not to add menu through javascript in markdown cell as it will be disable soon.
You might want to have a look at Exhibitionist that uses ipython notebook for some noce stuff.

Customizing UI elements in Eclipse default Java Editor via plugin

I'm trying to develop a plugin for Eclipse that will allow me to modify various elements within the default java text editor. I've found lots of tutorials for creating my own text editor for a different language, but nothing for editing the default java editor. Specifically, I want to be able to run a command and highlight certain areas of the code based on a different program. How do I develop this?
Thanks
You will need to implement your own type of markers and maybe associate annotations with them. Then you can associate the java editor with the annotations to show them. Your application will generate the markers.
Specifically you might want to start to read about org.eclipse.core.resources.marker extension point and IResource.createMarker() to create the markers.
Its doable. You need to find the right extension point that allows you to add functionality to the java editor.
See IBM tutorial. The example with the heading "How do you analyze Java code to apply modifications" seems to be what you want to do.