[Markdown] Update intellij-markdown maven coordinates and bump version to 0.3.0

GitOrigin-RevId: cbac9c92d30a1f2f8832dc7da7d053495517e307
This commit is contained in:
Ivan Posti
2022-02-09 12:16:10 +00:00
committed by intellij-monorepo-bot
parent bcca6ef32f
commit 321e185aae
15 changed files with 58 additions and 51 deletions
-10
View File
@@ -1,10 +0,0 @@
<component name="libraryTable">
<library name="intellij-markdown" type="repository">
<properties include-transitive-deps="false" maven-id="org.jetbrains:markdown:0.1.41" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/markdown/0.1.41/markdown-0.1.41.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
+18
View File
@@ -0,0 +1,18 @@
<component name="libraryTable">
<library name="jetbrains.markdown.jvm" type="repository">
<properties maven-id="org.jetbrains:markdown-jvm:0.3.0">
<exclude>
<dependency maven-id="org.jetbrains:annotations" />
<dependency maven-id="org.jetbrains.kotlin:kotlin-stdlib-common" />
<dependency maven-id="org.jetbrains.kotlin:kotlin-stdlib" />
</exclude>
</properties>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/markdown-jvm/0.3.0/markdown-jvm-0.3.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/markdown-jvm/0.3.0/markdown-jvm-0.3.0-sources.jar!/" />
</SOURCES>
</library>
</component>
@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.intellij.build
import groovy.transform.CompileStatic
@@ -767,9 +767,9 @@ final class CommunityLibraryLicenses {
jetbrainsLibrary("find-file-model"),
jetbrainsLibrary("git-learning-project"),
jetbrainsLibrary("intellij-coverage"),
jetbrainsLibrary("intellij-markdown"),
jetbrainsLibrary("intellij-test-discovery"),
jetbrainsLibrary("io.ktor.network.jvm"),
jetbrainsLibrary("jetbrains.markdown.jvm"),
jetbrainsLibrary("jetbrains.research.refactorinsight.kotlin.impl"),
jetbrainsLibrary("jps-build-script-dependencies-bootstrap"),
jetbrainsLibrary("jshell-frontend"),
@@ -819,4 +819,4 @@ final class CommunityLibraryLicenses {
jetbrainsLibrary("tips-idea-ce"),
jetbrainsLibrary("tips-pycharm-community"),
] as List<LibraryLicense>
}
}
@@ -34,7 +34,7 @@
<orderEntry type="library" name="caffeine" level="project" />
<orderEntry type="module" module-name="intellij.platform.collaborationTools.auth" />
<orderEntry type="library" name="kotlinx-coroutines-jdk8" level="project" />
<orderEntry type="library" name="intellij-markdown" level="project" />
<orderEntry type="library" name="jetbrains.markdown.jvm" level="project" />
<orderEntry type="library" scope="TEST" name="kotlin-test" level="project" />
</component>
</module>
@@ -11,7 +11,7 @@
<orderEntry type="module" module-name="intellij.platform.ide" />
<orderEntry type="module" module-name="intellij.platform.util.ui" />
<orderEntry type="library" name="kotlin-stdlib-jdk8" level="project" />
<orderEntry type="library" name="intellij-markdown" level="project" />
<orderEntry type="library" name="jetbrains.markdown.jvm" level="project" />
<orderEntry type="library" scope="TEST" name="JUnit4" level="project" />
<orderEntry type="library" scope="TEST" name="kotlin-test" level="project" />
</component>
+1 -1
View File
@@ -50,6 +50,6 @@
<orderEntry type="module" module-name="intellij.platform.collaborationTools.auth" />
<orderEntry type="module" module-name="intellij.platform.markdown.utils" />
<orderEntry type="library" name="kotlinx-coroutines-jdk8" level="project" />
<orderEntry type="library" name="intellij-markdown" level="project" />
<orderEntry type="library" name="jetbrains.markdown.jvm" level="project" />
</component>
</module>
+1 -1
View File
@@ -63,7 +63,7 @@
<orderEntry type="module" module-name="intellij.platform.structuralSearch" />
<orderEntry type="module" module-name="intellij.platform.duplicates.analysis" />
<orderEntry type="module" module-name="intellij.platform.codeStyle.impl" />
<orderEntry type="library" name="intellij-markdown" level="project" />
<orderEntry type="library" name="jetbrains.markdown.jvm" level="project" />
<orderEntry type="module" module-name="intellij.java.compiler.impl" />
<orderEntry type="library" name="Velocity" level="project" />
<orderEntry type="module" module-name="intellij.platform.builtInServer.impl" />
@@ -24,7 +24,7 @@
<orderEntry type="module" module-name="intellij.platform.core.ui" />
<orderEntry type="module" module-name="intellij.platform.images" />
<orderEntry type="module" module-name="intellij.platform.codeStyle.impl" />
<orderEntry type="library" name="intellij-markdown" level="project" />
<orderEntry type="library" name="jetbrains.markdown.jvm" level="project" />
<orderEntry type="module" module-name="intellij.platform.ide.util.io" />
<orderEntry type="module" module-name="intellij.platform.ide.util.netty" />
<orderEntry type="module" module-name="intellij.platform.collaborationTools" />
@@ -32,7 +32,7 @@ public class MarkdownLexerAdapter extends LexerBase {
@Override
public void start(@NotNull CharSequence buffer, int startOffset, int endOffset, int initialState) {
this.endOffset = endOffset;
delegateLexer.start(buffer, startOffset, endOffset);
delegateLexer.start(buffer, startOffset, endOffset, initialState);
}
@Override
@@ -23,7 +23,7 @@ class CommentAwareLinkReferenceDefinitionProvider : MarkerBlockProvider<MarkerPr
return emptyList()
}
val matchResult = LinkReferenceDefinitionProvider.matchLinkDefinition(pos.textFromPosition) ?: return emptyList()
val matchResult = LinkReferenceDefinitionProvider.matchLinkDefinition(pos.textFromPosition, 0) ?: return emptyList()
for ((i, range) in matchResult.withIndex()) {
productionHolder.addProduction(listOf(SequentialParser.Node(
addToRangeAndWiden(range, pos.offset), when (i) {
@@ -11,6 +11,7 @@ import org.intellij.markdown.parser.MarkerProcessor
import org.intellij.markdown.parser.MarkerProcessorFactory
import org.intellij.markdown.parser.ProductionHolder
import org.intellij.markdown.parser.constraints.MarkdownConstraints
import org.intellij.markdown.parser.constraints.getCharsEaten
import org.intellij.markdown.parser.markerblocks.MarkerBlockProvider
import org.intellij.markdown.parser.markerblocks.providers.AtxHeaderProvider
import org.intellij.markdown.parser.markerblocks.providers.LinkReferenceDefinitionProvider
@@ -25,7 +26,7 @@ class GFMCommentAwareMarkerProcessor(productionHolder: ProductionHolder, constra
.filterNot { it is LinkReferenceDefinitionProvider }
.plus(listOf(
GitHubTableMarkerProvider(),
AtxHeaderProvider(false),
AtxHeaderProvider(),
CommentAwareLinkReferenceDefinitionProvider()))
override fun populateConstraintsTokens(pos: LookaheadText.Position,
@@ -46,13 +47,11 @@ class GFMCommentAwareMarkerProcessor(productionHolder: ProductionHolder, constra
return
}
val type = when (constraints.getLastType()) {
'>' ->
MarkdownTokenTypes.BLOCK_QUOTE
'.', ')' ->
MarkdownTokenTypes.LIST_NUMBER
else ->
MarkdownTokenTypes.LIST_BULLET
check(constraints.types.isNotEmpty())
val type = when (constraints.types.last()) {
'>' -> MarkdownTokenTypes.BLOCK_QUOTE
'.', ')' -> MarkdownTokenTypes.LIST_NUMBER
else -> MarkdownTokenTypes.LIST_BULLET
}
val middleOffset = pos.offset - pos.offsetInCurrentLine + offset
val endOffset = min(pos.offset - pos.offsetInCurrentLine + constraints.getCharsEaten(pos.currentLine),
@@ -3,12 +3,12 @@ package org.intellij.plugins.markdown.lang.psi.impl;
import com.intellij.icons.AllIcons;
import com.intellij.lang.ASTNode;
import com.intellij.navigation.ItemPresentation;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import org.intellij.plugins.markdown.lang.MarkdownElementTypes;
import org.intellij.plugins.markdown.lang.psi.MarkdownElementVisitor;
import org.intellij.plugins.markdown.util.MarkdownPsiUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
@@ -43,14 +43,10 @@ public class MarkdownList extends MarkdownCompositePsiElementBase {
return new ItemPresentation() {
@Override
public String getPresentableText() {
PsiElement[] parentChildren = getParent().getChildren();
if (MarkdownPsiUtil.isSimpleNestedList(parentChildren)) {
ItemPresentation parentPresentation = getParent().getNode().getPsi(MarkdownListItem.class).getPresentation();
if (parentPresentation != null) {
return parentPresentation.getPresentableText();
}
final var nestedPresentation = getSimpleNestedPresentation(MarkdownList.this);
if (nestedPresentation != null) {
return nestedPresentation.getPresentableText();
}
return getNode().getElementType() == MarkdownElementTypes.ORDERED_LIST
? ORDERED_LIST_TEXT
: UNORDERED_LIST_TEXT;
@@ -58,14 +54,10 @@ public class MarkdownList extends MarkdownCompositePsiElementBase {
@Override
public String getLocationString() {
PsiElement[] parentChildren = getParent().getChildren();
if (MarkdownPsiUtil.isSimpleNestedList(parentChildren)) {
ItemPresentation parentPresentation = getParent().getNode().getPsi(MarkdownListItem.class).getPresentation();
if (parentPresentation != null) {
return parentPresentation.getLocationString();
}
final var nestedPresentation = getSimpleNestedPresentation(MarkdownList.this);
if (nestedPresentation != null) {
return nestedPresentation.getLocationString();
}
return null;
}
@@ -77,4 +69,12 @@ public class MarkdownList extends MarkdownCompositePsiElementBase {
}
};
}
private static @Nullable ItemPresentation getSimpleNestedPresentation(@NotNull MarkdownList element) {
final var parent = element.getParent();
if (MarkdownPsiUtil.isSimpleNestedList(parent.getChildren()) && parent instanceof MarkdownListItem) {
return ((MarkdownListItem)parent).getPresentation();
}
return null;
}
}
@@ -2,13 +2,13 @@
# Header with excessive spaces
# Header with missing spaces
#Header with missing spaces
# Minor header
#### Minor header with excessive spaces
#### Minor header with missing spaces
####Minor header with missing spaces
# Two headers one by one
@@ -40,7 +40,7 @@ One paragraph
* # Normal header in list
* # Header with missing space in list
* #Header with missing space in list
* # Header with excessive spaces in list
@@ -55,7 +55,8 @@ One paragraph
> # Normal header in blockquote
> # Header with missing space in blockquote
> #Header with missing space in
blockquote
> # Header with excessive spaces in blockquote
@@ -3,8 +3,7 @@
Sample paragraph with two spaces
Other paragraph with newline too early
# Other header
#Other header
```kotlin
val a = 12
@@ -1,4 +1,4 @@
#Mad party
# Mad party
* [IntelliJ platform overview](#intellij-platform-overview)
1. # First
@@ -16,4 +16,4 @@
* Mysterious item
#### Header 4
* [How to configure development environment](#configure-idea-development-environment)
* #Header 1
* # Header 1