mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
Merge ReST plugin with ReST Python module, convert module to v2
Nobody uses it except Python GitOrigin-RevId: 4da3e7da0dcd86d454972b2ef68d2581c7fe5cdb
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ac6ae0e1b2
commit
ab9ea210a6
4
.idea/modules.xml
generated
4
.idea/modules.xml
generated
@@ -238,7 +238,6 @@
|
||||
<module old-name="repository" new-name="android.sdktools.repository" />
|
||||
<module old-name="resources" new-name="intellij.java.resources" />
|
||||
<module old-name="resources-en" new-name="intellij.java.resources.en" />
|
||||
<module old-name="rest" new-name="intellij.reStructuredText" />
|
||||
<module old-name="schema-reader-generator" new-name="intellij.javascript.schemaReaderGenerator" />
|
||||
<module old-name="script-debugger-backend" new-name="intellij.platform.scriptDebugger.backend" />
|
||||
<module old-name="script-debugger-ui" new-name="intellij.platform.scriptDebugger.ui" />
|
||||
@@ -1141,7 +1140,6 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/python/python-sdk/intellij.python.sdk.iml" filepath="$PROJECT_DIR$/python/python-sdk/intellij.python.sdk.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/python/python-terminal/intellij.python.terminal.iml" filepath="$PROJECT_DIR$/python/python-terminal/intellij.python.terminal.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/python/tools/intellij.python.tools.iml" filepath="$PROJECT_DIR$/python/tools/intellij.python.tools.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/python/rest/intellij.reStructuredText.iml" filepath="$PROJECT_DIR$/python/rest/intellij.reStructuredText.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/RegExpSupport/intellij.regexp.iml" filepath="$PROJECT_DIR$/RegExpSupport/intellij.regexp.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/xml/relaxng/intellij.relaxng.iml" filepath="$PROJECT_DIR$/xml/relaxng/intellij.relaxng.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/remote-control/intellij.remoteControl.iml" filepath="$PROJECT_DIR$/plugins/remote-control/intellij.remoteControl.iml" />
|
||||
@@ -1482,4 +1480,4 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/kotlin/util/test-generator-fir/kotlin.util.test-generator-fir.iml" filepath="$PROJECT_DIR$/plugins/kotlin/util/test-generator-fir/kotlin.util.test-generator-fir.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@@ -169,7 +169,6 @@
|
||||
<orderEntry type="module" module-name="intellij.toml.tests" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.maven.tests" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.gradle.java.tests" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.reStructuredText" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.groovy.uast.tests" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.platform.remoteServers.targetsIntegrationTests" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.python.commonTests" scope="TEST" />
|
||||
|
||||
@@ -22,6 +22,7 @@ com.intellij.lang.javascript.inspections.JSPotentiallyInvalidConstructorUsageIns
|
||||
com.intellij.lang.javascript.inspections.JSSuspiciousNameCombinationInspection
|
||||
com.intellij.lang.javascript.inspections.UnterminatedStatementJSInspection
|
||||
com.intellij.psi.css.inspections.CssUnknownPropertyInspection
|
||||
com.intellij.python.reStructuredText.inspections.RestRoleInspection
|
||||
com.intellij.spellchecker.inspections.SpellCheckingInspection
|
||||
com.jetbrains.php.lang.inspections.PhpUndefinedClassInspection
|
||||
com.jetbrains.php.lang.inspections.PhpUndefinedVariableInspection
|
||||
@@ -31,7 +32,6 @@ com.jetbrains.php.lang.inspections.phpdoc.PhpMissingDocCommentInspection
|
||||
com.jetbrains.python.inspections.PyCompatibilityInspection
|
||||
com.jetbrains.python.inspections.PyPackageRequirementsInspection
|
||||
com.jetbrains.python.inspections.PyRedundantParenthesesInspection
|
||||
com.jetbrains.rest.inspections.RestRoleInspection
|
||||
com.sixrr.inspectjs.bitwise.PointlessBitwiseExpressionJSInspection
|
||||
com.sixrr.inspectjs.confusing.EmptyStatementBodyJSInspection
|
||||
com.sixrr.inspectjs.confusing.NestedFunctionJSInspection
|
||||
|
||||
@@ -312,7 +312,7 @@ com.intellij.testDiscovery.*
|
||||
|
||||
[PYTHON_TESTS]
|
||||
com.jetbrains.python.*
|
||||
com.jetbrains.rest.*
|
||||
com.intellij.python.reStructuredText.*
|
||||
|
||||
[KOTLIN_PLUGIN_TESTS]
|
||||
org.jetbrains.kotlin.*
|
||||
|
||||
@@ -13,7 +13,6 @@ intellij.grazie
|
||||
intellij.markdown
|
||||
intellij.platform.langInjection
|
||||
intellij.properties
|
||||
intellij.reStructuredText
|
||||
intellij.searchEverywhereMl
|
||||
intellij.settingsSync
|
||||
intellij.sh
|
||||
|
||||
@@ -32,7 +32,6 @@ internal class PythonCommunityPluginBuilder(private val home: Path) {
|
||||
options = options)
|
||||
BuildTasks.create(buildContext).buildNonBundledPlugins(listOf(
|
||||
"intellij.python.community.plugin",
|
||||
"intellij.reStructuredText",
|
||||
))
|
||||
|
||||
val builtPlugins = mutableListOf<Path>()
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<orderEntry type="module" module-name="intellij.vcs.git.featuresTrainer" scope="RUNTIME" />
|
||||
<orderEntry type="module" module-name="intellij.relaxng" scope="RUNTIME" />
|
||||
<orderEntry type="module" module-name="intellij.vcs.github" scope="RUNTIME" />
|
||||
<orderEntry type="module" module-name="intellij.reStructuredText" />
|
||||
<orderEntry type="module" module-name="intellij.terminal" />
|
||||
<orderEntry type="module" module-name="intellij.pycharm.community" />
|
||||
<orderEntry type="module" module-name="intellij.pycharm.community.customization" />
|
||||
|
||||
@@ -26,7 +26,6 @@ The Python plug-in provides smart editing for Python scripts. The feature set of
|
||||
<depends optional="true" config-file="python-plugin-datagrip.xml">com.intellij.modules.datagrip</depends>
|
||||
<depends optional="true" config-file="python-plugin-goland.xml">com.intellij.modules.go</depends>
|
||||
<depends optional="true" config-file="python-plugin-rustrover.xml">com.intellij.modules.rustrover</depends>
|
||||
<depends optional="true" config-file="python-rest-plugin.xml">org.jetbrains.plugins.rest</depends>
|
||||
<content>
|
||||
<module name="intellij.python.terminal"/>
|
||||
<module name="intellij.python.featuresTrainer"/>
|
||||
@@ -34,6 +33,7 @@ The Python plug-in provides smart editing for Python scripts. The feature set of
|
||||
<module name="intellij.python.grazie"/>
|
||||
<module name="intellij.python.langInjection"/>
|
||||
<module name="intellij.python.copyright"/>
|
||||
<module name="intellij.python.reStructuredText"/>
|
||||
</content>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.ui.IconManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* NOTE THIS FILE IS AUTO-GENERATED
|
||||
* DO NOT EDIT IT BY HAND, run "Generate icon classes" configuration instead
|
||||
*/
|
||||
public final class PythonReStructuredTextIcons {
|
||||
private static @NotNull Icon load(@NotNull String path, int cacheKey, int flags) {
|
||||
return IconManager.getInstance().loadRasterizedIcon(path, PythonReStructuredTextIcons.class.getClassLoader(), cacheKey, flags);
|
||||
}
|
||||
/** 16x16 */ public static final @NotNull Icon Rst = load("com/intellij/python/reStructuredText/icons/rest/rst.png", 0, 1);
|
||||
}
|
||||
@@ -1,13 +1,11 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
|
||||
// Generated by JFlex 1.9.1 http://jflex.de/ (tweaked for IntelliJ platform)
|
||||
// source: rest.flex
|
||||
|
||||
package com.jetbrains.rest.lexer;
|
||||
package com.intellij.python.reStructuredText.lexer;
|
||||
|
||||
import com.intellij.lexer.FlexLexer;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.jetbrains.rest.RestTokenTypes;
|
||||
import com.intellij.python.reStructuredText.RestTokenTypes;
|
||||
|
||||
/* Auto generated File */
|
||||
|
||||
@@ -5,19 +5,20 @@
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/testData" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="intellij.platform.lang.impl" />
|
||||
<orderEntry type="module" module-name="intellij.platform.execution.impl" />
|
||||
<orderEntry type="module" module-name="intellij.reStructuredText" />
|
||||
<orderEntry type="module" module-name="intellij.platform.lang.impl" scope="PROVIDED" />
|
||||
<orderEntry type="module" module-name="intellij.platform.execution.impl" scope="PROVIDED" />
|
||||
<orderEntry type="library" name="Guava" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.testFramework" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.python.community.impl" />
|
||||
<orderEntry type="module" module-name="intellij.platform.core.ui" />
|
||||
<orderEntry type="module" module-name="intellij.python.community.impl" scope="PROVIDED" />
|
||||
<orderEntry type="module" module-name="intellij.platform.core.ui" scope="PROVIDED" />
|
||||
<orderEntry type="library" name="jsoup" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.jdom" />
|
||||
<orderEntry type="library" name="jcef" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.spellchecker" scope="PROVIDED" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,37 +0,0 @@
|
||||
<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>
|
||||
|
||||
<extensionPoints>
|
||||
<extensionPoint qualifiedName="restructured.text.html.preview.output.handler" interface="com.jetbrains.rest.RestOutputHandler" dynamic="true"/>
|
||||
</extensionPoints>
|
||||
|
||||
<extensions defaultExtensionNs="restructured.text">
|
||||
<html.preview.provider implementation="com.jetbrains.rest.RestPythonPreviewProvider"/>
|
||||
<html.preview.output.handler implementation="com.jetbrains.rest.sphinx.SphinxDirectivesHandler"/>
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
|
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 226 B |
|
Before Width: | Height: | Size: 555 B After Width: | Height: | Size: 555 B |
@@ -0,0 +1,71 @@
|
||||
<idea-plugin package="com.intellij.python.reStructuredText">
|
||||
<dependencies>
|
||||
<plugin id="com.intellij.modules.lang"/>
|
||||
<plugin id="com.intellij.modules.python"/>
|
||||
</dependencies>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
|
||||
<fileType name="ReST" language="ReST" extensions="rst" implementationClass="com.intellij.python.reStructuredText.RestFileType" fieldName="INSTANCE"/>
|
||||
<lang.syntaxHighlighterFactory language="ReST"
|
||||
implementationClass="com.intellij.python.reStructuredText.RestHighlighterFactory"/>
|
||||
<lang.parserDefinition language="ReST" implementationClass="com.intellij.python.reStructuredText.parsing.RestParserDefinition"/>
|
||||
<colorSettingsPage implementation="com.intellij.python.reStructuredText.RestColorsPage"/>
|
||||
|
||||
<completion.contributor language="ReST" implementationClass="com.intellij.python.reStructuredText.completion.DirectiveCompletionContributor"/>
|
||||
<completion.contributor language="ReST" implementationClass="com.intellij.python.reStructuredText.completion.OptionCompletionContributor"/>
|
||||
<completion.contributor language="ReST" implementationClass="com.intellij.python.reStructuredText.completion.ReferenceCompletionContributor"/>
|
||||
<gotoDeclarationHandler implementation="com.intellij.python.reStructuredText.RestGotoProvider" order="FIRST"/>
|
||||
<lang.psiStructureViewFactory language="ReST"
|
||||
implementationClass="com.intellij.python.reStructuredText.structureView.RestStructureViewFactory"/>
|
||||
<annotator language="ReST" implementationClass="com.intellij.python.reStructuredText.validation.RestAnnotatingVisitor"/>
|
||||
<lang.formatter language="ReST" implementationClass="com.intellij.python.reStructuredText.formatter.RestFormattingModelBuilder"/>
|
||||
<codeInsight.fillParagraph language="ReST" implementationClass="com.intellij.python.reStructuredText.actions.RestFillParagraphHandler"/>
|
||||
|
||||
<additionalTextAttributes scheme="Default" file="colorSchemes/RestDefault.xml"/>
|
||||
<additionalTextAttributes scheme="Darcula" file="colorSchemes/RestDarcula.xml"/>
|
||||
|
||||
<lang.elementManipulator forClass="com.intellij.python.reStructuredText.psi.RestLine"
|
||||
implementationClass="com.intellij.python.reStructuredText.psi.RestLineManipulator"/>
|
||||
|
||||
<indexPatternBuilder implementation="com.intellij.python.reStructuredText.RestIndexPatternBuilder"/>
|
||||
<todoIndexer filetype="ReST" implementationClass="com.intellij.python.reStructuredText.RestTodoIndexer"/>
|
||||
|
||||
<fileEditorProvider implementation="com.intellij.python.reStructuredText.editor.RestSplitEditorProvider" fileType="ReST"/>
|
||||
<applicationConfigurable groupId="language" instance="com.intellij.python.reStructuredText.editor.RestConfigurable"
|
||||
id="restructured.text.topic" bundle="messages.RestBundle" key="configurable.RestConfigurable.display.name"/>
|
||||
<applicationService serviceImplementation="com.intellij.python.reStructuredText.editor.RestSettings"/>
|
||||
|
||||
|
||||
<lang.fileViewProviderFactory language="ReST"
|
||||
implementationClass="com.intellij.python.reStructuredText.RestFileProviderFactory"/>
|
||||
<editorHighlighterProvider filetype="ReST" implementationClass="com.intellij.python.reStructuredText.RestEditorHighlighterProvider"/>
|
||||
|
||||
<localInspection language="ReST" shortName="RestRoleInspection" bundle="messages.RestBundle" key="INSP.role.not.defined"
|
||||
groupKey="INSP.GROUP.rest" enabledByDefault="false" level="WARNING"
|
||||
implementationClass="com.intellij.python.reStructuredText.inspections.RestRoleInspection"/>
|
||||
|
||||
<configurationType implementation="com.intellij.python.reStructuredText.run.RestRunConfigurationType"/>
|
||||
<runConfigurationProducer implementation="com.intellij.python.reStructuredText.run.docutils.DocutilsConfigurationProducer"/>
|
||||
<runConfigurationProducer implementation="com.intellij.python.reStructuredText.run.sphinx.SphinxConfigurationProducer"/>
|
||||
<lang.substitutor language="TEXT" implementationClass="com.intellij.python.reStructuredText.RestLanguageSubstitutor"/>
|
||||
|
||||
<languageInjector implementation="com.intellij.python.reStructuredText.PyRestDocstringLanguageInjector"/>
|
||||
<completion.contributor language="ReST" implementationClass="com.intellij.python.reStructuredText.completion.SphinxDirectiveCompletionContributor"/>
|
||||
</extensions>
|
||||
|
||||
<actions resource-bundle="messages.RestBundle">
|
||||
<action id="com.intellij.python.reStructuredText.sphinx.RunSphinxQuickStartAction"
|
||||
class="com.intellij.python.reStructuredText.sphinx.RunSphinxQuickStartAction">
|
||||
<add-to-group group-id="ToolsMenu" anchor="last"/>
|
||||
</action>
|
||||
|
||||
</actions>
|
||||
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij.spellchecker">
|
||||
<support language="ReST" implementationClass="com.intellij.python.reStructuredText.spellchecker.RestSpellcheckerStrategy"/>
|
||||
</extensions>
|
||||
|
||||
|
||||
</idea-plugin>
|
||||
@@ -39,8 +39,9 @@ colors.page.attributes.descriptor.comment=Comment
|
||||
colors.page.attributes.descriptor.title=Title
|
||||
colors.page.attributes.descriptor.fields=Fields
|
||||
### Actions ###
|
||||
action.com.jetbrains.rest.sphinx.RunSphinxQuickStartAction.text=Sphinx Quickstart
|
||||
action.com.jetbrains.rest.sphinx.RunSphinxQuickStartAction.description=Allows to run sphinx quick-start action
|
||||
|
||||
action.com.intellij.python.reStructuredText.sphinx.RunSphinxQuickStartAction.text=Sphinx Quickstart
|
||||
action.com.intellij.python.reStructuredText.sphinx.RunSphinxQuickStartAction.description=Allows to run sphinx quick-start action
|
||||
|
||||
sphinx.set.working.directory.dialog.title=Set Sphinx Working Directory:
|
||||
sphinx.choose.working.directory.browse.folder.title=Choose Sphinx Working Directory (Containing Makefile):
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -21,7 +7,7 @@ import com.intellij.psi.InjectedLanguagePlaces;
|
||||
import com.intellij.psi.LanguageInjector;
|
||||
import com.intellij.psi.PsiLanguageInjectionHost;
|
||||
import com.jetbrains.python.documentation.doctest.PyDocstringLanguageDialect;
|
||||
import com.jetbrains.rest.psi.RestLine;
|
||||
import com.intellij.python.reStructuredText.psi.RestLine;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText
|
||||
|
||||
import com.intellij.DynamicBundle
|
||||
import org.jetbrains.annotations.Nls
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.DynamicBundle;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey;
|
||||
import com.intellij.openapi.fileTypes.SyntaxHighlighter;
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.openapi.editor.colors.EditorColors;
|
||||
import com.intellij.openapi.editor.colors.EditorColorsScheme;
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.openapi.editor.colors.EditorColorsScheme;
|
||||
import com.intellij.openapi.editor.highlighter.EditorHighlighter;
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* User : catherine
|
||||
*/
|
||||
public class RestElementType extends IElementType {
|
||||
public RestElementType(@NotNull @NonNls String s) {
|
||||
super(s, RestLanguage.INSTANCE);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.psi.tree.IFileElementType;
|
||||
|
||||
/**
|
||||
* User : catherine
|
||||
*/
|
||||
public interface RestElementTypes {
|
||||
IFileElementType REST_FILE = new IFileElementType("REST_FILE", RestLanguage.INSTANCE);
|
||||
RestElementType REFERENCE_TARGET = new RestElementType("REFERENCE");
|
||||
RestElementType DIRECTIVE_BLOCK = new RestElementType("DIRECTIVE_BLOCK");
|
||||
RestElementType INLINE_BLOCK = new RestElementType("INLINE_BLOCK");
|
||||
|
||||
RestElementType LINE_TEXT = new RestElementType("LINE_TEXT");
|
||||
RestElementType FIELD_LIST = new RestElementType("FIELD_LIST");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.psi.FileViewProvider;
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -1,8 +1,7 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.openapi.fileTypes.LanguageFileType;
|
||||
import icons.RestIcons;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -41,7 +40,7 @@ public final class RestFileType extends LanguageFileType {
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return RestIcons.Rst;
|
||||
return PythonReStructuredTextIcons.Rst;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.lang.LanguageParserDefinitions;
|
||||
@@ -1,25 +1,11 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.codeInsight.navigation.actions.GotoDeclarationHandlerBase;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.jetbrains.rest.psi.RestReference;
|
||||
import com.intellij.python.reStructuredText.psi.RestReference;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
@@ -0,0 +1,20 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.openapi.fileTypes.SyntaxHighlighter;
|
||||
import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* User : catherine
|
||||
*/
|
||||
public class RestHighlighterFactory extends SyntaxHighlighterFactory {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public SyntaxHighlighter getSyntaxHighlighter(Project project, VirtualFile virtualFile) {
|
||||
return new RestSyntaxHighlighter();
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.lexer.Lexer;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.impl.search.IndexPatternBuilder;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.tree.TokenSet;
|
||||
import com.jetbrains.rest.lexer.RestFlexLexer;
|
||||
import com.intellij.python.reStructuredText.lexer.RestFlexLexer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.psi.templateLanguages.TemplateLanguage;
|
||||
import com.jetbrains.rest.validation.*;
|
||||
import com.intellij.python.reStructuredText.validation.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.module.Module;
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.psi.templateLanguages.TemplateDataElementType;
|
||||
|
||||
/**
|
||||
* User : catherine
|
||||
*/
|
||||
public interface RestPythonElementTypes {
|
||||
TemplateDataElementType PYTHON_BLOCK_DATA = new RestPythonTemplateType("PYTHON_BLOCK_DATA", RestLanguage.INSTANCE,
|
||||
RestTokenTypes.PYTHON_LINE, RestTokenTypes.REST_INJECTION);
|
||||
|
||||
TemplateDataElementType DJANGO_BLOCK_DATA = new RestPythonTemplateType("DJANGO_BLOCK_DATA", RestLanguage.INSTANCE,
|
||||
RestTokenTypes.DJANGO_LINE, RestTokenTypes.REST_DJANGO_INJECTION);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.module.Module
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.roots.ProjectFileIndex
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.jetbrains.python.PyBundle
|
||||
import com.jetbrains.python.PythonHelper.REST_RUNNER
|
||||
import com.jetbrains.python.sdk.PySdkUtil
|
||||
import com.jetbrains.python.sdk.PythonSdkUtil
|
||||
import com.intellij.python.reStructuredText.sphinx.applySphinx
|
||||
|
||||
internal fun toHtml(text: String, virtualFile: VirtualFile, project: Project): Pair<String, String>? {
|
||||
val module = ApplicationManager.getApplication().runReadAction<Module?> {
|
||||
ProjectFileIndex.getInstance(project).getModuleForFile(virtualFile)
|
||||
} ?: return null
|
||||
val sdk = PythonSdkUtil.findPythonSdk(module) ?: return Pair("", PyBundle.message("python.sdk.no.interpreter.configured.warning"))
|
||||
val commandLine = REST_RUNNER.newCommandLine(sdk, listOf("rst2html"))
|
||||
val output = PySdkUtil.getProcessOutput(commandLine, virtualFile.parent.path, null, 5000,
|
||||
text.toByteArray(Charsets.UTF_8), false)
|
||||
return if (output.isCancelled || output.isTimeout)
|
||||
Pair("", PythonRestBundle.message("python.rest.failed.to.generate.html"))
|
||||
else {
|
||||
return Pair(applySphinx(output.stdout), "<h3>" + PythonRestBundle.message("python.rest.error.output") + "</h3>" + output.stderr)
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.lexer.Lexer;
|
||||
import com.intellij.psi.templateLanguages.TemplateDataElementType;
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
|
||||
package com.jetbrains.rest;
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.intellij.lexer.Lexer;
|
||||
@@ -8,7 +8,7 @@ import com.intellij.openapi.editor.DefaultLanguageHighlighterColors;
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey;
|
||||
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.jetbrains.rest.lexer.RestFlexLexer;
|
||||
import com.intellij.python.reStructuredText.lexer.RestFlexLexer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.lexer.Lexer;
|
||||
import com.intellij.psi.impl.cache.impl.BaseFilterLexer;
|
||||
@@ -7,7 +7,7 @@ import com.intellij.psi.impl.cache.impl.OccurrenceConsumer;
|
||||
import com.intellij.psi.impl.cache.impl.todo.LexerBasedTodoIndexer;
|
||||
import com.intellij.psi.search.UsageSearchContext;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.jetbrains.rest.lexer.RestFlexLexer;
|
||||
import com.intellij.python.reStructuredText.lexer.RestFlexLexer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class RestTodoIndexer extends LexerBasedTodoIndexer {
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.tree.OuterLanguageElementType;
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.actions;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.actions;
|
||||
|
||||
import com.intellij.codeInsight.editorActions.fillParagraph.ParagraphFillHandler;
|
||||
import com.intellij.psi.PsiComment;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiWhiteSpace;
|
||||
import com.jetbrains.rest.RestFile;
|
||||
import com.jetbrains.rest.RestTokenTypes;
|
||||
import com.intellij.python.reStructuredText.RestFile;
|
||||
import com.intellij.python.reStructuredText.RestTokenTypes;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -1,33 +1,19 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.completion;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.completion;
|
||||
|
||||
import com.intellij.codeInsight.completion.*;
|
||||
import com.intellij.codeInsight.lookup.LookupElementBuilder;
|
||||
import com.intellij.patterns.PsiElementPattern;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.ProcessingContext;
|
||||
import com.jetbrains.rest.RestTokenTypes;
|
||||
import com.jetbrains.rest.RestUtil;
|
||||
import com.jetbrains.rest.psi.RestReferenceTarget;
|
||||
import com.intellij.python.reStructuredText.RestTokenTypes;
|
||||
import com.intellij.python.reStructuredText.RestUtil;
|
||||
import com.intellij.python.reStructuredText.psi.RestReferenceTarget;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static com.intellij.patterns.PlatformPatterns.psiElement;
|
||||
import static com.intellij.patterns.StandardPatterns.or;
|
||||
import static com.jetbrains.rest.completion.ReferenceCompletionContributor.getPrefix;
|
||||
import static com.intellij.python.reStructuredText.completion.ReferenceCompletionContributor.getPrefix;
|
||||
|
||||
/**
|
||||
* User : catherine
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.completion;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.completion;
|
||||
|
||||
import com.intellij.codeInsight.completion.*;
|
||||
import com.intellij.codeInsight.lookup.LookupElementBuilder;
|
||||
@@ -22,8 +8,8 @@ import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.ProcessingContext;
|
||||
import com.jetbrains.rest.RestUtil;
|
||||
import com.jetbrains.rest.psi.RestDirectiveBlock;
|
||||
import com.intellij.python.reStructuredText.RestUtil;
|
||||
import com.intellij.python.reStructuredText.psi.RestDirectiveBlock;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static com.intellij.patterns.PlatformPatterns.psiElement;
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.completion;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.completion;
|
||||
|
||||
import com.intellij.codeInsight.completion.*;
|
||||
import com.intellij.codeInsight.lookup.LookupElementBuilder;
|
||||
@@ -22,9 +8,9 @@ import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.ProcessingContext;
|
||||
import com.jetbrains.rest.RestTokenTypes;
|
||||
import com.jetbrains.rest.psi.RestReference;
|
||||
import com.jetbrains.rest.psi.RestReferenceTarget;
|
||||
import com.intellij.python.reStructuredText.RestTokenTypes;
|
||||
import com.intellij.python.reStructuredText.psi.RestReference;
|
||||
import com.intellij.python.reStructuredText.psi.RestReferenceTarget;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashSet;
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.completion;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.completion;
|
||||
|
||||
import com.intellij.codeInsight.completion.*;
|
||||
import com.intellij.codeInsight.lookup.LookupElementBuilder;
|
||||
@@ -23,9 +9,9 @@ import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.patterns.PsiElementPattern;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.ProcessingContext;
|
||||
import com.jetbrains.rest.RestTokenTypes;
|
||||
import com.jetbrains.rest.RestUtil;
|
||||
import com.jetbrains.rest.psi.RestReferenceTarget;
|
||||
import com.intellij.python.reStructuredText.RestTokenTypes;
|
||||
import com.intellij.python.reStructuredText.RestUtil;
|
||||
import com.intellij.python.reStructuredText.psi.RestReferenceTarget;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static com.intellij.patterns.PlatformPatterns.psiElement;
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.editor;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.editor;
|
||||
|
||||
import com.intellij.openapi.options.Configurable;
|
||||
import com.intellij.openapi.options.SearchableConfigurable;
|
||||
@@ -7,7 +7,7 @@ import com.intellij.openapi.ui.ComboBox;
|
||||
import com.intellij.openapi.ui.LabeledComponent;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.ui.jcef.JBCefApp;
|
||||
import com.jetbrains.rest.RestBundle;
|
||||
import com.intellij.python.reStructuredText.RestBundle;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.editor;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.editor;
|
||||
|
||||
import com.google.common.io.Resources;
|
||||
import com.intellij.ide.BrowserUtil;
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.jetbrains.rest.editor;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.editor;
|
||||
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
@@ -12,8 +12,9 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.UserDataHolderBase;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.python.reStructuredText.RestPythonPreviewProviderKt;
|
||||
import com.intellij.util.Alarm;
|
||||
import com.jetbrains.rest.RestBundle;
|
||||
import com.intellij.python.reStructuredText.RestBundle;
|
||||
import kotlin.Pair;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -116,7 +117,7 @@ public class RestPreviewFileEditor extends UserDataHolderBase implements FileEdi
|
||||
return;
|
||||
}
|
||||
|
||||
final Pair<String, String> htmlAndError = RestPreviewProvider.getProviders()[0].toHtml(myDocument.getText(), myFile, myProject);
|
||||
final Pair<String, String> htmlAndError = RestPythonPreviewProviderKt.toHtml(myDocument.getText(), myFile, myProject);
|
||||
if (htmlAndError == null) return;
|
||||
|
||||
String html = htmlAndError.getFirst();
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.editor;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.editor;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.editor;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.editor;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.*;
|
||||
@@ -8,12 +8,9 @@ import com.intellij.ui.jcef.JBCefApp;
|
||||
import com.intellij.util.xmlb.XmlSerializerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static com.jetbrains.rest.editor.RestConfigurable.JCEF;
|
||||
import static com.jetbrains.rest.editor.RestConfigurable.SWING;
|
||||
|
||||
@State(name = "RestSettings", storages = @Storage(value="other.xml", roamingType = RoamingType.DISABLED))
|
||||
public class RestSettings implements PersistentStateComponent<RestSettings> {
|
||||
@NotNull private String myCurrentPanel = JBCefApp.isSupported() ? JCEF : SWING;
|
||||
@NotNull private String myCurrentPanel = JBCefApp.isSupported() ? RestConfigurable.JCEF : RestConfigurable.SWING;
|
||||
|
||||
@NotNull
|
||||
@NlsSafe
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.jetbrains.rest.editor;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.editor;
|
||||
|
||||
import com.intellij.openapi.fileEditor.*;
|
||||
import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider;
|
||||
@@ -7,7 +7,7 @@ import com.intellij.openapi.fileTypes.FileTypeRegistry;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.jetbrains.rest.RestFileType;
|
||||
import com.intellij.python.reStructuredText.RestFileType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
final class RestSplitEditorProvider implements FileEditorProvider, DumbAware {
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.editor;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.editor;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.ui.components.JBScrollPane;
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.formatter;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.formatter;
|
||||
|
||||
|
||||
import com.intellij.formatting.*;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.jetbrains.rest.RestElementTypes;
|
||||
import com.jetbrains.rest.RestTokenTypes;
|
||||
import com.intellij.python.reStructuredText.RestElementTypes;
|
||||
import com.intellij.python.reStructuredText.RestTokenTypes;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.formatter;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.formatter;
|
||||
|
||||
import com.intellij.formatting.*;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.jetbrains.rest.RestLanguage;
|
||||
import com.intellij.python.reStructuredText.RestLanguage;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -1,24 +1,10 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.inspections;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.inspections;
|
||||
|
||||
import com.intellij.codeInspection.LocalInspectionTool;
|
||||
import com.intellij.codeInspection.SuppressQuickFix;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.jetbrains.rest.RestBundle;
|
||||
import com.intellij.python.reStructuredText.RestBundle;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -1,25 +1,11 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.inspections;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.inspections;
|
||||
|
||||
import com.intellij.codeInspection.LocalQuickFix;
|
||||
import com.intellij.codeInspection.ProblemsHolder;
|
||||
import com.intellij.codeInspection.util.InspectionMessage;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.jetbrains.rest.validation.RestElementVisitor;
|
||||
import com.intellij.python.reStructuredText.validation.RestElementVisitor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.inspections;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.inspections;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.intellij.codeInspection.AddToInspectionOptionListFix;
|
||||
@@ -30,11 +16,11 @@ import com.intellij.psi.PsiElementVisitor;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.python.reStructuredText.*;
|
||||
import com.jetbrains.python.ReSTService;
|
||||
import com.jetbrains.python.psi.*;
|
||||
import com.jetbrains.rest.*;
|
||||
import com.jetbrains.rest.psi.RestDirectiveBlock;
|
||||
import com.jetbrains.rest.psi.RestRole;
|
||||
import com.intellij.python.reStructuredText.psi.RestDirectiveBlock;
|
||||
import com.intellij.python.reStructuredText.psi.RestRole;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashSet;
|
||||
@@ -1,24 +1,10 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.lexer;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.lexer;
|
||||
|
||||
import com.intellij.lexer.FlexAdapter;
|
||||
import com.intellij.lexer.MergingLexerAdapter;
|
||||
import com.intellij.psi.tree.TokenSet;
|
||||
import com.jetbrains.rest.RestTokenTypes;
|
||||
import com.intellij.python.reStructuredText.RestTokenTypes;
|
||||
|
||||
/**
|
||||
* User : catherine
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.jetbrains.rest.lexer;
|
||||
package com.intellij.python.reStructuredText.lexer;
|
||||
|
||||
import com.intellij.lexer.FlexLexer;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.jetbrains.rest.RestTokenTypes;
|
||||
|
||||
/* Auto generated File */
|
||||
%%
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.parsing;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.parsing;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.lang.PsiBuilder;
|
||||
import com.intellij.lang.PsiParser;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.jetbrains.rest.RestElementTypes;
|
||||
import com.jetbrains.rest.RestTokenTypes;
|
||||
import com.intellij.python.reStructuredText.RestElementTypes;
|
||||
import com.intellij.python.reStructuredText.RestTokenTypes;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.parsing;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.parsing;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.lang.ParserDefinition;
|
||||
@@ -11,11 +11,11 @@ import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.tree.IFileElementType;
|
||||
import com.intellij.psi.tree.TokenSet;
|
||||
import com.jetbrains.rest.RestFile;
|
||||
import com.jetbrains.rest.RestLanguage;
|
||||
import com.jetbrains.rest.RestTokenTypes;
|
||||
import com.jetbrains.rest.lexer.RestFlexLexer;
|
||||
import com.jetbrains.rest.psi.RestASTFactory;
|
||||
import com.intellij.python.reStructuredText.RestFile;
|
||||
import com.intellij.python.reStructuredText.RestLanguage;
|
||||
import com.intellij.python.reStructuredText.RestTokenTypes;
|
||||
import com.intellij.python.reStructuredText.lexer.RestFlexLexer;
|
||||
import com.intellij.python.reStructuredText.psi.RestASTFactory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -1,26 +1,12 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.psi;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.psi;
|
||||
|
||||
import com.intellij.extapi.psi.ASTWrapperPsiElement;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.jetbrains.rest.RestElementTypes;
|
||||
import com.jetbrains.rest.RestTokenTypes;
|
||||
import com.intellij.python.reStructuredText.RestElementTypes;
|
||||
import com.intellij.python.reStructuredText.RestTokenTypes;
|
||||
|
||||
/**
|
||||
* User : catherine
|
||||
@@ -0,0 +1,29 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* User : catherine
|
||||
*/
|
||||
public class RestDirectiveBlock extends RestElement {
|
||||
public RestDirectiveBlock(@NotNull final ASTNode node) {
|
||||
super(node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RestDirective:" + getNode().getElementType().toString();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getDirectiveName() {
|
||||
PsiElement child = this.getFirstChild();
|
||||
if (child != null)
|
||||
return child.getText();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.psi;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.psi;
|
||||
|
||||
import com.intellij.extapi.psi.ASTWrapperPsiElement;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.NavigatablePsiElement;
|
||||
import com.intellij.psi.PsiElementVisitor;
|
||||
import com.jetbrains.rest.validation.RestElementVisitor;
|
||||
import com.intellij.python.reStructuredText.validation.RestElementVisitor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class RestElement extends ASTWrapperPsiElement implements NavigatablePsiElement {
|
||||
@@ -0,0 +1,20 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* User : ktisha
|
||||
*/
|
||||
public class RestFieldList extends RestElement {
|
||||
public RestFieldList(@NotNull final ASTNode node) {
|
||||
super(node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RestFieldList:" + getNode().getElementType().toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +1,9 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.psi;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.jetbrains.rest.validation.RestElementVisitor;
|
||||
import com.intellij.python.reStructuredText.validation.RestElementVisitor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.psi;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
@@ -0,0 +1,21 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.psi;
|
||||
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.AbstractElementManipulator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* User : ktisha
|
||||
*/
|
||||
public class RestLineManipulator extends AbstractElementManipulator<RestLine> {
|
||||
|
||||
@Override
|
||||
public RestLine handleContentChange(@NotNull RestLine element, @NotNull TextRange range, String newContent) {
|
||||
final String oldText = element.getText();
|
||||
final String newText = oldText.substring(0, range.getStartOffset()) + newContent + oldText.substring(range.getEndOffset());
|
||||
element.updateText(newText);
|
||||
return element;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,25 +1,11 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.psi;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.jetbrains.rest.validation.RestElementVisitor;
|
||||
import com.intellij.python.reStructuredText.validation.RestElementVisitor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -1,24 +1,10 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.psi;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.jetbrains.rest.validation.RestElementVisitor;
|
||||
import com.intellij.python.reStructuredText.validation.RestElementVisitor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -0,0 +1,31 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.python.reStructuredText.validation.RestElementVisitor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* User : catherine
|
||||
*/
|
||||
public class RestRole extends RestElement {
|
||||
public RestRole(@NotNull final ASTNode node) {
|
||||
super(node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RestRole:" + getNode().getElementType().toString();
|
||||
}
|
||||
|
||||
public @NlsSafe String getRoleName() {
|
||||
String text = getNode().getText();
|
||||
return text.substring(1, text.length()-1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void acceptRestVisitor(RestElementVisitor visitor) {
|
||||
visitor.visitRole(this);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.psi;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.jetbrains.rest.validation.RestElementVisitor;
|
||||
import com.intellij.python.reStructuredText.validation.RestElementVisitor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.run;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.run;
|
||||
|
||||
import com.intellij.execution.ExecutionException;
|
||||
import com.intellij.execution.configurations.GeneralCommandLine;
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.jetbrains.rest.run.RestConfigurationEditor">
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.python.reStructuredText.run.RestConfigurationEditor">
|
||||
<grid id="27dc6" binding="myMainPanel" layout-manager="GridLayoutManager" row-count="7" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.run;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.run;
|
||||
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
@@ -13,7 +13,7 @@ import com.intellij.ui.components.JBLabel;
|
||||
import com.jetbrains.python.run.AbstractPyCommonOptionsForm;
|
||||
import com.jetbrains.python.run.AbstractPythonRunConfiguration;
|
||||
import com.jetbrains.python.run.PyCommonOptionsFormFactory;
|
||||
import com.jetbrains.rest.RestBundle;
|
||||
import com.intellij.python.reStructuredText.RestBundle;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
package com.jetbrains.rest.run;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.run;
|
||||
|
||||
import com.intellij.execution.configurations.ConfigurationFactory;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.run;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.run;
|
||||
|
||||
import com.intellij.execution.configurations.ConfigurationFactory;
|
||||
import com.intellij.execution.configurations.ConfigurationType;
|
||||
@@ -7,10 +7,10 @@ import com.intellij.execution.configurations.ConfigurationTypeUtil;
|
||||
import com.intellij.execution.configurations.RunConfiguration;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.jetbrains.python.run.PythonConfigurationFactoryBase;
|
||||
import com.jetbrains.rest.RestBundle;
|
||||
import com.jetbrains.rest.RestFileType;
|
||||
import com.jetbrains.rest.run.docutils.DocutilsRunConfiguration;
|
||||
import com.jetbrains.rest.run.sphinx.SphinxRunConfiguration;
|
||||
import com.intellij.python.reStructuredText.RestBundle;
|
||||
import com.intellij.python.reStructuredText.RestFileType;
|
||||
import com.intellij.python.reStructuredText.run.docutils.DocutilsRunConfiguration;
|
||||
import com.intellij.python.reStructuredText.run.sphinx.SphinxRunConfiguration;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -1,27 +1,13 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.run.docutils;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.run.docutils;
|
||||
|
||||
import com.intellij.execution.runners.ExecutionEnvironment;
|
||||
import com.intellij.ide.BrowserUtil;
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.python.reStructuredText.run.RestCommandLineState;
|
||||
import com.jetbrains.python.HelperPackage;
|
||||
import com.jetbrains.python.PythonHelper;
|
||||
import com.jetbrains.rest.run.RestCommandLineState;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.run.docutils;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.run.docutils;
|
||||
|
||||
import com.intellij.execution.actions.ConfigurationContext;
|
||||
import com.intellij.execution.actions.LazyRunConfigurationProducer;
|
||||
@@ -12,9 +12,9 @@ import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.jetbrains.rest.RestFileType;
|
||||
import com.jetbrains.rest.run.RestRunConfiguration;
|
||||
import com.jetbrains.rest.run.RestRunConfigurationType;
|
||||
import com.intellij.python.reStructuredText.run.RestRunConfiguration;
|
||||
import com.intellij.python.reStructuredText.run.RestRunConfigurationType;
|
||||
import com.intellij.python.reStructuredText.RestFileType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class DocutilsConfigurationProducer extends LazyRunConfigurationProducer<RestRunConfiguration> {
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.run.docutils;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.run.docutils;
|
||||
|
||||
import com.intellij.execution.ExecutionException;
|
||||
import com.intellij.execution.Executor;
|
||||
@@ -23,9 +9,9 @@ import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.options.SettingsEditor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.jetbrains.rest.PythonRestBundle;
|
||||
import com.jetbrains.rest.run.RestConfigurationEditor;
|
||||
import com.jetbrains.rest.run.RestRunConfiguration;
|
||||
import com.intellij.python.reStructuredText.run.RestConfigurationEditor;
|
||||
import com.intellij.python.reStructuredText.run.RestRunConfiguration;
|
||||
import com.intellij.python.reStructuredText.PythonRestBundle;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.run.docutils;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.run.docutils;
|
||||
|
||||
import com.intellij.ui.CollectionComboBoxModel;
|
||||
|
||||
@@ -1,26 +1,12 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.run.sphinx;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.run.sphinx;
|
||||
|
||||
import com.intellij.execution.runners.ExecutionEnvironment;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.python.reStructuredText.run.RestCommandLineState;
|
||||
import com.jetbrains.python.HelperPackage;
|
||||
import com.jetbrains.python.PythonHelper;
|
||||
import com.jetbrains.rest.run.RestCommandLineState;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.run.sphinx;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.run.sphinx;
|
||||
|
||||
import com.intellij.execution.actions.ConfigurationContext;
|
||||
import com.intellij.execution.actions.LazyRunConfigurationProducer;
|
||||
@@ -12,9 +12,9 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.jetbrains.rest.RestFile;
|
||||
import com.jetbrains.rest.run.RestRunConfiguration;
|
||||
import com.jetbrains.rest.run.RestRunConfigurationType;
|
||||
import com.intellij.python.reStructuredText.run.RestRunConfiguration;
|
||||
import com.intellij.python.reStructuredText.run.RestRunConfigurationType;
|
||||
import com.intellij.python.reStructuredText.RestFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class SphinxConfigurationProducer extends LazyRunConfigurationProducer<RestRunConfiguration> {
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.run.sphinx;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.run.sphinx;
|
||||
|
||||
import com.intellij.execution.ExecutionException;
|
||||
import com.intellij.execution.Executor;
|
||||
@@ -23,12 +9,12 @@ import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.options.SettingsEditor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.python.reStructuredText.run.RestConfigurationEditor;
|
||||
import com.intellij.python.reStructuredText.run.RestRunConfiguration;
|
||||
import com.jetbrains.python.PyPsiPackageUtil;
|
||||
import com.jetbrains.python.packaging.PyPackage;
|
||||
import com.jetbrains.python.packaging.PyPackageManager;
|
||||
import com.jetbrains.rest.PythonRestBundle;
|
||||
import com.jetbrains.rest.run.RestConfigurationEditor;
|
||||
import com.jetbrains.rest.run.RestRunConfiguration;
|
||||
import com.intellij.python.reStructuredText.PythonRestBundle;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.run.sphinx;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.run.sphinx;
|
||||
|
||||
import com.intellij.ui.CollectionComboBoxModel;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.spellchecker;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.spellchecker;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.impl.source.tree.LeafPsiElement;
|
||||
@@ -8,8 +8,8 @@ import com.intellij.spellchecker.inspections.PlainTextSplitter;
|
||||
import com.intellij.spellchecker.tokenizer.SpellcheckingStrategy;
|
||||
import com.intellij.spellchecker.tokenizer.TokenConsumer;
|
||||
import com.intellij.spellchecker.tokenizer.Tokenizer;
|
||||
import com.jetbrains.rest.RestLanguage;
|
||||
import com.jetbrains.rest.RestTokenTypes;
|
||||
import com.intellij.python.reStructuredText.RestLanguage;
|
||||
import com.intellij.python.reStructuredText.RestTokenTypes;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
@@ -29,11 +29,11 @@ public class RestSpellcheckerStrategy extends SpellcheckingStrategy {
|
||||
elementType == RestTokenTypes.CUSTOM_DIRECTIVE ||
|
||||
elementType == RestTokenTypes.REST_DJANGO_INJECTION ||
|
||||
elementType == RestTokenTypes.REST_INJECTION) {
|
||||
return EMPTY_TOKENIZER;
|
||||
return SpellcheckingStrategy.EMPTY_TOKENIZER;
|
||||
}
|
||||
if (element instanceof LeafPsiElement && element.getLanguage() == RestLanguage.INSTANCE) {
|
||||
return REST_ELEMENT_TOKENIZER;
|
||||
}
|
||||
return EMPTY_TOKENIZER;
|
||||
return SpellcheckingStrategy.EMPTY_TOKENIZER;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.jetbrains.rest.sphinx.SphinxBaseCommand.AskForWorkDir">
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.python.reStructuredText.sphinx.SphinxBaseCommand.AskForWorkDir">
|
||||
<grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.jetbrains.rest.sphinx;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.sphinx;
|
||||
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -8,7 +8,7 @@ import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.jetbrains.rest.RestPythonUtil;
|
||||
import com.intellij.python.reStructuredText.RestPythonUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.sphinx;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.sphinx;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.intellij.execution.ExecutionException;
|
||||
@@ -26,8 +26,8 @@ import com.jetbrains.python.run.PythonProcessRunner;
|
||||
import com.jetbrains.python.run.PythonTracebackFilter;
|
||||
import com.jetbrains.python.sdk.PythonSdkType;
|
||||
import com.jetbrains.python.sdk.PythonSdkUtil;
|
||||
import com.jetbrains.rest.PythonRestBundle;
|
||||
import com.jetbrains.rest.RestBundle;
|
||||
import com.intellij.python.reStructuredText.PythonRestBundle;
|
||||
import com.intellij.python.reStructuredText.RestBundle;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.sphinx
|
||||
|
||||
import org.jsoup.Jsoup
|
||||
|
||||
/** Filters out errors and displays unknown reStructuredText directives verbatim. */
|
||||
internal fun applySphinx(output: String): String {
|
||||
val html = Jsoup.parse(output)
|
||||
html.getElementsByClass("system-message").forEach { systemMessageElement ->
|
||||
systemMessageElement.getElementsByClass("literal-block").firstOrNull().let { literalBlockElement ->
|
||||
if (literalBlockElement != null) {
|
||||
systemMessageElement.replaceWith(literalBlockElement)
|
||||
}
|
||||
else {
|
||||
systemMessageElement.remove()
|
||||
}
|
||||
}
|
||||
}
|
||||
val problematicClassName = "problematic"
|
||||
html.getElementsByClass(problematicClassName).forEach { problematicElement ->
|
||||
problematicElement.removeClass(problematicClassName)
|
||||
}
|
||||
return html.toString()
|
||||
}
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.structureView;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.structureView;
|
||||
|
||||
import com.intellij.ide.structureView.StructureViewTreeElement;
|
||||
import com.intellij.ide.structureView.impl.common.PsiTreeElementBase;
|
||||
@@ -23,7 +9,7 @@ import com.intellij.psi.NavigatablePsiElement;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.jetbrains.rest.psi.RestTitle;
|
||||
import com.intellij.python.reStructuredText.psi.RestTitle;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.structureView;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.structureView;
|
||||
|
||||
import com.intellij.ide.structureView.StructureViewBuilder;
|
||||
import com.intellij.ide.structureView.StructureViewModel;
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.jetbrains.rest.structureView;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.structureView;
|
||||
|
||||
import com.intellij.ide.structureView.StructureViewModel;
|
||||
import com.intellij.ide.structureView.StructureViewModelBase;
|
||||
@@ -21,8 +7,8 @@ import com.intellij.ide.structureView.StructureViewTreeElement;
|
||||
import com.intellij.ide.util.treeView.smartTree.Sorter;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.jetbrains.rest.RestFile;
|
||||
import com.jetbrains.rest.psi.RestTitle;
|
||||
import com.intellij.python.reStructuredText.RestFile;
|
||||
import com.intellij.python.reStructuredText.psi.RestTitle;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.rest.validation;
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.python.reStructuredText.validation;
|
||||
|
||||
import com.intellij.lang.annotation.AnnotationHolder;
|
||||
import com.intellij.lang.annotation.Annotator;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.jetbrains.rest.RestFileType;
|
||||
import com.jetbrains.rest.RestLanguage;
|
||||
import com.intellij.python.reStructuredText.RestFileType;
|
||||
import com.intellij.python.reStructuredText.RestLanguage;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user