Skip to content

MultiView support for textmate registered files are missing #5204

@Chris2011

Description

@Chris2011

Description

When I register a new language via @GrammarRegistration(mimeType = HttpEditorKit.HTTP_MIME_TYPE, grammar = "http.tmLanguage.json") those files are missing the MultiView support. It was originally disabled in this file: https://github.com/apache/netbeans/blob/master/ide/lsp.client/src/org/netbeans/modules/lsp/client/options/GenericDataObject.java#L60. Just enable is not enough because the MultiViewElement.Registration is missing, which is handled via Annotation as you can see here:

@NbBundle.Messages("Source=&Source")
@MultiViewElement.Registration(
displayName = "#Source",
iconBase = "org/netbeans/modules/docker/editor/resources/docker_file.png",
persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED,
mimeType = DockerfileResolver.MIME_TYPE,
preferredID = "dockerfile.source",
position = 100
)

The problem here is, that the MimeType needs to be a static string, but the mimeType of the genericDataObject is dynamic. It looks like x-ext-a, x-ext-b or if you change them inside of a concrete json file, which I mentioned here: https://github.com/Chris2011/netbeans-textmate-files/blob/master/README.md they are still added in a dynamic way.

So atm I dunno how to call the annotation code to add multiview to those generic files, but I tried.

Use case/motivation

Each textmate based file should have minimum the source and the history view.

Related issues

No response

Are you willing to submit a pull request?

No

Code of Conduct

Yes

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions