FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

refact: deprecate snippets ext. point and add samples ext. point by sebthom · Pull Request #892 · eclipse-tm4e/tm4e · GitHub

refact: deprecate snippets ext. point and add samples ext. point - #892

Merged
mickaelistria merged 1 commit into
eclipse-tm4e:mainfrom
sebthom:samples
Jun 2, 2025
Merged

refact: deprecate snippets ext. point and add samples ext. point#892
mickaelistria merged 1 commit into
eclipse-tm4e:mainfrom
sebthom:samples

Conversation

sebthom commented May 31, 2025
edited
Loading

Copy link
Copy Markdown
Member

This addresses #147. The old "snippets" extension point is still functional so no immediate change required by grammar providers.

Old:

   <extension
         point="org.eclipse.tm4e.ui.snippets">
      <snippet
            name="org.eclipse.tm4e.ui.tests.snippet1"
            path="grammars/snippet.ts"
            scopeName="source.ts">
      </snippet>
   </extension>

New:

   <extension
         point="org.eclipse.tm4e.ui.samples">
      <sample
            name="org.eclipse.tm4e.ui.tests.sample1"
            path="grammars/sample.ts"
            scopeName="source.ts">
      </sample>
   </extension>

sebthom commented May 31, 2025
edited
Loading

Copy link
Copy Markdown
Member Author

We could also name the extension point org.eclipse.tm4e.ui.grammarPreviewSamples to be precise, e.g.

   <extension
         point="org.eclipse.tm4e.ui.grammarPreviewSamples">
      <sample
            name="org.eclipse.tm4e.ui.tests.sample1"
            path="grammars/sample.ts"
            scopeName="source.ts">
      </sample>
   </extension>

I'd like to avoid the term snippet at all since it has a very different meaning in TextMate https://macromates.com/textmate/manual/snippets

sebthom requested a review from mickaelistria May 31, 2025 18:14

Copy link
Copy Markdown
Contributor

I'm fine with such renames. Theorically, we'd also keep ISnippet and ISnippetManager are deprecated; but if we can ensure enough those have no users, it's OK to delete them too.

sebthom commented Jun 2, 2025

Copy link
Copy Markdown
Member Author

I'm fine with such renames. Theorically, we'd also keep ISnippet and ISnippetManager are deprecated; but if we can ensure enough those have no users, it's OK to delete them too.

I already did a thorough search on Google and GitHub and could not find any references to ISnippet and ISnippetManager in any external code so I think it is safe to rename them.

Copy link
Copy Markdown
Contributor

OK, good.

mickaelistria merged commit ad7ab36 into eclipse-tm4e:main Jun 2, 2025
sebthom mentioned this pull request Jun 2, 2025

Copy link
Copy Markdown
Contributor

Thanks @sebthom for this change which was very bad.

So now we have snippet as free, I think it would be very nice to implement VSCode snippet https://code.visualstudio.com/docs/editing/userdefinedsnippets

Even if Eclipse IDE provide this feature with Template, I think it can be a very good idea to support it, because you could just copy/paste existing snippet from existing vscode extension.

sebthom commented Jun 2, 2025
edited
Loading

Copy link
Copy Markdown
Member Author

The org.eclipse.tm4e.ui.snippet extension point is still in use otherwise we'd break clients. But one could definitively add a org.eclipse.tm4e.ui.snippets now.

mickaelistria commented Jun 2, 2025
edited by sebthom
Loading

Copy link
Copy Markdown
Contributor

But one could definitively add a org.eclipse.tm4e.ui.snippets now.

We can also keep the legacy org.eclipse.tm4e.ui.snippets extension point, and let it have a new snippet child element and only deprecate the samplechild element.

sebthom deleted the samples branch June 2, 2025 09:28

sebthom commented Jun 2, 2025
edited
Loading

Copy link
Copy Markdown
Member Author

I made a typo in the PR, the old one actually looks like this:

   <extension
         point="org.eclipse.tm4e.ui.snippets">
      <snippet
            name="org.eclipse.tm4e.ui.tests.snippet1"
            path="grammars/snippet.ts"
            scopeName="source.ts">
      </snippet>
   </extension>

But yes we could only deprecate the <snippet> element and introduce a new one for TM snippets.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL