commit 0060d1e1b56a3fd3250336f62eb12ee7fd49adb0
Author: Ryan J Ollos <ryan.j.ollos@gmail.com>
Date:   Thu Mar 22 22:57:47 2018 -0400

    Implement IWikiSyntaxProvider

diff --git a/wikiautocomplete/api.py b/wikiautocomplete/api.py
deleted file mode 100644
index 4b1d8a6..0000000
--- a/wikiautocomplete/api.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from trac.core import Interface
-
-
-class IWikiAutoCompleteStrategyProvider(Interface):
-
-    def get_wiki_auto_complete_strategies(self):
-        """Get all auto-completion strategies handled by this provider.
-
-        :return: a list of tuples (strategy, handler).
-        
-        strategy is a dict with the following keys:
-            "match": Required. A regex string.
-            "match_flags": Optional. Regex flags.
-            "name": Required. A name string.
-            "index": Required. Index of regex group to replace.
-            "template_prefix": Optional. String to show before completion.
-            "template_suffix": Optional. String to show after completion.
-            "replace_prefix": Optional. String to add before completion.
-            "replace_suffix": Optional. String to add after completion.
-            "replace_end": Optional. String to add after cursor.
-            "quote_whitespace": Optional. Boolean for enabling quoting of completions containing whitespace.
-            "cache": Optional. Boolean for enabling caching of all completions.
-        handler is a function taking two arguments:
-            req: a trac.web.api.Request object.
-            term: a string. The term to be completed. (Not provided if "cache" is True.)
-        and returns a list of dict with the following keys:
-            "value": Required. The completed string.
-            "title": Optional. A short string title.
-            "title_html": Optional. A short HTML title.
-            "details_html": Optional. Full HTML details.
-        """
-        pass
diff --git a/wikiautocomplete/web_ui.py b/wikiautocomplete/web_ui.py
index 5f29268..48ca94c 100644
--- a/wikiautocomplete/web_ui.py
+++ b/wikiautocomplete/web_ui.py
@@ -5,7 +5,6 @@ from __future__ import with_statement
 import pkg_resources
 import re
 
-from trac.config import OrderedExtensionsOption
 from trac.core import Component, TracError, implements
 from trac.attachment import Attachment
 from trac.mimeview.api import Mimeview
@@ -17,12 +16,10 @@ from trac.util.translation import dgettext
 from trac.versioncontrol.api import RepositoryManager
 from trac.web import IRequestFilter, IRequestHandler
 from trac.web.chrome import ITemplateProvider, add_script, add_script_data, add_stylesheet, web_context
-from trac.wiki.api import WikiSystem
+from trac.wiki.api import IWikiSyntaxProvider, WikiSystem
 from trac.wiki.interwiki import InterWikiMap
 from trac.wiki.formatter import format_to_html, format_to_oneliner
 
-from wikiautocomplete.api import IWikiAutoCompleteStrategyProvider
-
 try:
     import json
 except ImportError:
@@ -46,27 +43,24 @@ class WikiAutoCompleteModule(Component):
     """Auto-completes wiki formatting."""
 
     implements(IRequestFilter, IRequestHandler, ITemplateProvider,
-               IWikiAutoCompleteStrategyProvider)
-
-    strategy_providers = OrderedExtensionsOption(
-        'wiki_auto_complete', 'strategy_providers',
-        IWikiAutoCompleteStrategyProvider,
-        'WikiAutoCompleteModule',
-        True,
-        """List of components implementing `IWikiAutoCompleteStrategyProvider`.""")
+               IWikiSyntaxProvider)
 
     def _get_strategy_and_handler(self, name):
-        for provider in self.strategy_providers:
-            for strategy, handler in provider.get_wiki_auto_complete_strategies():
-                if strategy.get('name') == name:
-                    return strategy, handler
+        for provider in WikiSystem(self.env).syntax_providers:
+            if hasattr(provider, 'get_wiki_auto_complete_strategies'):
+                for strategy, handler in \
+                        provider.get_wiki_auto_complete_strategies():
+                    if strategy.get('name') == name:
+                        return strategy, handler
 
     @lazy
     def _strategies(self):
         strategies = []
-        for provider in self.strategy_providers:
-            for strategy, _handler in provider.get_wiki_auto_complete_strategies():
-                strategies.append(strategy)
+        for provider in WikiSystem(self.env).syntax_providers:
+            if hasattr(provider, 'get_wiki_auto_complete_strategies'):
+                for strategy, _handler in \
+                        provider.get_wiki_auto_complete_strategies():
+                    strategies.append(strategy)
         return strategies
 
     # IRequestFilter methods
@@ -115,9 +109,40 @@ class WikiAutoCompleteModule(Component):
         else:
             self._send_json(req, completions)
 
-    # IWikiAutoCompleteStrategyProvider methods
+    # IWikiSyntaxProvider methods
+
+    def get_wiki_syntax(self):
+        return []
+
+    def get_link_resolvers(self):
+        return []
 
     def get_wiki_auto_complete_strategies(self):
+        """Get all auto-completion strategies handled by this provider.
+
+        :return: a list of tuples (strategy, handler).
+
+        strategy is a dict with the following keys:
+            "match": Required. A regex string.
+            "match_flags": Optional. Regex flags.
+            "name": Required. A name string.
+            "index": Required. Index of regex group to replace.
+            "template_prefix": Optional. String to show before completion.
+            "template_suffix": Optional. String to show after completion.
+            "replace_prefix": Optional. String to add before completion.
+            "replace_suffix": Optional. String to add after completion.
+            "replace_end": Optional. String to add after cursor.
+            "quote_whitespace": Optional. Boolean for enabling quoting of completions containing whitespace.
+            "cache": Optional. Boolean for enabling caching of all completions.
+        handler is a function taking two arguments:
+            req: a trac.web.api.Request object.
+            term: a string. The term to be completed. (Not provided if "cache" is True.)
+        and returns a list of dict with the following keys:
+            "value": Required. The completed string.
+            "title": Optional. A short string title.
+            "title_html": Optional. A short HTML title.
+            "details_html": Optional. Full HTML details.
+        """
         return [
             ({  # Processors
                 "match": r"^(\s*\{{3}#!)(.*)(?!\n)$",
