Files
openide/python/python-rest/resources/META-INF/python-rest-plugin.xml
Mikhail Golubev e1e70a2c7c PY-41923 Migrate ReST configuration producers to newer dynamic plugins-ready API
The main problem with them is that due to an odd design decision they both share
the same configuration type -- RestRunConfigurationType, and it doesn't quite fit in
this newer typed API, e.g. isConfigurationFromContext() can receive a configuration
instance of a wrong type (DocutilsRunConfiguration for SphinxConfigurationProducer and
vice-versa) due to it, producing a CCE at runtime. I employed a workaround already
used in Python testing run configurations sharing the same problem. Namely,
overloaded getConfigurationSettingsList() to additionally check that instances of
RunnerAndConfigurationSettings with RestRunConfigurationType type actually
correspond to run configurations of the proper concrete class.

Note that setupConfigurationFromContext can also receive a run configuration of a wrong
type but in reality it doesn't happen since Sphinx and Docutils run configurations are
applied to different contexts -- directories and individual .rst files respectively.

GitOrigin-RevId: 15fbb90917edd68e6f29b696c527ff04d4eed433
2020-04-29 22:04:28 +00:00

33 lines
1.7 KiB
XML

<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<lang.fileViewProviderFactory language="ReST"
implementationClass="com.jetbrains.rest.RestFileProviderFactory"/>
<editorHighlighterProvider filetype="ReST" implementationClass="com.jetbrains.rest.RestEditorHighlighterProvider"/>
<localInspection language="ReST" shortName="RestRoleInspection" bundle="messages.RestBundle" key="INSP.role.not.defined"
groupKey="INSP.GROUP.rest" enabledByDefault="false" level="WARNING"
implementationClass="com.jetbrains.rest.inspections.RestRoleInspection"/>
<configurationType implementation="com.jetbrains.rest.run.RestRunConfigurationType"/>
<runConfigurationProducer implementation="com.jetbrains.rest.run.docutils.DocutilsConfigurationProducer"/>
<runConfigurationProducer implementation="com.jetbrains.rest.run.sphinx.SphinxConfigurationProducer"/>
<lang.substitutor language="TEXT" implementationClass="com.jetbrains.rest.RestLanguageSubstitutor"/>
<languageInjector implementation="com.jetbrains.rest.PyRestDocstringLanguageInjector"/>
<completion.contributor language="ReST" implementationClass="com.jetbrains.rest.completion.SphinxDirectiveCompletionContributor"/>
</extensions>
<actions resource-bundle="messages.RestBundle">
<action id="com.jetbrains.rest.sphinx.RunSphinxQuickStartAction"
class="com.jetbrains.rest.sphinx.RunSphinxQuickStartAction">
<add-to-group group-id="ToolsMenu" anchor="last"/>
</action>
</actions>
<extensions defaultExtensionNs="restructured.text">
<html.preview.provider implementation="com.jetbrains.rest.RestPythonPreviewProvider"/>
</extensions>
</idea-plugin>