Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Multiple prefix matchers for the ui plugin
Multiple prefix matchers for the ui plugin [message #1871832] Sun, 13 October 2024 06:22 Go to next message
Eclipse UserFriend
Hi,

I'm trying to unify the content assist of our DSL in both ui (eclipse) and ide (vscode and theia) plugins and to do that, we have the content assist logic in the ide plugin, and for the ui handled with UiToIdeContentProposalProvider.

Within the ide plugin, there's a chance to override the org.eclipse.xtext.ide.editor.contentassist.IPrefixMatcher with a custom implementation, but in the ui plugin this is done by overriding the org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher. so we ended up having two redundant implementations for the prefixmatcher in ui which have to be done as follows:

	override Class<? extends PrefixMatcher> bindPrefixMatcher() {
		return TextDslPrefixMatcher
	}

	def Class<? extends IPrefixMatcher> bindIPrefixMatcher() {
		return TextDslIdePrefixMatcher
	}


my question is why the org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher is not an implementation of the org.eclipse.xtext.ide.editor.contentassist.IPrefixMatcher interface?
Re: Multiple prefix matchers for the ui plugin [message #1871835 is a reply to message #1871832] Sun, 13 October 2024 12:11 Go to previous messageGo to next message
Eclipse UserFriend
Historic reasons
Re: Multiple prefix matchers for the ui plugin [message #1871838 is a reply to message #1871835] Sun, 13 October 2024 12:13 Go to previous messageGo to next message
Eclipse UserFriend
Ps did you consider to use the UiToIdeCojtentProposalProvider
Re: Multiple prefix matchers for the ui plugin [message #1871865 is a reply to message #1871838] Mon, 14 October 2024 07:40 Go to previous messageGo to next message
Eclipse UserFriend
Christian Dietrich wrote on Sun, 13 October 2024 16:13
Ps did you consider to use the UiToIdeCojtentProposalProvider


Yes, I did for normal proposals (i.e., Keyword, CrossReference), but my problem is with Snippet/Template creation. As per my understanding template creation is not handled in the UiToIdeContentProposalProvider. for example If I have snippets for VSCode that are created in the ide plugin there's no utility to convert these templates to ui/eclipse templates.

My use case involves on-the-fly created templates which means I don't have my templates stored in the usual templates.xml file, instead I have a central utility class that creates all the templates.

So to sum it up I was wondering if there's a way to avoid creating over 150 templates twice once for VSCode and another time for Eclipse.
Re: Multiple prefix matchers for the ui plugin [message #1871880 is a reply to message #1871865] Tue, 15 October 2024 00:37 Go to previous messageGo to next message
Eclipse UserFriend
maybe you can build and contribute a solution that works for templates/snippets too
Re: Multiple prefix matchers for the ui plugin [message #1871910 is a reply to message #1871880] Tue, 15 October 2024 15:58 Go to previous message
Eclipse UserFriend
I will consider doing so when I have time and a solution, thank you for answering my questions
Previous Topic:dsl changes break incremental maven build
Next Topic:Xtext 2.37.0.M1 is out
Goto Forum:
  


Current Time: Sat Jun 14 13:42:45 EDT 2025

Powered by FUDForum. Page generated in 0.28210 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top