diff --git a/AGENTS.md b/AGENTS.md index 38794a9..c1b4079 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,8 +7,7 @@ It serves as a reference for modern Eclipse development practices, covering both - **Eclipse Tycho**: Used for building Eclipse plugins, features, and products with Maven. - **Eclipse 4 (e4)**: Demonstrates dependency injection (Jakarta Inject), the application model (`.e4xmi`), and CSS styling. -- **Generic Editor & TM4E**: Examples of extending the Eclipse Generic Editor with TextMate grammars (TM4E) for languages like Asciidoc. -- **Language Server Protocol (LSP)**: Integrations for Asciidoc via Language Servers. +- **Generic Editor & TM4E**: Examples of extending the Eclipse Generic Editor with TextMate grammars (TM4E), for example for shell scripts. - **OSGi**: The underlying modular system for all Eclipse plugins. - **Java 25**: The project is configured to use JavaSE-25. @@ -17,9 +16,8 @@ It serves as a reference for modern Eclipse development practices, covering both The repository is organized into many OSGi bundles (plugins): - `com.vogella.ide.first`: Core UI components and product definition. -- `com.vogella.ide.editor.*`: Custom editors and extensions for the Generic Editor (Asciidoc, Gradle, Shell, Tasks). +- `com.vogella.ide.editor.*`: Custom editors and extensions for the Generic Editor (Gradle, Shell, Tasks). - `com.vogella.tasks.*`: A sample task management application split into model, services, and UI. -- `com.vogella.lsp.asciidoc.client` and `com.vogella.lsp.asciidoc.server` LSP client and server implementations. - `target-platform`: Contains the target definition file (`target-platform.target`) which specifies the Eclipse release and dependencies used for the build. - `updatesite`: The Tycho-generated p2 repository for distributing the plugins. @@ -71,7 +69,6 @@ The `updatesite` module has its own `pom.xml` only for this plugin. - **OSGi Metadata**: Always manage dependencies in `META-INF/MANIFEST.MF`. - **Extensions**: UI contributions are defined in `plugin.xml`. -- **Asciidoc Functionality**: As much as possible, Asciidoc functionality should be implemented via the LSP (Language Server Protocol) functionality in the `com.vogella.lsp.asciidoc.*` bundles. - **Dependency Injection**: Prefer `@Inject` (Jakarta) for accessing services and UI components in e4-based bundles. - **Coding Style**: Follow standard Eclipse/Java conventions. The project uses `UTF-8` encoding. - **Testing**: Test fragments (e.g., `com.vogella.tasks.services.tests`) use JUnit and are executed by `tycho-surefire-plugin` during the build. diff --git a/AsciidocSupport.adoc b/AsciidocSupport.adoc deleted file mode 100644 index e56a63e..0000000 --- a/AsciidocSupport.adoc +++ /dev/null @@ -1,54 +0,0 @@ -= Asciidoc Language Server Support -Vogella GmbH -:toc: - -This document describes the features supported by the Asciidoc Language Server implementation in the `com.vogella.lsp.asciidoc.*` plugins. - -== Content Type Mapping -The language server is registered for the `com.vogella.editor.asciidoc.contenttype` content type, which typically handles files with the `.adoc` extension. - -== Supported Features - -=== 1. Content Assist (Completions) -The server provides context-aware completions with prefix filtering: - -* **Dynamic File Completions**: -** `image::` and `image:`: Scans the `img/` subdirectory relative to the current file for image files (`.png`, `.jpg`, `.jpeg`, `.gif`). It supports filtering by prefix (e.g., typing `image::S` will list images starting with `S`). -** `include::`: Scans the current directory for other `.adoc` files. Also supports prefix filtering. -* **Snippets**: -** `= Title`: Quickly insert a document title. -** `== Subtitle`: Insert a level 1 section header. -** `image::[]`: Insert a standard image macro. -** `include::[]`: Insert a standard include macro. -** `Source Code Block`: Inserts a Java source code block template: -+ -[source, java] ----- -public class Example { - public static void main(String[] args) { - System.out.println("Hello World"); - } -} ----- - -=== 2. Hover Support -Hovering over text (below the first line) displays documentation about key AsciiDoc elements like `image::` and `include::` using Markdown formatting. - -=== 3. Code Lenses -The server scans the document for `TODO` markers and displays a **"Resolve TODO"** code lens above them. - -=== 4. Diagnostics & Quick Fixes -* **Validation**: The server automatically flags the string `PLACEHOLDER_TEXT` as a warning. -* **Quick Fix**: Provides a Code Action to replace `PLACEHOLDER_TEXT` with `replacement_text`. - -=== 5. Navigation & Symbols -* **Document Symbols**: Provides an outline view (currently returns a sample hierarchy: `MyClass` -> `myMethod`). -* **Go to Definition**: Supports basic "Go to Definition" logic for words under the cursor (currently uses a stub implementation). - -=== 6. Document Synchronization -* Supports **Full** text document synchronization (`didOpen`, `didChange`, `didClose`), ensuring the server always has the latest state of the editor. - -== Implementation Details -* **Client**: `com.vogella.lsp.asciidoc.client` -* **Server**: `com.vogella.lsp.asciidoc.server` -* **Technology**: Built using **Eclipse LSP4J** and integrated into Eclipse via **LSP4E**. diff --git a/PomlessAggregator.adoc b/PomlessAggregator.adoc index 1354b59..f3967c4 100644 --- a/PomlessAggregator.adoc +++ b/PomlessAggregator.adoc @@ -9,10 +9,9 @@ Tycho's `tycho-build` extension can derive a Maven model for a bundle, feature, product or update site from the files that already describe it, so most modules here have no `pom.xml`. The same mechanism can also derive an *aggregator*, which is what this repository uses to keep the module list out of the root `pom.xml`. -Two variants are shown: - -`build/pom.tycho`:: The reactor module list. The root `pom.xml` declares a single module, and the real list lives in a plain text file. -`lsp/pom.tycho`:: A group of related bundles collected in their own folder, listed by an aggregator of their own. +`build/pom.tycho` holds the reactor module list. +The root `pom.xml` declares a single module, and the real list lives in a plain text file. +The same mechanism also works for a group of related bundles collected in their own folder, listed by a `pom.tycho` of their own, which is how the (since removed) `lsp` folder of this repository was built. == How it works @@ -24,7 +23,7 @@ The artifactId is the folder name, and every non-comment line becomes a `` first line and deletes them when the JVM exits. @@ -66,7 +65,7 @@ Two settings make the nested layout work. ---- By default a pomless module looks for its parent in `..`. -That holds for a bundle at the repository root, but not for one nested inside `lsp/`, which would look in `lsp/` and find nothing. +That holds for a bundle at the repository root, but not for one nested inside a group folder, which would look in that folder and find nothing. Pointing the property at the directory that contains `.mvn` makes every pomless module resolve the root pom as its parent, whatever its depth. `maven.multiModuleProjectDirectory` is resolved by Maven itself, so the setting keeps working when the build is started from a subdirectory. diff --git a/build/pom.tycho b/build/pom.tycho index e394a4c..3268cf0 100644 --- a/build/pom.tycho +++ b/build/pom.tycho @@ -24,13 +24,9 @@ ../com.vogella.tasks.extendedsupplier ../com.vogella.preferences.page ../com.vogella.ide.editor.gradle -../com.vogella.ide.editor.asciidoc ../com.vogella.ide.editor.shell ../com.vogella.ide.debugtools -# Language server example, grouped in its own folder with its own pom.tycho -../lsp - ../z.ex.search ../com.vogella.ide.iconreplacer ../com.vogella.ide.parallelstart diff --git a/com.vogella.ide.editor.asciidoc/.classpath b/com.vogella.ide.editor.asciidoc/.classpath deleted file mode 100644 index 7a42e53..0000000 --- a/com.vogella.ide.editor.asciidoc/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/com.vogella.ide.editor.asciidoc/.project b/com.vogella.ide.editor.asciidoc/.project deleted file mode 100644 index 4579e56..0000000 --- a/com.vogella.ide.editor.asciidoc/.project +++ /dev/null @@ -1,45 +0,0 @@ - - - com.vogella.ide.editor.asciidoc - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - - - 1765183821315 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/com.vogella.ide.editor.asciidoc/.settings/org.eclipse.core.resources.prefs b/com.vogella.ide.editor.asciidoc/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0..0000000 --- a/com.vogella.ide.editor.asciidoc/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/com.vogella.ide.editor.asciidoc/.settings/org.eclipse.jdt.core.prefs b/com.vogella.ide.editor.asciidoc/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index c540a97..0000000 --- a/com.vogella.ide.editor.asciidoc/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,9 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=25 -org.eclipse.jdt.core.compiler.compliance=25 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=25 diff --git a/com.vogella.ide.editor.asciidoc/META-INF/MANIFEST.MF b/com.vogella.ide.editor.asciidoc/META-INF/MANIFEST.MF deleted file mode 100644 index 4bf7e5a..0000000 --- a/com.vogella.ide.editor.asciidoc/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Asciidoc -Bundle-SymbolicName: com.vogella.ide.editor.asciidoc;singleton:=true -Bundle-Version: 1.0.0.qualifier -Require-Bundle: org.eclipse.core.contenttype, - org.eclipse.ui, - org.eclipse.tm4e.registry, - org.eclipse.ui.genericeditor;bundle-version="1.3.400", - org.eclipse.tm4e.core;bundle-version="0.14.0", - org.eclipse.tm4e.languageconfiguration;bundle-version="0.14.0", - org.eclipse.tm4e.markdown;bundle-version="0.14.0", - org.eclipse.tm4e.ui;bundle-version="0.14.0", - org.eclipse.jface.text;bundle-version="3.26.0", - org.eclipse.ui.ide, - org.eclipse.core.runtime;bundle-version="3.32.0" -Bundle-Vendor: VOGELLA -Automatic-Module-Name: com.vogella.ide.editor.asciidoc -Bundle-RequiredExecutionEnvironment: JavaSE-25 -Import-Package: org.eclipse.core.resources, - org.eclipse.e4.core.contexts;version="[1.7.0,2.0.0)", - org.eclipse.ui, - org.eclipse.ui.texteditor diff --git a/com.vogella.ide.editor.asciidoc/build.properties b/com.vogella.ide.editor.asciidoc/build.properties deleted file mode 100644 index 69320f5..0000000 --- a/com.vogella.ide.editor.asciidoc/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - language-configurations/,\ - icons/,\ - syntaxes/ diff --git a/com.vogella.ide.editor.asciidoc/icons/asciidoc.png b/com.vogella.ide.editor.asciidoc/icons/asciidoc.png deleted file mode 100644 index dee6fb3..0000000 Binary files a/com.vogella.ide.editor.asciidoc/icons/asciidoc.png and /dev/null differ diff --git a/com.vogella.ide.editor.asciidoc/icons/asciidoc@2x.png b/com.vogella.ide.editor.asciidoc/icons/asciidoc@2x.png deleted file mode 100644 index f902af6..0000000 Binary files a/com.vogella.ide.editor.asciidoc/icons/asciidoc@2x.png and /dev/null differ diff --git a/com.vogella.ide.editor.asciidoc/language-configurations/asciidoc.json b/com.vogella.ide.editor.asciidoc/language-configurations/asciidoc.json deleted file mode 100644 index 3d71906..0000000 --- a/com.vogella.ide.editor.asciidoc/language-configurations/asciidoc.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "comments": { - "lineComment": "//", - "blockComment": [ - "////", - "////" - ] - }, - "brackets": [ - [ - "{", - "}" - ], - [ - "[", - "]" - ], - [ - "(", - ")" - ], - [ - "<", - ">" - ] - ], - "autoClosingPairs": [ - { - "open": "{", - "close": "}" - }, - { - "open": "[", - "close": "]" - }, - { - "open": "(", - "close": ")" - }, - { - "open": "'", - "close": "'", - "notIn": [ - "string", - "comment" - ] - }, - { - "open": "\"", - "close": "\"", - "notIn": [ - "string" - ] - }, - { - "open": "`", - "close": "`", - "notIn": [ - "string", - "comment" - ] - }, - { - "open": "/**", - "close": " */", - "notIn": [ - "string" - ] - }, - { - "open": "////", - "close": " ////", - "notIn": [ - "string", - "comment" - ] - } - ], - "surroundingPairs": [ - [ - "{", - "}" - ], - [ - "[", - "]" - ], - [ - "(", - ")" - ], - [ - "<", - ">" - ], - [ - "'", - "'" - ], - [ - "\"", - "\"" - ], - [ - "`", - "`" - ], - [ - "_", - "_" - ], - [ - "*", - "*" - ], - [ - "^", - "^" - ], - [ - "~", - "~" - ], - [ - "#", - "#" - ] - ] -} \ No newline at end of file diff --git a/com.vogella.ide.editor.asciidoc/plugin.xml b/com.vogella.ide.editor.asciidoc/plugin.xml deleted file mode 100644 index f69be4e..0000000 --- a/com.vogella.ide.editor.asciidoc/plugin.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/com.vogella.ide.editor.asciidoc/syntaxes/asciidoc.json b/com.vogella.ide.editor.asciidoc/syntaxes/asciidoc.json deleted file mode 100644 index 80281e2..0000000 --- a/com.vogella.ide.editor.asciidoc/syntaxes/asciidoc.json +++ /dev/null @@ -1,6674 +0,0 @@ -{ - "name": "AsciiDoc", - "scopeName": "text.asciidoc", - "fileTypes": [ - "ad", - "asc", - "adoc", - "asciidoc", - "adoc.txt" - ], - "limitLineLength": false, - "maxTokensPerLine": 100, - "patterns": [ - { - "include": "#comment" - }, - { - "include": "#callout-list-item" - }, - { - "include": "#titles" - }, - { - "include": "#attribute-entry" - }, - { - "include": "#blocks" - }, - { - "include": "#block-title" - }, - { - "include": "#tables" - }, - { - "include": "#horizontal-rule" - }, - { - "include": "#list" - }, - { - "include": "#inlines" - }, - { - "include": "#block-attribute" - }, - { - "include": "#line-break" - } - ], - "repository": { - "blocks": { - "patterns": [ - { - "include": "#front-matter-block" - }, - { - "include": "#comment-paragraph" - }, - { - "include": "#admonition-paragraph" - }, - { - "include": "#quote-paragraph" - }, - { - "include": "#listing-paragraph" - }, - { - "include": "#source-paragraphs" - }, - { - "include": "#passthrough-paragraph" - }, - { - "include": "#example-paragraph" - }, - { - "include": "#sidebar-paragraph" - }, - { - "include": "#literal-paragraph" - }, - { - "include": "#open-block" - } - ] - }, - "source-paragraphs": { - "patterns": [ - { - "include": "#source-asciidoctor" - }, - { - "include": "#source-markdown" - } - ] - }, - "tables": { - "patterns": [ - { - "include": "#table-psv" - }, - { - "include": "#table-nested" - }, - { - "include": "#table-csv" - }, - { - "include": "#table-dsv" - } - ] - }, - "tables-includes": { - "patterns": [ - { - "include": "#comment" - }, - { - "include": "#callout-list-item" - }, - { - "include": "#attribute-entry" - }, - { - "include": "#block-title" - }, - { - "include": "#explicit-paragraph" - }, - { - "include": "#section" - }, - { - "include": "#blocks" - }, - { - "include": "#list" - }, - { - "include": "#inlines" - }, - { - "include": "#line-break" - } - ] - }, - "inlines": { - "patterns": [ - { - "include": "#typographic-quotes" - }, - { - "include": "#strong" - }, - { - "include": "#monospace" - }, - { - "include": "#emphasis" - }, - { - "include": "#superscript" - }, - { - "include": "#subscript" - }, - { - "include": "#mark" - }, - { - "include": "#general-block-macro" - }, - { - "include": "#anchor-macro" - }, - { - "include": "#footnote-macro" - }, - { - "include": "#image-macro" - }, - { - "include": "#kbd-macro" - }, - { - "include": "#link-macro" - }, - { - "include": "#stem-macro" - }, - { - "include": "#menu-macro" - }, - { - "include": "#passthrough-macro" - }, - { - "include": "#xref-macro" - }, - { - "include": "#attribute-reference" - }, - { - "include": "#characters" - }, - { - "include": "#bibtex-macro" - }, - { - "include": "#bibliography-anchor" - } - ] - }, - "attribute-entry": { - "patterns": [ - { - "name": "meta.definition.attribute-entry.asciidoc", - "begin": "^(:)(!?\\w.*?)(:)(\\p{Blank}+.+\\p{Blank}(?:\\+|\\\\))$", - "beginCaptures": { - "1": { - "name": "punctuation.separator.attribute-entry.asciidoc" - }, - "2": { - "name": "support.constant.attribute-name.asciidoc" - }, - "3": { - "name": "punctuation.separator.attribute-entry.asciidoc" - }, - "4": { - "name": "string.unquoted.attribute-value.asciidoc", - "patterns": [ - { - "include": "#inlines" - }, - { - "include": "#hard-break-backslash" - }, - { - "include": "#line-break" - }, - { - "include": "#line-break-backslash" - } - ] - } - }, - "contentName": "string.unquoted.attribute-value.asciidoc", - "patterns": [ - { - "include": "#inlines" - }, - { - "include": "#hard-break-backslash" - }, - { - "include": "#line-break" - }, - { - "include": "#line-break-backslash" - } - ], - "end": "^\\p{Blank}+.+$(?)(?=(?: ?)*$)", - "captures": { - "2": { - "name": "constant.other.symbol.asciidoc" - }, - "4": { - "name": "constant.numeric.asciidoc" - }, - "5": { - "name": "constant.other.symbol.asciidoc" - } - } - } - ] - }, - "block-title": { - "patterns": [ - { - "begin": "^\\.([^\\p{Blank}.].*)", - "captures": { - "1": { - "name": "markup.heading.blocktitle.asciidoc" - } - }, - "end": "$" - } - ] - }, - "callout-list-item": { - "patterns": [ - { - "name": "callout.asciidoc", - "match": "^(<)(\\d+)(>)\\p{Blank}+(.*)$", - "captures": { - "1": { - "name": "constant.other.symbol.asciidoc" - }, - "2": { - "name": "constant.numeric.asciidoc" - }, - "3": { - "name": "constant.other.symbol.asciidoc" - }, - "4": { - "patterns": [ - { - "include": "#inlines" - } - ] - } - } - } - ] - }, - "comment": { - "patterns": [ - { - "name": "comment.block.asciidoc", - "begin": "^(/{4,})$", - "patterns": [ - { - "include": "#inlines" - } - ], - "end": "^\\1$" - }, - { - "name": "comment.inline.asciidoc", - "match": "^/{2}([^/].*)?$" - } - ] - }, - "hard-break-backslash": { - "patterns": [ - { - "match": "(?<=\\S)\\p{Blank}+(\\+ \\\\)$", - "captures": { - "1": { - "name": "constant.other.symbol.hard-break.asciidoc" - } - } - } - ] - }, - "horizontal-rule": { - "patterns": [ - { - "name": "constant.other.symbol.horizontal-rule.asciidoc", - "match": "^(?:'|<){3,}$|^ {0,3}([-\\*'])( *)\\1\\2\\1$" - } - ] - }, - "include-directive": { - "patterns": [ - { - "match": "^(include)(::)([^\\[]+)(\\[)(.*?)(\\])$", - "captures": { - "1": { - "name": "entity.name.function.asciidoc" - }, - "2": { - "name": "punctuation.separator.asciidoc" - }, - "3": { - "name": "markup.link.asciidoc", - "patterns": [ - { - "include": "#attribute-reference" - } - ] - }, - "4": { - "name": "punctuation.separator.asciidoc" - }, - "5": { - "name": "string.unquoted.asciidoc", - "patterns": [ - { - "include": "#attribute-reference" - } - ] - }, - "6": { - "name": "punctuation.separator.asciidoc" - } - } - } - ] - }, - "keywords": { - "patterns": [ - { - "comment": "Admonition", - "name": "entity.name.function.asciidoc", - "match": "(NOTE|TIP|IMPORTANT|WARNING|CAUTION)" - }, - { - "comment": "Paragraph or verbatim", - "name": "entity.name.function.asciidoc", - "match": "(comment|example|literal|listing|normal|pass|quote|sidebar|source|verse|abstract|partintro)" - }, - { - "comment": "Diagram", - "name": "entity.name.function.asciidoc", - "match": "(actdiag|blockdiag|ditaa|graphviz|meme|mermaid|nwdiag|packetdiag|pikchr|plantuml|rackdiag|seqdiag|shaape|wavedrom)" - }, - { - "comment": "Others", - "name": "entity.name.function.asciidoc", - "match": "(sect[1-4]|preface|colophon|dedication|glossary|bibliography|synopsis|appendix|index|normal|partintro|music|latex|stem)" - } - ] - }, - "line-break-backslash": { - "patterns": [ - { - "match": "(?<=\\S)\\p{Blank}+(\\\\)$", - "captures": { - "1": { - "name": "variable.line-break.asciidoc" - } - } - } - ] - }, - "line-break": { - "patterns": [ - { - "match": "(?<=\\S)\\p{Blank}+(\\+)$", - "captures": { - "1": { - "name": "variable.line-break.asciidoc" - } - } - } - ] - }, - "list": { - "patterns": [ - { - "match": "^\\s*(-)\\p{Blank}(\\[[\\p{Blank}\\*x]\\])(?=\\p{Blank})", - "name": "markup.todo.asciidoc", - "captures": { - "1": { - "name": "markup.list.bullet.asciidoc" - }, - "2": { - "name": "markup.todo.box.asciidoc" - } - } - }, - { - "name": "markup.list.asciidoc", - "match": "^\\p{Blank}*(-|\\*{1,5}|\\u2022{1,5})(?=\\p{Blank})", - "captures": { - "1": { - "name": "markup.list.bullet.asciidoc" - } - } - }, - { - "name": "markup.list.asciidoc", - "match": "^\\p{Blank}*(\\.{1,5}|\\d+\\.|[a-zA-Z]\\.|[IVXivx]+\\))(?=\\p{Blank})", - "captures": { - "1": { - "name": "markup.list.bullet.asciidoc" - } - } - }, - { - "name": "markup.heading.list.asciidoc", - "match": "^\\p{Blank}*(.*?\\S)(:{2,4}|;;)($|\\p{Blank}+)", - "captures": { - "1": { - "patterns": [ - { - "include": "#link-macro" - }, - { - "include": "#attribute-reference" - } - ] - }, - "2": { - "name": "markup.list.bullet.asciidoc" - } - } - } - ] - }, - "titles": { - "patterns": [ - { - "name": "markup.heading.heading-5.asciidoc", - "begin": "^((?:=|#){6})([\\p{Blank}]+)(?=\\S+)", - "end": "$", - "beginCaptures": { - "1": { - "name": "markup.heading.marker.asciidoc" - }, - "2": { - "name": "markup.heading.space.asciidoc" - } - }, - "patterns": [ - { - "include": "$self" - } - ] - }, - { - "name": "markup.heading.heading-4.asciidoc", - "begin": "^((?:=|#){5})([\\p{Blank}]+)(?=\\S+)", - "end": "$", - "beginCaptures": { - "1": { - "name": "markup.heading.marker.asciidoc" - }, - "2": { - "name": "markup.heading.space.asciidoc" - } - }, - "patterns": [ - { - "include": "$self" - } - ] - }, - { - "name": "markup.heading.heading-3.asciidoc", - "begin": "^((?:=|#){4})([\\p{Blank}]+)(?=\\S+)", - "end": "$", - "beginCaptures": { - "1": { - "name": "markup.heading.marker.asciidoc" - }, - "2": { - "name": "markup.heading.space.asciidoc" - } - }, - "patterns": [ - { - "include": "$self" - } - ] - }, - { - "name": "markup.heading.heading-2.asciidoc", - "begin": "^((?:=|#){3})([\\p{Blank}]+)(?=\\S+)", - "end": "$", - "beginCaptures": { - "1": { - "name": "markup.heading.marker.asciidoc" - }, - "2": { - "name": "markup.heading.space.asciidoc" - } - }, - "patterns": [ - { - "include": "$self" - } - ] - }, - { - "name": "markup.heading.heading-1.asciidoc", - "begin": "^((?:=|#){2})([\\p{Blank}]+)(?=\\S+)", - "end": "$", - "beginCaptures": { - "1": { - "name": "markup.heading.marker.asciidoc" - }, - "2": { - "name": "markup.heading.space.asciidoc" - } - }, - "patterns": [ - { - "include": "$self" - } - ] - }, - { - "name": "markup.heading.heading-0.asciidoc", - "begin": "^((?:=|#){1})([\\p{Blank}]+)(?=\\S+)", - "end": "$", - "beginCaptures": { - "1": { - "name": "markup.heading.marker.asciidoc" - }, - "2": { - "name": "markup.heading.space.asciidoc" - } - }, - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "anchor-macro": { - "patterns": [ - { - "name": "markup.other.anchor.asciidoc", - "match": "(?\\(\\)\\[\\];])((?\\(\\)\\[\\];])((?\\+{2,3}|\\${2})(.*?)(\\k)", - "captures": { - "1": { - "name": "markup.meta.attribute-list.asciidoc" - }, - "3": { - "name": "support.constant.asciidoc" - }, - "4": { - "name": "string.unquoted.asciidoc", - "patterns": [ - { - "include": "text.html.basic" - } - ] - }, - "5": { - "name": "support.constant.asciidoc" - } - } - }, - { - "name": "markup.macro.inline.passthrough.asciidoc", - "begin": "(?>))", - "captures": { - "1": { - "name": "constant.asciidoc" - }, - "2": { - "name": "markup.meta.attribute-list.asciidoc" - }, - "3": { - "name": "string.unquoted.asciidoc" - }, - "4": { - "name": "constant.asciidoc" - } - } - }, - { - "name": "markup.reference.xref.asciidoc", - "begin": "(?(?:^\\[(NOTE|TIP|IMPORTANT|WARNING|CAUTION)((?:,|#|\\.|%)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(NOTE|TIP|IMPORTANT|WARNING|CAUTION)((?:,|#|\\.|%)([^,\\]]+))*\\]$", - "captures": { - "0": { - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "example block", - "begin": "^(={4,})\\s*$", - "patterns": [ - { - "include": "#inlines" - }, - { - "include": "#list" - } - ], - "end": "(?<=\\1)" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "patterns": [ - { - "include": "#inlines" - }, - { - "include": "#list" - } - ], - "end": "(?<=\\1)" - } - ], - "end": "((?<=--|====)$|^\\p{Blank}*$)" - }, - { - "name": "markup.admonition.asciidoc", - "begin": "^(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\\:\\p{Blank}+", - "captures": { - "1": { - "name": "entity.name.function.asciidoc" - } - }, - "patterns": [ - { - "include": "#inlines" - } - ], - "end": "^\\p{Blank}*$" - } - ] - }, - "comment-paragraph": { - "patterns": [ - { - "name": "comment.block.asciidoc", - "begin": "(?=(?>(?:^\\[(comment)((?:,|#|\\.|%)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(comment)((?:,|#|\\.|%)([^,\\]]+))*\\]$", - "captures": { - "0": { - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#block-title" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "patterns": [ - { - "include": "#inlines" - }, - { - "include": "#list" - } - ], - "end": "^(\\1)$" - }, - { - "include": "#inlines" - } - ], - "end": "((?<=--)$|^\\p{Blank}*$)" - } - ] - }, - "example-paragraph": { - "patterns": [ - { - "name": "markup.block.example.asciidoc", - "begin": "(?=(?>(?:^\\[(example)((?:,|#|\\.|%)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(example)((?:,|#|\\.|%)([^,\\]]+))*\\]$", - "captures": { - "0": { - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#block-title" - }, - { - "comment": "example block", - "begin": "^(={4,})$", - "patterns": [ - { - "include": "$self" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})$", - "patterns": [ - { - "include": "$self" - } - ], - "end": "^(\\1)$" - }, - { - "include": "#inlines" - } - ], - "end": "((?<=--|====)$|^\\p{Blank}*$)" - }, - { - "name": "markup.block.example.asciidoc", - "begin": "^(={4,})$", - "patterns": [ - { - "include": "$self" - } - ], - "end": "^(\\1)$" - } - ] - }, - "front-matter-block": { - "patterns": [ - { - "name": "markup.block.front-matter.asciidoc", - "begin": "\\A(-{3}$)", - "patterns": [ - { - "include": "source.yaml" - } - ], - "end": "^(\\1)$" - } - ] - }, - "listing-paragraph": { - "patterns": [ - { - "name": "markup.block.listing.asciidoc", - "begin": "(?=(?>(?:^\\[(listing)((?:,|#|\\.|%)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(listing)((?:,|#|\\.|%)([^,\\]]+))*\\]$", - "captures": { - "0": { - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "end": "^(\\1)$" - }, - { - "include": "#inlines" - } - ], - "end": "((?<=--)$|^\\p{Blank}*$)" - } - ] - }, - "literal-paragraph": { - "patterns": [ - { - "name": "markup.block.literal.asciidoc", - "begin": "(?=(?>(?:^\\[(literal)((?:,|#|\\.|%)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(literal)((?:,|#|\\.|%)([^,\\]]+))*\\]$", - "captures": { - "0": { - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#block-title" - }, - { - "comment": "literal block", - "begin": "^(\\.{4,})$", - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "end": "^(\\1)$" - }, - { - "include": "#inlines" - } - ], - "end": "((?<=--|\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.block.literal.asciidoc", - "begin": "^(\\.{4,})$", - "end": "^(\\1)$" - } - ] - }, - "open-block": { - "patterns": [ - { - "name": "markup.block.open.asciidoc", - "begin": "^(-{2})$", - "beginCaptures": { - "1": { - "name": "constant.other.symbol.asciidoc" - } - }, - "patterns": [ - { - "include": "$self" - } - ], - "end": "^(\\1)$", - "endCaptures": { - "1": { - "name": "constant.other.symbol.asciidoc" - } - } - } - ] - }, - "passthrough-paragraph": { - "patterns": [ - { - "name": "markup.block.passthrough.asciidoc", - "begin": "(?=(?>(?:^\\[(pass)((?:,|#|\\.|%)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(pass)((?:,|#|\\.|%)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#block-title" - }, - { - "comment": "passthrough block", - "begin": "^(\\+{4,})\\s*$", - "patterns": [ - { - "include": "text.html.basic" - } - ], - "end": "(?<=\\1)" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "patterns": [ - { - "include": "text.html.basic" - } - ], - "end": "(?<=\\1)" - } - ], - "end": "((?<=--|\\+\\+)$|^\\p{Blank}*$)" - }, - { - "name": "markup.block.passthrough.asciidoc", - "begin": "(^\\+{4,}$)", - "patterns": [ - { - "include": "text.html.basic" - } - ], - "end": "\\1" - } - ] - }, - "quote-paragraph": { - "patterns": [ - { - "name": "markup.italic.quotes.asciidoc", - "begin": "(?=(?>(?:^\\[(quote|verse)((?:,|#|\\.|%)([^,\\]]+))*\\]$)))", - "patterns": [ - { - "match": "^\\[(quote|verse)((?:,|#|\\.|%)([^,\\]]+))*\\]$", - "captures": { - "0": { - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#block-title" - }, - { - "include": "#inlines" - }, - { - "comment": "quotes block", - "begin": "^([_]{4,})\\s*$", - "patterns": [ - { - "include": "#inlines" - }, - { - "include": "#list" - } - ], - "end": "(?<=\\1)" - }, - { - "comment": "air quotes", - "begin": "^(\"{2})\\s*$", - "patterns": [ - { - "include": "#inlines" - }, - { - "include": "#list" - } - ], - "end": "(?<=\\1)" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "patterns": [ - { - "include": "#inlines" - }, - { - "include": "#list" - } - ], - "end": "(?<=\\1)$" - } - ], - "end": "((?<=____|\"\"|--)$|^\\p{Blank}*$)" - }, - { - "name": "markup.italic.quotes.asciidoc", - "begin": "^(\"\")$", - "patterns": [ - { - "include": "#inlines" - }, - { - "include": "#list" - } - ], - "end": "^\\1$" - }, - { - "name": "markup.italic.quotes.asciidoc", - "begin": "^\\p{Blank}*(>) ", - "patterns": [ - { - "include": "#inlines" - }, - { - "include": "#list" - } - ], - "end": "^\\p{Blank}*?$" - } - ] - }, - "sidebar-paragraph": { - "patterns": [ - { - "name": "markup.block.sidebar.asciidoc", - "begin": "(?=(?>(?:^\\[(sidebar)((?:,|#|\\.|%)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(sidebar)((?:,|#|\\.|%)([^,\\]]+))*\\]$", - "captures": { - "0": { - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#block-title" - }, - { - "comment": "sidebar block", - "begin": "^(\\*{4,})$", - "patterns": [ - { - "include": "$self" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})$", - "patterns": [ - { - "include": "$self" - } - ], - "end": "^(\\1)$" - }, - { - "include": "#inlines" - } - ], - "end": "((?<=--|\\*\\*\\*\\*)$|^\\p{Blank}*$)" - }, - { - "name": "markup.block.sidebar.asciidoc", - "begin": "^(\\*{4,})$", - "patterns": [ - { - "include": "$self" - } - ], - "end": "^(\\1)$" - } - ] - }, - "table-csv": { - "patterns": [ - { - "name": "markup.table.csv.asciidoc", - "begin": "^(,===)$", - "beginCaptures": { - "0": { - "name": "markup.table.delimiter.asciidoc" - } - }, - "contentName": "string.unquoted.asciidoc", - "patterns": [ - { - "include": "text.csv" - }, - { - "comment": "cell separator", - "match": ",", - "captures": { - "0": { - "name": "markup.table.cell.delimiter.asciidoc" - } - } - }, - { - "include": "#general-block-macro" - } - ], - "end": "^(\\1)$", - "endCaptures": { - "0": { - "name": "markup.table.delimiter.asciidoc" - } - } - } - ] - }, - "table-dsv": { - "patterns": [ - { - "name": "markup.table.dsv.asciidoc", - "begin": "^(:===)$", - "beginCaptures": { - "0": { - "name": "markup.table.delimiter.asciidoc" - } - }, - "contentName": "string.unquoted.asciidoc", - "patterns": [ - { - "comment": "cell separator", - "match": ":", - "captures": { - "0": { - "name": "markup.table.cell.delimiter.asciidoc" - } - } - }, - { - "include": "#general-block-macro" - } - ], - "end": "^(\\1)$", - "endCaptures": { - "0": { - "name": "markup.table.delimiter.asciidoc" - } - } - } - ] - }, - "table-nested": { - "patterns": [ - { - "name": "markup.table.nested.asciidoc", - "begin": "^(!===)$", - "beginCaptures": { - "0": { - "name": "markup.table.delimiter.asciidoc" - } - }, - "contentName": "markup.table.content.asciidoc", - "patterns": [ - { - "comment": "cell separator and attributes", - "match": "(^|[^\\p{Blank}\\\\]*)(?(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(c))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(c))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.c", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.c" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.c", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.c" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.c", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.c" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.clojure.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(clojure))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(clojure))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.clojure", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.clojure" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.clojure", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.clojure" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.clojure", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.clojure" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.coffee.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(coffee-?(script)?))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(coffee-?(script)?))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.coffee", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.coffee" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.coffee", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.coffee" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.coffee", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.coffee" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.cpp.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(c(pp|\\+\\+)))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(c(pp|\\+\\+)))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.cpp", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.cpp" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.cpp", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.cpp" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.cpp", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.cpp" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.css.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(css))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(css))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.css", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.css" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.css", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.css" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.css", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.css" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.cs.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(cs(harp)?))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(cs(harp)?))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.cs", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.cs" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.cs", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.cs" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.cs", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.cs" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.diff.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(diff|patch|rej))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(diff|patch|rej))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.diff", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.diff" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.diff", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.diff" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.diff", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.diff" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.dockerfile.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(docker(file)?))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(docker(file)?))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.dockerfile", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.dockerfile" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.dockerfile", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.dockerfile" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.dockerfile", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.dockerfile" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.elixir.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(elixir))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(elixir))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.elixir", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.elixir" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.elixir", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.elixir" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.elixir", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.elixir" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.elm.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(elm))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(elm))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.elm", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.elm" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.elm", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.elm" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.elm", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.elm" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.erlang.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(erlang))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(erlang))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.erlang", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.erlang" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.erlang", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.erlang" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.erlang", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.erlang" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.go.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(go(lang)?))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(go(lang)?))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.go", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.go" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.go", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.go" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.go", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.go" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.groovy.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(groovy))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(groovy))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.groovy", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.groovy" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.groovy", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.groovy" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.groovy", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.groovy" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.haskell.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(haskell))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(haskell))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.haskell", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.haskell" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.haskell", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.haskell" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.haskell", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.haskell" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.html.basic.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(html))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(html))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "text.embedded.html.basic", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "text.html.basic" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "text.embedded.html.basic", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "text.html.basic" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "text.embedded.html.basic", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "text.html.basic" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.java.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(java))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(java))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.java", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.java" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.java", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.java" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.java", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.java" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.js.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(javascript|js))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(javascript|js))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.js", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.js" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.js", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.js" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.js", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.js" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.json.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(json))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(json))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.json", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.json" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.json", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.json" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.json", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.json" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.js.jsx.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(jsx))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(jsx))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.js.jsx", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.js.jsx" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.js.jsx", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.js.jsx" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.js.jsx", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.js.jsx" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.julia.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(julia))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(julia))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.julia", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.julia" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.julia", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.julia" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.julia", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.julia" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.kotlin.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(kotlin|kts?))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(kotlin|kts?))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.kotlin", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.kotlin" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.kotlin", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.kotlin" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.kotlin", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.kotlin" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.css.less.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(less))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(less))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.css.less", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.css.less" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.css.less", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.css.less" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.css.less", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.css.less" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.makefile.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(make(file)?))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(make(file)?))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.makefile", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.makefile" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.makefile", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.makefile" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.makefile", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.makefile" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.gfm.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(markdown|mdown|md))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(markdown|mdown|md))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.gfm", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.gfm" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.gfm", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.gfm" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.gfm", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.gfm" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.html.mustache.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(mustache))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(mustache))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "text.embedded.html.mustache", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "text.html.mustache" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "text.embedded.html.mustache", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "text.html.mustache" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "text.embedded.html.mustache", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "text.html.mustache" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.objc.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(objc|objective-c))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(objc|objective-c))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.objc", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.objc" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.objc", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.objc" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.objc", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.objc" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.ocaml.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(ocaml))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(ocaml))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.ocaml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.ocaml" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.ocaml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.ocaml" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.ocaml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.ocaml" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.perl.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(perl))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(perl))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.perl", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.perl" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.perl", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.perl" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.perl", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.perl" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.perl6.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(perl6))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(perl6))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.perl6", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.perl6" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.perl6", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.perl6" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.perl6", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.perl6" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.html.php.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(php))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(php))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "text.embedded.html.php", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "text.html.php" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "text.embedded.html.php", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "text.html.php" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "text.embedded.html.php", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "text.html.php" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.asciidoc.properties.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(properties))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(properties))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.asciidoc.properties", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.asciidoc.properties" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.asciidoc.properties", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.asciidoc.properties" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.asciidoc.properties", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.asciidoc.properties" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.python.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(py(thon)?))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(py(thon)?))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.python", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.python" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.python", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.python" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.python", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.python" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.r.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(r))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(r))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.r", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.r" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.r", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.r" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.r", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.r" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.ruby.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(ruby|rb))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(ruby|rb))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.ruby", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.ruby" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.ruby", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.ruby" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.ruby", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.ruby" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.rust.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(rust|rs))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(rust|rs))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.rust", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.rust" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.rust", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.rust" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.rust", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.rust" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.sass.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(sass))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(sass))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.sass", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.sass" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.sass", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.sass" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.sass", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.sass" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.scala.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(scala))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(scala))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.scala", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.scala" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.scala", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.scala" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.scala", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.scala" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.css.scss.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(scss))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(scss))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.css.scss", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.css.scss" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.css.scss", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.css.scss" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.css.scss", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.css.scss" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.shell.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(sh|bash|shell))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(sh|bash|shell))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.shell", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.shell" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.shell", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.shell" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.shell", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.shell" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.sql.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(sql))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(sql))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.sql", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.sql" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.sql", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.sql" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.sql", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.sql" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.swift.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(swift))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(swift))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.swift", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.swift" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.swift", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.swift" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.swift", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.swift" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.toml.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(toml))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(toml))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.toml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.toml" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.toml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.toml" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.toml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.toml" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.ts.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(typescript|ts))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(typescript|ts))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.ts", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.ts" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.ts", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.ts" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.ts", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.ts" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.xml.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(xml))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(xml))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "text.embedded.xml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "text.xml" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "text.embedded.xml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "text.xml" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "text.embedded.xml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "text.xml" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.code.yaml.asciidoc", - "begin": "(?=(?>(?:^\\[(source)(?:,|#)\\p{Blank}*(?i:(ya?ml))((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)(?:,|#)\\p{Blank}*(?i:(ya?ml))((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "begin": "^(-{4,})\\s*$", - "contentName": "source.embedded.yaml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.yaml" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "begin": "^(-{2})\\s*$", - "contentName": "source.embedded.yaml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.yaml" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "begin": "^(\\.{4})\\s*$", - "contentName": "source.embedded.yaml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - }, - { - "include": "source.yaml" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "begin": "(?=(?>(?:^\\[(source)((?:,|#)[^\\]]+)*\\]$)))", - "patterns": [ - { - "match": "^\\[(source)((?:,|#)([^,\\]]+))*\\]$", - "captures": { - "0": { - "name": "markup.heading.asciidoc", - "patterns": [ - { - "include": "#block-attribute-inner" - } - ] - } - } - }, - { - "include": "#inlines" - }, - { - "include": "#block-title" - }, - { - "comment": "listing block", - "name": "markup.raw.asciidoc", - "begin": "^(-{4,})\\s*$", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "open block", - "name": "markup.raw.asciidoc", - "begin": "^(-{2})\\s*$", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - } - ], - "end": "^(\\1)$" - }, - { - "comment": "literal block", - "name": "markup.raw.asciidoc", - "begin": "^(\\.{4})\\s*$", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - } - ], - "end": "^(\\1)$" - } - ], - "end": "((?<=--|\\.\\.\\.\\.)$|^\\p{Blank}*$)" - }, - { - "name": "markup.raw.asciidoc", - "begin": "^(-{4,})\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "#include-directive" - } - ], - "end": "^(\\1)$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - } - ] - }, - "source-markdown": { - "patterns": [ - { - "name": "markup.code.c.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(c))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.c", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.c" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.clojure.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(clojure))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.clojure", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.clojure" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.coffee.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(coffee-?(script)?))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.coffee", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.coffee" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.cpp.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(c(pp|\\+\\+)))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.cpp", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.cpp" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.css.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(css))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.css", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.css" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.cs.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(cs(harp)?))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.cs", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.cs" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.diff.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(diff|patch|rej))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.diff", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.diff" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.dockerfile.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(docker(file)?))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.dockerfile", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.dockerfile" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.elixir.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(elixir))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.elixir", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.elixir" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.elm.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(elm))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.elm", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.elm" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.erlang.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(erlang))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.erlang", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.erlang" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.go.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(go(lang)?))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.go", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.go" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.groovy.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(groovy))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.groovy", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.groovy" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.haskell.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(haskell))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.haskell", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.haskell" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.html.basic.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(html))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "text.embedded.html.basic", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "text.html.basic" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.java.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(java))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.java", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.java" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.js.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(javascript|js))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.js", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.js" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.json.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(json))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.json", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.json" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.js.jsx.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(jsx))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.js.jsx", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.js.jsx" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.julia.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(julia))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.julia", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.julia" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.kotlin.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(kotlin|kts?))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.kotlin", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.kotlin" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.css.less.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(less))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.css.less", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.css.less" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.makefile.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(make(file)?))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.makefile", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.makefile" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.gfm.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(markdown|mdown|md))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.gfm", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.gfm" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.html.mustache.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(mustache))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "text.embedded.html.mustache", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "text.html.mustache" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.objc.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(objc|objective-c))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.objc", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.objc" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.ocaml.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(ocaml))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.ocaml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.ocaml" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.perl.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(perl))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.perl", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.perl" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.perl6.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(perl6))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.perl6", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.perl6" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.html.php.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(php))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "text.embedded.html.php", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "text.html.php" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.asciidoc.properties.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(properties))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.asciidoc.properties", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.asciidoc.properties" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.python.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(py(thon)?))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.python", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.python" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.r.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(r))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.r", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.r" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.ruby.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(ruby|rb))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.ruby", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.ruby" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.rust.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(rust|rs))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.rust", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.rust" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.sass.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(sass))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.sass", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.sass" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.scala.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(scala))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.scala", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.scala" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.css.scss.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(scss))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.css.scss", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.css.scss" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.shell.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(sh|bash|shell))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.shell", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.shell" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.sql.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(sql))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.sql", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.sql" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.swift.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(swift))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.swift", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.swift" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.toml.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(toml))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.toml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.toml" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.ts.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(typescript|ts))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.ts", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.ts" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.xml.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(xml))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "text.embedded.xml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "text.xml" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.code.yaml.asciidoc", - "begin": "^\\s*(`{3,})\\s*(?i:(ya?ml))\\s*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "contentName": "source.embedded.yaml", - "patterns": [ - { - "include": "#block-callout" - }, - { - "include": "source.yaml" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - }, - { - "name": "markup.raw.asciidoc", - "begin": "^\\s*(`{3,}).*$", - "beginCaptures": { - "0": { - "name": "support.asciidoc" - } - }, - "patterns": [ - { - "include": "#block-callout" - } - ], - "end": "^\\s*\\1\\s*$", - "endCaptures": { - "0": { - "name": "support.asciidoc" - } - } - } - ] - } - } -} \ No newline at end of file diff --git a/com.vogella.ide.feature/feature.xml b/com.vogella.ide.feature/feature.xml index 13b0af8..99cf710 100644 --- a/com.vogella.ide.feature/feature.xml +++ b/com.vogella.ide.feature/feature.xml @@ -25,10 +25,6 @@ id="com.vogella.ide.editor.gradle" version="0.0.0"/> - - diff --git a/lsp/com.vogella.lsp.asciidoc.client/.classpath b/lsp/com.vogella.lsp.asciidoc.client/.classpath deleted file mode 100644 index 7a42e53..0000000 --- a/lsp/com.vogella.lsp.asciidoc.client/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/lsp/com.vogella.lsp.asciidoc.client/.project b/lsp/com.vogella.lsp.asciidoc.client/.project deleted file mode 100644 index 32a315a..0000000 --- a/lsp/com.vogella.lsp.asciidoc.client/.project +++ /dev/null @@ -1,45 +0,0 @@ - - - com.vogella.lsp.asciidoc.client - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - - - 1765876313415 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/lsp/com.vogella.lsp.asciidoc.client/.settings/org.eclipse.core.resources.prefs b/lsp/com.vogella.lsp.asciidoc.client/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0..0000000 --- a/lsp/com.vogella.lsp.asciidoc.client/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/lsp/com.vogella.lsp.asciidoc.client/.settings/org.eclipse.jdt.core.prefs b/lsp/com.vogella.lsp.asciidoc.client/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index c540a97..0000000 --- a/lsp/com.vogella.lsp.asciidoc.client/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,9 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=25 -org.eclipse.jdt.core.compiler.compliance=25 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=25 diff --git a/lsp/com.vogella.lsp.asciidoc.client/META-INF/MANIFEST.MF b/lsp/com.vogella.lsp.asciidoc.client/META-INF/MANIFEST.MF deleted file mode 100644 index cdbc449..0000000 --- a/lsp/com.vogella.lsp.asciidoc.client/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Client -Bundle-SymbolicName: com.vogella.lsp.asciidoc.client;singleton:=true -Bundle-Version: 1.0.0.qualifier -Require-Bundle: org.eclipse.lsp4e;bundle-version="0.18.14", - org.eclipse.ui;bundle-version="3.207.0", - org.eclipse.core.runtime;bundle-version="3.32.0", - org.eclipse.ui.genericeditor;bundle-version="1.3.500", - com.vogella.lsp.asciidoc.server;bundle-version="1.0.0", - com.vogella.ide.editor.asciidoc, - org.eclipse.lsp4j;bundle-version="0.24.0", - org.eclipse.lsp4j.jsonrpc;bundle-version="0.23.1" -Bundle-Vendor: VOGELLA -Automatic-Module-Name: com.vogella.lsp.asciidoc.client -Bundle-RequiredExecutionEnvironment: JavaSE-25 diff --git a/lsp/com.vogella.lsp.asciidoc.client/build.properties b/lsp/com.vogella.lsp.asciidoc.client/build.properties deleted file mode 100644 index e9863e2..0000000 --- a/lsp/com.vogella.lsp.asciidoc.client/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml diff --git a/lsp/com.vogella.lsp.asciidoc.client/plugin.xml b/lsp/com.vogella.lsp.asciidoc.client/plugin.xml deleted file mode 100644 index 6147193..0000000 --- a/lsp/com.vogella.lsp.asciidoc.client/plugin.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - diff --git a/lsp/com.vogella.lsp.asciidoc.client/src/com/vogella/lsp/asciidoc/client/AbstractConnectionProvider.java b/lsp/com.vogella.lsp.asciidoc.client/src/com/vogella/lsp/asciidoc/client/AbstractConnectionProvider.java deleted file mode 100644 index cd6a056..0000000 --- a/lsp/com.vogella.lsp.asciidoc.client/src/com/vogella/lsp/asciidoc/client/AbstractConnectionProvider.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.vogella.lsp.asciidoc.client; - -import java.io.FilterInputStream; -import java.io.FilterOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PipedInputStream; -import java.io.PipedOutputStream; - -import org.eclipse.lsp4e.server.StreamConnectionProvider; -import org.eclipse.lsp4j.jsonrpc.Launcher; -import org.eclipse.lsp4j.launch.LSPLauncher; -import org.eclipse.lsp4j.services.LanguageClient; -import org.eclipse.lsp4j.services.LanguageServer; - -public class AbstractConnectionProvider implements StreamConnectionProvider { - - private InputStream inputStream; - private OutputStream outputStream; - private LanguageServer languageServer; - protected Launcher launcher; - - public AbstractConnectionProvider(LanguageServer languageServer) { - this.languageServer = languageServer; - } - - @Override - public void start() throws IOException { - PipedInputStream in = new PipedInputStream(); - PipedOutputStream out = new PipedOutputStream(); - PipedInputStream in2 = new PipedInputStream(); - PipedOutputStream out2 = new PipedOutputStream(); - - in.connect(out2); - out.connect(in2); - - launcher = LSPLauncher.createServerLauncher(languageServer, in2, out2); - inputStream = in; - outputStream = out; - - launcher.startListening(); - } - - @Override - public InputStream getInputStream() { - return new FilterInputStream(inputStream) { - @Override - public int read(byte[] b, int off, int len) throws IOException { - int bytesRead = super.read(b, off, len); - if (bytesRead > 0) { - System.err.print(new String(b, off, bytesRead)); - } - return bytesRead; - } - }; - } - - @Override - public OutputStream getOutputStream() { - return new FilterOutputStream(outputStream) { - @Override - public void write(byte[] b, int off, int len) throws IOException { - System.err.print(new String(b, off, len)); - super.write(b, off, len); - } - }; - } - - @Override - public void stop() { - // Clean up resources if needed - try { - inputStream.close(); - outputStream.close(); - } catch (IOException e) { - System.err.println("Error closing streams: " + e.getMessage()); - } - } - - @Override - public InputStream getErrorStream() { - return null; - } -} diff --git a/lsp/com.vogella.lsp.asciidoc.client/src/com/vogella/lsp/asciidoc/client/ConnectionProviderSolution.java b/lsp/com.vogella.lsp.asciidoc.client/src/com/vogella/lsp/asciidoc/client/ConnectionProviderSolution.java deleted file mode 100644 index 0aaf7b5..0000000 --- a/lsp/com.vogella.lsp.asciidoc.client/src/com/vogella/lsp/asciidoc/client/ConnectionProviderSolution.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.vogella.lsp.asciidoc.client; - -import java.io.IOException; - - -import com.vogella.lsp.asciidoc.server.AsciidocLanguageServer; - -public class ConnectionProviderSolution extends AbstractConnectionProvider { - private static final AsciidocLanguageServer LANGUAGE_SERVER = new AsciidocLanguageServer(); - public ConnectionProviderSolution() { - super(LANGUAGE_SERVER); - } - - @Override - public void start() throws IOException { - super.start(); - LANGUAGE_SERVER.setRemoteProxy(launcher.getRemoteProxy()); - } -} diff --git a/lsp/com.vogella.lsp.asciidoc.server.tests/.classpath b/lsp/com.vogella.lsp.asciidoc.server.tests/.classpath deleted file mode 100644 index 2198f33..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server.tests/.classpath +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/lsp/com.vogella.lsp.asciidoc.server.tests/.project b/lsp/com.vogella.lsp.asciidoc.server.tests/.project deleted file mode 100644 index 77e364f..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - com.vogella.lsp.asciidoc.server.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/lsp/com.vogella.lsp.asciidoc.server.tests/.settings/org.eclipse.jdt.core.prefs b/lsp/com.vogella.lsp.asciidoc.server.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index c540a97..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,9 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=25 -org.eclipse.jdt.core.compiler.compliance=25 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=25 diff --git a/lsp/com.vogella.lsp.asciidoc.server.tests/META-INF/MANIFEST.MF b/lsp/com.vogella.lsp.asciidoc.server.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 5f85f4b..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,10 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Tests -Bundle-SymbolicName: com.vogella.lsp.asciidoc.server.tests -Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: VOGELLA -Fragment-Host: com.vogella.lsp.asciidoc.server;bundle-version="1.0.0" -Require-Bundle: junit-jupiter-api;bundle-version="5.14.1" -Automatic-Module-Name: com.vogella.lsp.asciidoc.server.tests -Bundle-RequiredExecutionEnvironment: JavaSE-25 diff --git a/lsp/com.vogella.lsp.asciidoc.server.tests/build.properties b/lsp/com.vogella.lsp.asciidoc.server.tests/build.properties deleted file mode 100644 index 34d2e4d..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server.tests/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - . diff --git a/lsp/com.vogella.lsp.asciidoc.server.tests/manual/Help.adoc b/lsp/com.vogella.lsp.asciidoc.server.tests/manual/Help.adoc deleted file mode 100644 index f8c9330..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server.tests/manual/Help.adoc +++ /dev/null @@ -1,8 +0,0 @@ -= Title -ddd -image::Sample.png[] - -include::Help2.adoc[] -include::Testing.adoc[] - -image::Test.png[] diff --git a/lsp/com.vogella.lsp.asciidoc.server.tests/manual/Testing.adoc b/lsp/com.vogella.lsp.asciidoc.server.tests/manual/Testing.adoc deleted file mode 100644 index 2e4208b..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server.tests/manual/Testing.adoc +++ /dev/null @@ -1,5 +0,0 @@ -= Title - -image::Sample.png[] - -include::Help.adoc[] diff --git a/lsp/com.vogella.lsp.asciidoc.server.tests/manual/img/Sample.png b/lsp/com.vogella.lsp.asciidoc.server.tests/manual/img/Sample.png deleted file mode 100644 index 3bc0bd3..0000000 Binary files a/lsp/com.vogella.lsp.asciidoc.server.tests/manual/img/Sample.png and /dev/null differ diff --git a/lsp/com.vogella.lsp.asciidoc.server.tests/manual/img/Test.png b/lsp/com.vogella.lsp.asciidoc.server.tests/manual/img/Test.png deleted file mode 100644 index f7d84cc..0000000 Binary files a/lsp/com.vogella.lsp.asciidoc.server.tests/manual/img/Test.png and /dev/null differ diff --git a/lsp/com.vogella.lsp.asciidoc.server.tests/src/com/vogella/lsp/asciidoc/server/tests/AsciidocCompletionTest.java b/lsp/com.vogella.lsp.asciidoc.server.tests/src/com/vogella/lsp/asciidoc/server/tests/AsciidocCompletionTest.java deleted file mode 100644 index c055ac3..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server.tests/src/com/vogella/lsp/asciidoc/server/tests/AsciidocCompletionTest.java +++ /dev/null @@ -1,265 +0,0 @@ -package com.vogella.lsp.asciidoc.server.tests; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.concurrent.ExecutionException; - -import org.eclipse.lsp4j.CompletionItem; -import org.eclipse.lsp4j.CompletionItemKind; -import org.eclipse.lsp4j.CompletionParams; -import org.eclipse.lsp4j.DidOpenTextDocumentParams; -import org.eclipse.lsp4j.Position; -import org.eclipse.lsp4j.Range; -import org.eclipse.lsp4j.TextDocumentIdentifier; -import org.eclipse.lsp4j.TextDocumentItem; -import org.eclipse.lsp4j.TextEdit; -import org.eclipse.lsp4j.jsonrpc.messages.Either; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - -import com.vogella.lsp.asciidoc.server.AsciidocLanguageServer; -import com.vogella.lsp.asciidoc.server.AsciidocTextDocumentService; - -class AsciidocCompletionTest { - - @TempDir - Path tempDir; - - private AsciidocTextDocumentService service; - private String docUri; - - @BeforeEach - void setUp() throws IOException { - AsciidocLanguageServer server = new AsciidocLanguageServer(); - service = (AsciidocTextDocumentService) server.getTextDocumentService(); - - // Create a dummy image in img/ subdirectory - Path imgDir = tempDir.resolve("img"); - Files.createDirectories(imgDir); - Files.createFile(imgDir.resolve("Sample.png")); - - // Create a dummy adoc file for include - Files.createFile(tempDir.resolve("other.adoc")); - - // Create subdirectories and files for path completion testing - Path docsDir = tempDir.resolve("docs"); - Files.createDirectories(docsDir); - Files.createFile(docsDir.resolve("chapter1.adoc")); - Files.createFile(docsDir.resolve("chapter2.adoc")); - - Path subDir = docsDir.resolve("sub"); - Files.createDirectories(subDir); - Files.createFile(subDir.resolve("nested.adoc")); - - // Create files with numeric prefixes for filtering test - Files.createFile(tempDir.resolve("100_approach.adoc")); - Files.createFile(tempDir.resolve("200_exercise.adoc")); - Files.createFile(tempDir.resolve("210_exercise.adoc")); - Files.createFile(tempDir.resolve("300_platformproject.adoc")); - - docUri = tempDir.resolve("test.adoc").toUri().toString(); - } - - private List getCompletions(String content, int line, int character) - throws InterruptedException, ExecutionException { - service.didOpen(new DidOpenTextDocumentParams(new TextDocumentItem(docUri, "asciidoc", 1, content))); - CompletionParams params = new CompletionParams(new TextDocumentIdentifier(docUri), - new Position(line, character)); - return service.completion(params).get().getLeft(); - } - - @Test - void testImageCompletionInsideExistingBrackets() throws Exception { - // content: image::[] - // cursor at index 8: image::[|] - String content = "image::[]"; - List completions = getCompletions(content, 0, 8); - - CompletionItem item = findItem(completions, "Sample.png"); - assertNotNull(item, "Sample.png completion not found"); - - TextEdit edit = item.getTextEdit().getLeft(); - Range range = edit.getRange(); - - // Should replace the existing "[]" which starts at index 7 and ends at 9 - assertEquals(7, range.getStart().getCharacter(), "Start range mismatch"); - assertEquals(9, range.getEnd().getCharacter(), "End range mismatch"); - assertEquals("Sample.png[]", edit.getNewText()); - } - - @Test - void testImageCompletionWithPrefix() throws Exception { - // content: image::S - // cursor at index 8: image::S| - String content = "image::S"; - List completions = getCompletions(content, 0, 8); - - CompletionItem item = findItem(completions, "Sample.png"); - assertNotNull(item, "Sample.png completion not found"); - - TextEdit edit = item.getTextEdit().getLeft(); - Range range = edit.getRange(); - - // Should replace the prefix "S" which starts at index 7 - assertEquals(7, range.getStart().getCharacter()); - assertEquals(8, range.getEnd().getCharacter()); - assertEquals("Sample.png[]", edit.getNewText()); - } - - @Test - void testIncludeCompletionInsideBrackets() throws Exception { - // content: include::[] - // cursor at index 10: include::[|] - String content = "include::[]"; - List completions = getCompletions(content, 0, 10); - - CompletionItem item = findItem(completions, "other.adoc"); - assertNotNull(item, "other.adoc completion not found"); - - TextEdit edit = item.getTextEdit().getLeft(); - Range range = edit.getRange(); - - // Should replace "[]" which starts at index 9 - assertEquals(9, range.getStart().getCharacter()); - assertEquals(11, range.getEnd().getCharacter()); - assertEquals("other.adoc[]", edit.getNewText()); - } - - @Test - void testIncludePathCompletionWithSubdirectory() throws Exception { - // content: include::docs/ - // cursor at index 14: include::docs/| - String content = "include::docs/"; - List completions = getCompletions(content, 0, 14); - - // Should find both files in docs/ - CompletionItem chapter1 = findItem(completions, "chapter1.adoc"); - CompletionItem chapter2 = findItem(completions, "chapter2.adoc"); - assertNotNull(chapter1, "chapter1.adoc completion not found"); - assertNotNull(chapter2, "chapter2.adoc completion not found"); - - // Should also find the sub/ directory - CompletionItem subDir = findItem(completions, "sub/"); - assertNotNull(subDir, "sub/ directory completion not found"); - assertEquals(CompletionItemKind.Folder, subDir.getKind(), "sub/ should be a folder"); - - // Verify the text edit includes the full path - TextEdit edit = chapter1.getTextEdit().getLeft(); - assertEquals("docs/chapter1.adoc[]", edit.getNewText()); - } - - @Test - void testIncludePathCompletionWithPrefix() throws Exception { - // content: include::docs/ch - // cursor at index 16: include::docs/ch| - String content = "include::docs/ch"; - List completions = getCompletions(content, 0, 16); - - // Should find both chapter files - CompletionItem chapter1 = findItem(completions, "chapter1.adoc"); - CompletionItem chapter2 = findItem(completions, "chapter2.adoc"); - assertNotNull(chapter1, "chapter1.adoc completion not found"); - assertNotNull(chapter2, "chapter2.adoc completion not found"); - - // Should NOT find sub/ since it doesn't start with 'ch' - CompletionItem subDir = findItem(completions, "sub/"); - assertNull(subDir, "sub/ should not be in completions"); - } - - @Test - void testIncludePathCompletionNestedDirectory() throws Exception { - // content: include::docs/sub/ - // cursor at index 18: include::docs/sub/| - String content = "include::docs/sub/"; - List completions = getCompletions(content, 0, 18); - - // Should find nested.adoc in docs/sub/ - CompletionItem nested = findItem(completions, "nested.adoc"); - assertNotNull(nested, "nested.adoc completion not found"); - - // Verify the text edit includes the full nested path - TextEdit edit = nested.getTextEdit().getLeft(); - assertEquals("docs/sub/nested.adoc[]", edit.getNewText()); - } - - @Test - void testIncludeDirectoryCompletion() throws Exception { - // content: include::d - // cursor at index 10: include::d| - String content = "include::d"; - List completions = getCompletions(content, 0, 10); - - // Should find docs/ directory - CompletionItem docsDir = findItem(completions, "docs/"); - assertNotNull(docsDir, "docs/ directory completion not found"); - assertEquals(CompletionItemKind.Folder, docsDir.getKind(), "docs/ should be a folder"); - - // Verify the text edit - TextEdit edit = docsDir.getTextEdit().getLeft(); - assertEquals("docs/", edit.getNewText(), "Directory completion should not add []"); - } - - @Test - void testIncludeCompletionsSorted() throws Exception { - // content: include::docs/ - // cursor at index 14: include::docs/| - String content = "include::docs/"; - List completions = getCompletions(content, 0, 14); - - // Verify we have the expected items - assertNotNull(findItem(completions, "chapter1.adoc"), "chapter1.adoc not found"); - assertNotNull(findItem(completions, "chapter2.adoc"), "chapter2.adoc not found"); - assertNotNull(findItem(completions, "sub/"), "sub/ not found"); - - // Verify sorting: files first (with "0_" prefix), then directories (with "1_" prefix) - CompletionItem subDir = findItem(completions, "sub/"); - CompletionItem chapter1 = findItem(completions, "chapter1.adoc"); - CompletionItem chapter2 = findItem(completions, "chapter2.adoc"); - - // Check sortText values - assertEquals("1_sub", subDir.getSortText(), "Directory should have 1_ prefix"); - assertEquals("0_chapter1.adoc", chapter1.getSortText(), "File should have 0_ prefix"); - assertEquals("0_chapter2.adoc", chapter2.getSortText(), "File should have 0_ prefix"); - - // Verify files come before directories when sorted - assertTrue(chapter1.getSortText().compareTo(subDir.getSortText()) < 0, - "Files should sort before directories"); - } - - @Test - void testIncludeCompletionWithNumericPrefix() throws Exception { - // content: include::1 - // cursor at index 10: include::1| - String content = "include::1"; - List completions = getCompletions(content, 0, 10); - - // Should only find files starting with "1" - CompletionItem item100 = findItem(completions, "100_approach.adoc"); - assertNotNull(item100, "100_approach.adoc should be in completions"); - - // Should NOT find files starting with "2" or "3" - CompletionItem item200 = findItem(completions, "200_exercise.adoc"); - CompletionItem item210 = findItem(completions, "210_exercise.adoc"); - CompletionItem item300 = findItem(completions, "300_platformproject.adoc"); - - assertNull(item200, "200_exercise.adoc should NOT be in completions"); - assertNull(item210, "210_exercise.adoc should NOT be in completions"); - assertNull(item300, "300_platformproject.adoc should NOT be in completions"); - - // Verify sorting: should be sorted alphabetically - assertTrue(item100.getSortText().startsWith("0_"), "Should have correct sortText prefix"); - } - - private CompletionItem findItem(List items, String label) { - return items.stream().filter(i -> i.getLabel().equals(label)).findFirst().orElse(null); - } -} diff --git a/lsp/com.vogella.lsp.asciidoc.server.tests/src/com/vogella/lsp/asciidoc/server/tests/AsciidocDefinitionTest.java b/lsp/com.vogella.lsp.asciidoc.server.tests/src/com/vogella/lsp/asciidoc/server/tests/AsciidocDefinitionTest.java deleted file mode 100644 index d150b1c..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server.tests/src/com/vogella/lsp/asciidoc/server/tests/AsciidocDefinitionTest.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.vogella.lsp.asciidoc.server.tests; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.concurrent.ExecutionException; - -import org.eclipse.lsp4j.DefinitionParams; -import org.eclipse.lsp4j.DidOpenTextDocumentParams; -import org.eclipse.lsp4j.Location; -import org.eclipse.lsp4j.Position; -import org.eclipse.lsp4j.TextDocumentIdentifier; -import org.eclipse.lsp4j.TextDocumentItem; -import org.eclipse.lsp4j.jsonrpc.messages.Either; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - -import com.vogella.lsp.asciidoc.server.AsciidocLanguageServer; -import com.vogella.lsp.asciidoc.server.AsciidocTextDocumentService; - -class AsciidocDefinitionTest { - - @TempDir - Path tempDir; - - private AsciidocTextDocumentService service; - private String docUri; - private Path includedFile; - - @BeforeEach - void setUp() throws IOException { - AsciidocLanguageServer server = new AsciidocLanguageServer(); - service = (AsciidocTextDocumentService) server.getTextDocumentService(); - - // Create dummy file to be included - includedFile = tempDir.resolve("target.adoc"); - Files.createFile(includedFile); - - docUri = tempDir.resolve("test.adoc").toUri().toString(); - } - - private List getDefinition(String content, int line, int character) throws InterruptedException, ExecutionException { - service.didOpen(new DidOpenTextDocumentParams(new TextDocumentItem(docUri, "asciidoc", 1, content))); - DefinitionParams params = new DefinitionParams(new TextDocumentIdentifier(docUri), new Position(line, character)); - Either, List> result = service.definition(params).get(); - return result.getLeft(); - } - - @Test - void testIncludeDefinition() throws Exception { - String content = "include::target.adoc[]"; - // Cursor on "target.adoc" - List locations = getDefinition(content, 0, 10); - - assertNotNull(locations); - assertFalse(locations.isEmpty()); - assertEquals(1, locations.size()); - - Location loc = locations.get(0); - assertEquals(includedFile.toUri(), new java.net.URI(loc.getUri())); - } - - @Test - void testIncludeInSubfolderDefinition() throws Exception { - Path subDir = tempDir.resolve("sub"); - Files.createDirectories(subDir); - Path subFile = subDir.resolve("subfile.adoc"); - Files.createFile(subFile); - - String content = "include::sub/subfile.adoc[]"; - // Cursor on "subfile.adoc" - List locations = getDefinition(content, 0, 15); - - assertNotNull(locations); - assertEquals(1, locations.size()); - assertEquals(subFile.toUri(), new java.net.URI(locations.get(0).getUri())); - } - - @Test - void testNoDefinition() throws Exception { - String content = "include::nonexistent.adoc[]"; - List locations = getDefinition(content, 0, 10); - - assertNotNull(locations); - assertTrue(locations.isEmpty()); - } - - @Test - void testImageDefinition() throws Exception { - Path imgDir = tempDir.resolve("img"); - Files.createDirectories(imgDir); - Path imgFile = imgDir.resolve("Sample.png"); - Files.createFile(imgFile); - - String content = "image::Sample.png[]"; - // Cursor on "Sample.png" - List locations = getDefinition(content, 0, 10); - - assertNotNull(locations); - assertEquals(1, locations.size()); - assertEquals(imgFile.toUri(), new java.net.URI(locations.get(0).getUri())); - } -} diff --git a/lsp/com.vogella.lsp.asciidoc.server.tests/src/com/vogella/lsp/asciidoc/server/tests/AsciidocDocumentLinkTest.java b/lsp/com.vogella.lsp.asciidoc.server.tests/src/com/vogella/lsp/asciidoc/server/tests/AsciidocDocumentLinkTest.java deleted file mode 100644 index d1e173e..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server.tests/src/com/vogella/lsp/asciidoc/server/tests/AsciidocDocumentLinkTest.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.vogella.lsp.asciidoc.server.tests; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.concurrent.ExecutionException; - -import org.eclipse.lsp4j.DidOpenTextDocumentParams; -import org.eclipse.lsp4j.DocumentLink; -import org.eclipse.lsp4j.DocumentLinkParams; -import org.eclipse.lsp4j.TextDocumentIdentifier; -import org.eclipse.lsp4j.TextDocumentItem; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - -import com.vogella.lsp.asciidoc.server.AsciidocLanguageServer; -import com.vogella.lsp.asciidoc.server.AsciidocTextDocumentService; - -class AsciidocDocumentLinkTest { - - @TempDir - Path tempDir; - - private AsciidocTextDocumentService service; - private String docUri; - private Path includedFile; - - @BeforeEach - void setUp() throws IOException { - AsciidocLanguageServer server = new AsciidocLanguageServer(); - service = (AsciidocTextDocumentService) server.getTextDocumentService(); - - // Create dummy file to be included - includedFile = tempDir.resolve("target.adoc"); - Files.createFile(includedFile); - - docUri = tempDir.resolve("test.adoc").toUri().toString(); - } - - private List getLinks(String content) throws InterruptedException, ExecutionException { - service.didOpen(new DidOpenTextDocumentParams(new TextDocumentItem(docUri, "asciidoc", 1, content))); - DocumentLinkParams params = new DocumentLinkParams(new TextDocumentIdentifier(docUri)); - return service.documentLink(params).get(); - } - - @Test - void testIncludeLinkRange() throws Exception { - String filename = "target.adoc"; - String content = "include::" + filename + "[]"; - List links = getLinks(content); - - assertNotNull(links); - assertEquals(1, links.size()); - DocumentLink link = links.get(0); - - // Range should cover "target.adoc" - assertEquals(0, link.getRange().getStart().getLine()); - assertEquals(9, link.getRange().getStart().getCharacter()); // "include::".length() = 9 - assertEquals(9 + filename.length(), link.getRange().getEnd().getCharacter()); - assertEquals(includedFile.toUri(), new java.net.URI(link.getTarget())); - } - - @Test - void testImageLinkRange() throws Exception { - Path imgDir = tempDir.resolve("img"); - Files.createDirectories(imgDir); - Path imgFile = imgDir.resolve("Sample.png"); - Files.createFile(imgFile); - - String filename = "Sample.png"; - String content = "image::" + filename + "[]"; - List links = getLinks(content); - - assertNotNull(links); - assertEquals(1, links.size()); - DocumentLink link = links.get(0); - - assertEquals(0, link.getRange().getStart().getLine()); - assertEquals(7, link.getRange().getStart().getCharacter()); // "image::".length() = 7 - assertEquals(7 + filename.length(), link.getRange().getEnd().getCharacter()); - assertEquals(imgFile.toUri(), new java.net.URI(link.getTarget())); - } - - @Test - void testExternalLink() throws Exception { - String url = "https://example.com"; - String content = "link:" + url + "[Example]"; - List links = getLinks(content); - - assertNotNull(links); - assertEquals(1, links.size()); - DocumentLink link = links.get(0); - - assertEquals(0, link.getRange().getStart().getLine()); - assertEquals(5, link.getRange().getStart().getCharacter()); // "link:".length() = 5 - assertEquals(5 + url.length(), link.getRange().getEnd().getCharacter()); - assertEquals(url, link.getTarget()); - } - - @Test - void testInternalFileLink() throws Exception { - Path linkedFile = tempDir.resolve("linked.adoc"); - Files.createFile(linkedFile); - - String relativePath = "./linked.adoc"; - String content = "link:" + relativePath + "[Linked File]"; - List links = getLinks(content); - - assertNotNull(links); - assertEquals(1, links.size()); - DocumentLink link = links.get(0); - - assertEquals(0, link.getRange().getStart().getLine()); - assertEquals(5, link.getRange().getStart().getCharacter()); // "link:".length() = 5 - assertEquals(5 + relativePath.length(), link.getRange().getEnd().getCharacter()); - assertEquals(linkedFile.toUri(), new java.net.URI(link.getTarget())); - } -} diff --git a/lsp/com.vogella.lsp.asciidoc.server.tests/src/com/vogella/lsp/asciidoc/server/tests/AsciidocHoverTest.java b/lsp/com.vogella.lsp.asciidoc.server.tests/src/com/vogella/lsp/asciidoc/server/tests/AsciidocHoverTest.java deleted file mode 100644 index c08258c..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server.tests/src/com/vogella/lsp/asciidoc/server/tests/AsciidocHoverTest.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.vogella.lsp.asciidoc.server.tests; - -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.concurrent.ExecutionException; - -import org.eclipse.lsp4j.Hover; -import org.eclipse.lsp4j.HoverParams; -import org.eclipse.lsp4j.MarkupContent; -import org.eclipse.lsp4j.Position; -import org.eclipse.lsp4j.TextDocumentIdentifier; -import org.eclipse.lsp4j.TextDocumentItem; -import org.eclipse.lsp4j.DidOpenTextDocumentParams; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - -import com.vogella.lsp.asciidoc.server.AsciidocLanguageServer; -import com.vogella.lsp.asciidoc.server.AsciidocTextDocumentService; - -class AsciidocHoverTest { - - @TempDir - Path tempDir; - - private AsciidocTextDocumentService service; - private String docUri; - - @BeforeEach - void setUp() throws IOException { - AsciidocLanguageServer server = new AsciidocLanguageServer(); - service = (AsciidocTextDocumentService) server.getTextDocumentService(); - - // Create dummy image - Path imgDir = tempDir.resolve("img"); - Files.createDirectories(imgDir); - Files.createFile(imgDir.resolve("Sample.png")); - - docUri = tempDir.resolve("test.adoc").toUri().toString(); - } - - private Hover getHover(String content, int line, int character) throws InterruptedException, ExecutionException { - service.didOpen(new DidOpenTextDocumentParams(new TextDocumentItem(docUri, "asciidoc", 1, content))); - HoverParams params = new HoverParams(new TextDocumentIdentifier(docUri), new Position(line, character)); - return service.hover(params).get(); - } - - @Test - void testImageHover() throws Exception { - String content = "\nimage::Sample.png[]"; - // Hover on line 1 over the image macro - Hover hover = getHover(content, 1, 10); - - assertNotNull(hover); - MarkupContent markup = hover.getContents().getRight(); - assertNotNull(markup); - - String markdown = markup.getValue(); - // Should contain the image reference in Markdown format: ![Sample.png](file:/...) - assertTrue(markdown.contains("![Sample.png]"), "Markdown should contain alt text"); - assertTrue(markdown.contains("file:"), "Markdown should contain file URI"); - assertTrue(markdown.contains("Sample.png"), "Markdown should contain filename"); - } - - @Test - void testGenericHoverFallback() throws Exception { - String content = "\nsome random text"; - // Hover on line 1 where no image is present - Hover hover = getHover(content, 1, 5); - - // Should return null for generic text (no more generic fallback) - assertNull(hover, "Hover should be null for non-specific text"); - } - - @Test - void testNoHoverOnFirstLine() throws Exception { - String content = "= Document Title"; - // Hover on first line (line 0) - Hover hover = getHover(content, 0, 5); - - // Current implementation returns null for the first line unless it's a macro - assertNull(hover, "Hover should be null on the first line by default"); - } -} diff --git a/lsp/com.vogella.lsp.asciidoc.server/.classpath b/lsp/com.vogella.lsp.asciidoc.server/.classpath deleted file mode 100644 index 7a42e53..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/lsp/com.vogella.lsp.asciidoc.server/.project b/lsp/com.vogella.lsp.asciidoc.server/.project deleted file mode 100644 index 5ec8d54..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server/.project +++ /dev/null @@ -1,45 +0,0 @@ - - - com.vogella.lsp.asciidoc.server - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - - - 1765876313417 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/lsp/com.vogella.lsp.asciidoc.server/.settings/org.eclipse.core.resources.prefs b/lsp/com.vogella.lsp.asciidoc.server/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/lsp/com.vogella.lsp.asciidoc.server/.settings/org.eclipse.jdt.core.prefs b/lsp/com.vogella.lsp.asciidoc.server/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index c540a97..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,9 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=25 -org.eclipse.jdt.core.compiler.compliance=25 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=25 diff --git a/lsp/com.vogella.lsp.asciidoc.server/META-INF/MANIFEST.MF b/lsp/com.vogella.lsp.asciidoc.server/META-INF/MANIFEST.MF deleted file mode 100644 index 031b42c..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server/META-INF/MANIFEST.MF +++ /dev/null @@ -1,11 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Server -Bundle-SymbolicName: com.vogella.lsp.asciidoc.server -Bundle-Version: 1.0.0.qualifier -Export-Package: com.vogella.lsp.asciidoc.server -Require-Bundle: org.eclipse.lsp4j;bundle-version="0.24.0", - org.eclipse.lsp4j.jsonrpc;bundle-version="0.23.1" -Bundle-Vendor: VOGELLA -Automatic-Module-Name: com.vogella.lsp.asciidoc.server -Bundle-RequiredExecutionEnvironment: JavaSE-25 diff --git a/lsp/com.vogella.lsp.asciidoc.server/build.properties b/lsp/com.vogella.lsp.asciidoc.server/build.properties deleted file mode 100644 index 34d2e4d..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - . diff --git a/lsp/com.vogella.lsp.asciidoc.server/icons/info.svg b/lsp/com.vogella.lsp.asciidoc.server/icons/info.svg deleted file mode 100644 index c98b8ac..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server/icons/info.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocDocumentModel.java b/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocDocumentModel.java deleted file mode 100644 index 5d6f978..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocDocumentModel.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.vogella.lsp.asciidoc.server; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.Reader; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class AsciidocDocumentModel { - - // Inner class representing a line of the document - public static class DocumentLine { - final int line; - final String text; - - protected DocumentLine(int line, String text) { - this.line = line; - this.text = text; - } - } - - // List to store all lines from the document - private final List lines = new ArrayList<>(); - - // Constructor to read the text and store lines - public AsciidocDocumentModel(String text) { - try (Reader r = new StringReader(text); BufferedReader reader = new BufferedReader(r)) { - - String lineText; - int lineNumber = 0; - while ((lineText = reader.readLine()) != null) { - DocumentLine line = new DocumentLine(lineNumber, lineText); - lines.add(line); - lineNumber++; - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - // Method to get the content of each line by line number - public String getLineContent(int lineNumber) { - if (lineNumber < 0 || lineNumber >= lines.size()) { - return null; // Return null if the line number is out of range - } - return lines.get(lineNumber).text; - } - - // Method to get all lines as an unmodifiable list - public List getResolvedLines() { - return Collections.unmodifiableList(this.lines); - } - - // Method to get a list of all lines as strings - public List getLines() { - List result = new ArrayList<>(); - for (DocumentLine line : lines) { - result.add(line.text); - } - return Collections.unmodifiableList(result); - } -} diff --git a/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocElements.java b/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocElements.java deleted file mode 100644 index ea8358d..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocElements.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.vogella.lsp.asciidoc.server; - -import java.util.HashMap; -import java.util.Map; - -public class AsciidocElements { - - public static final AsciidocElements INSTANCE = new AsciidocElements(); - - Map suggestions = new HashMap<>(); - - public AsciidocElements() { - String sourceTemplate = """ - [source,java] - ---- - $0 - ---- - """; - suggestions.put("source", sourceTemplate); - - } -} diff --git a/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocLanguageServer.java b/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocLanguageServer.java deleted file mode 100644 index 10bc50f..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocLanguageServer.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.vogella.lsp.asciidoc.server; - -import java.util.concurrent.CompletableFuture; - -import org.eclipse.lsp4j.CodeLensOptions; -import org.eclipse.lsp4j.CompletionOptions; -import org.eclipse.lsp4j.InitializeParams; -import org.eclipse.lsp4j.InitializeResult; -import org.eclipse.lsp4j.ServerCapabilities; -import org.eclipse.lsp4j.TextDocumentSyncKind; -import org.eclipse.lsp4j.services.LanguageClient; -import org.eclipse.lsp4j.services.LanguageServer; -import org.eclipse.lsp4j.services.TextDocumentService; -import org.eclipse.lsp4j.services.WorkspaceService; - -public class AsciidocLanguageServer implements LanguageServer { - - private TextDocumentService textService; - private WorkspaceService workspaceService; - LanguageClient client; - - public AsciidocLanguageServer() { - textService = new AsciidocTextDocumentService(this); - workspaceService = new AsciidocWorkspaceService(); - } - - /** - * Here we tell the framework which functionality our server supports - */ - @Override - public CompletableFuture initialize(InitializeParams params) { - final InitializeResult res = new InitializeResult(new ServerCapabilities()); - res.getCapabilities().setTextDocumentSync(TextDocumentSyncKind.Full); - res.getCapabilities().setCompletionProvider(new CompletionOptions()); - res.getCapabilities().setDocumentSymbolProvider(Boolean.TRUE); - res.getCapabilities().setHoverProvider(Boolean.TRUE); - res.getCapabilities().setDefinitionProvider(Boolean.TRUE); - res.getCapabilities().setDocumentLinkProvider(new org.eclipse.lsp4j.DocumentLinkOptions()); - res.getCapabilities().setCodeActionProvider(Boolean.TRUE); - res.getCapabilities().setCodeLensProvider(new CodeLensOptions(false)); -// res.getCapabilities().setReferencesProvider(Boolean.TRUE); - return CompletableFuture.supplyAsync(() -> res); - } - - @Override - public CompletableFuture shutdown() { - return CompletableFuture.supplyAsync(() -> Boolean.FALSE); - } - - @Override - public void exit() { - System.out.println("Shutdown"); - } - - @Override - public TextDocumentService getTextDocumentService() { - return this.textService; - } - - @Override - public WorkspaceService getWorkspaceService() { - return this.workspaceService; - } - - public void setRemoteProxy(LanguageClient remoteProxy) { - this.client = remoteProxy; - } - -} diff --git a/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocTextDocumentService.java b/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocTextDocumentService.java deleted file mode 100644 index ae75ad1..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocTextDocumentService.java +++ /dev/null @@ -1,682 +0,0 @@ -package com.vogella.lsp.asciidoc.server; - -import java.io.File; -import java.net.URI; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -import org.eclipse.lsp4j.CodeAction; -import org.eclipse.lsp4j.CodeActionKind; -import org.eclipse.lsp4j.CodeActionParams; -import org.eclipse.lsp4j.CodeLens; -import org.eclipse.lsp4j.CodeLensParams; -import org.eclipse.lsp4j.Command; -import org.eclipse.lsp4j.CompletionItem; -import org.eclipse.lsp4j.CompletionItemKind; -import org.eclipse.lsp4j.CompletionList; -import org.eclipse.lsp4j.CompletionParams; -import org.eclipse.lsp4j.DefinitionParams; -import org.eclipse.lsp4j.Diagnostic; -import org.eclipse.lsp4j.DiagnosticSeverity; -import org.eclipse.lsp4j.DidChangeTextDocumentParams; -import org.eclipse.lsp4j.DidCloseTextDocumentParams; -import org.eclipse.lsp4j.DidOpenTextDocumentParams; -import org.eclipse.lsp4j.DidSaveTextDocumentParams; -import org.eclipse.lsp4j.DocumentFormattingParams; -import org.eclipse.lsp4j.DocumentLink; -import org.eclipse.lsp4j.DocumentLinkParams; -import org.eclipse.lsp4j.DocumentOnTypeFormattingParams; -import org.eclipse.lsp4j.DocumentRangeFormattingParams; -import org.eclipse.lsp4j.DocumentSymbol; -import org.eclipse.lsp4j.DocumentSymbolParams; -import org.eclipse.lsp4j.Hover; -import org.eclipse.lsp4j.HoverParams; -import org.eclipse.lsp4j.Location; -import org.eclipse.lsp4j.LocationLink; -import org.eclipse.lsp4j.MarkupContent; -import org.eclipse.lsp4j.MarkupKind; -import org.eclipse.lsp4j.Position; -import org.eclipse.lsp4j.PublishDiagnosticsParams; -import org.eclipse.lsp4j.Range; -import org.eclipse.lsp4j.RenameParams; -import org.eclipse.lsp4j.SymbolInformation; -import org.eclipse.lsp4j.SymbolKind; -import org.eclipse.lsp4j.TextEdit; -import org.eclipse.lsp4j.WorkspaceEdit; -import org.eclipse.lsp4j.jsonrpc.messages.Either; -import org.eclipse.lsp4j.services.TextDocumentService; - -public class AsciidocTextDocumentService implements TextDocumentService { - private final Map docs = Collections.synchronizedMap(new HashMap<>()); - - private final AsciidocLanguageServer languageServer; - - public AsciidocTextDocumentService(AsciidocLanguageServer languageServer) { - this.languageServer = languageServer; - } - - @Override - public CompletableFuture, CompletionList>> completion(CompletionParams position) { - return CompletableFuture.supplyAsync(() -> { - List completionItems = new ArrayList<>(); - String uri = position.getTextDocument().getUri(); - AsciidocDocumentModel model = docs.get(uri); - - if (model == null) { - return Either.forLeft(Collections.emptyList()); - } - - int lineNum = position.getPosition().getLine(); - int charPos = position.getPosition().getCharacter(); - String lineContent = model.getLineContent(lineNum); - if (lineContent == null) - lineContent = ""; - - String prefixLine = charPos <= lineContent.length() ? lineContent.substring(0, charPos) : lineContent; - String suffixLine = charPos < lineContent.length() ? lineContent.substring(charPos) : ""; - - // 1. Image completion - // Matches 'image::' or 'image:' followed by an optional path and an optional opening bracket at the end - Pattern imagePattern = Pattern.compile("image:[:]?([^\\[\\]\\s]*)(\\[)?$"); - Matcher imageMatcher = imagePattern.matcher(prefixLine); - if (imageMatcher.find()) { - String pathPrefix = imageMatcher.group(1); - boolean hasOpeningInPrefix = imageMatcher.group(2) != null; - int startChar = charPos - pathPrefix.length() - (hasOpeningInPrefix ? 1 : 0); - - // Determine how much of the suffix to replace - int endChar = charPos; - if (suffixLine.startsWith("[]")) { - endChar += 2; - } else if (suffixLine.startsWith("]")) { - endChar += 1; - } else if (hasOpeningInPrefix && suffixLine.startsWith("[")) { - // This case is unlikely given the regex, but good for completeness - endChar += 1; - } - - List images = scanForFiles(uri, "img", new String[] { ".png", ".jpg", ".jpeg", ".gif" }); - for (String img : images) { - if (img.toLowerCase().startsWith(pathPrefix.toLowerCase())) { - CompletionItem item = new CompletionItem(); - item.setLabel(img); - item.setKind(CompletionItemKind.File); - item.setDetail("Image file"); - item.setSortText("0_" + img.toLowerCase()); // Sort alphabetically - - TextEdit edit = new TextEdit(); - edit.setRange(new Range(new Position(lineNum, startChar), new Position(lineNum, endChar))); - edit.setNewText(img + "[]"); - item.setTextEdit(Either.forLeft(edit)); - - completionItems.add(item); - } - } - return Either.forLeft(completionItems); - } - - // 2. Include completion with smart path support - Pattern includePattern = Pattern.compile("include::([^\\[\\]\\s]*)(\\[)?$"); - Matcher includeMatcher = includePattern.matcher(prefixLine); - if (includeMatcher.find()) { - String pathPrefix = includeMatcher.group(1); - boolean hasOpeningInPrefix = includeMatcher.group(2) != null; - int startChar = charPos - pathPrefix.length() - (hasOpeningInPrefix ? 1 : 0); - - int endChar = charPos; - if (suffixLine.startsWith("[]")) { - endChar += 2; - } else if (suffixLine.startsWith("]")) { - endChar += 1; - } - - // Parse path into directory and filename parts - String dirPart = ""; - String filePrefix = pathPrefix; - int lastSlash = pathPrefix.lastIndexOf('/'); - if (lastSlash >= 0) { - dirPart = pathPrefix.substring(0, lastSlash + 1); - filePrefix = pathPrefix.substring(lastSlash + 1); - } - - // Get completions for the current path segment - List pathCompletions = getPathCompletions(uri, dirPart, filePrefix, lineNum, startChar, endChar); - completionItems.addAll(pathCompletions); - - return Either.forLeft(completionItems); - } - - // 3. Default proposals - // Header completions only at the beginning of the line - if (prefixLine.trim().isEmpty()) { - completionItems.add(createCompletionItem("= Title", CompletionItemKind.Snippet, "= Title")); - completionItems.add(createCompletionItem("== Subtitle", CompletionItemKind.Snippet, "== Subtitle")); - } - - // Other completions available everywhere - completionItems.add(createCompletionItem("image::", CompletionItemKind.Snippet, "image::")); - completionItems.add(createCompletionItem("include::", CompletionItemKind.Snippet, "include::")); - - CompletionItem sourceBlock = new CompletionItem(); - sourceBlock.setLabel("Source Code Block"); - sourceBlock.setKind(CompletionItemKind.Snippet); - sourceBlock.setInsertText("[source, java]\n----\n\n----"); - completionItems.add(sourceBlock); - - return Either.forLeft(completionItems); - }); - } - - private CompletionItem createCompletionItem(String label, CompletionItemKind kind, String insertText) { - CompletionItem item = new CompletionItem(); - item.setLabel(label); - item.setKind(kind); - item.setInsertText(insertText); - return item; - } - - private List scanForFiles(String documentUri, String subDir, String[] extensions) { - List fileNames = new ArrayList<>(); - try { - URI uri = new URI(documentUri); - File docFile = new File(uri); - File parentDir = docFile.getParentFile(); - - File targetDir = new File(parentDir, subDir); - if (targetDir.exists() && targetDir.isDirectory()) { - File[] files = targetDir.listFiles((dir, name) -> { - for (String ext : extensions) { - if (name.toLowerCase().endsWith(ext)) return true; - } - return false; - }); - - if (files != null) { - for (File f : files) { - fileNames.add(f.getName()); - } - } - } - } catch (Exception e) { - // Ignore errors - } - return fileNames; - } - - /** - * Get path-aware completions for include directives. - * Supports directory traversal and completes the current path segment. - * Results are sorted: files first, then directories, both alphabetically. - */ - private List getPathCompletions(String documentUri, String dirPart, String filePrefix, - int lineNum, int startChar, int endChar) { - List completions = new ArrayList<>(); - try { - URI uri = new URI(documentUri); - File docFile = new File(uri); - File parentDir = docFile.getParentFile(); - - // Resolve the target directory relative to the current document - File targetDir = new File(parentDir, dirPart); - if (!targetDir.exists() || !targetDir.isDirectory()) { - return completions; - } - - File[] entries = targetDir.listFiles(); - if (entries == null) { - return completions; - } - - for (File entry : entries) { - String name = entry.getName(); - - // Skip hidden files and the current document - if (name.startsWith(".")) { - continue; - } - - // Check if name matches the prefix (case-insensitive) - if (!name.toLowerCase().startsWith(filePrefix.toLowerCase())) { - continue; - } - - if (entry.isDirectory()) { - // Add directory completion - CompletionItem item = new CompletionItem(); - item.setLabel(name + "/"); - item.setKind(CompletionItemKind.Folder); - item.setDetail("Directory"); - item.setSortText("1_" + name.toLowerCase()); // Directories after files - - TextEdit edit = new TextEdit(); - edit.setRange(new Range(new Position(lineNum, startChar), new Position(lineNum, endChar))); - edit.setNewText(dirPart + name + "/"); - item.setTextEdit(Either.forLeft(edit)); - - completions.add(item); - } else if (name.endsWith(".adoc")) { - // Add file completion - CompletionItem item = new CompletionItem(); - item.setLabel(name); - item.setKind(CompletionItemKind.File); - item.setDetail("Asciidoc file"); - item.setSortText("0_" + name.toLowerCase()); // Files before directories - - TextEdit edit = new TextEdit(); - edit.setRange(new Range(new Position(lineNum, startChar), new Position(lineNum, endChar))); - edit.setNewText(dirPart + name + "[]"); - item.setTextEdit(Either.forLeft(edit)); - - completions.add(item); - } - } - } catch (Exception e) { - // Ignore errors - } - return completions; - } - - @Override - public CompletableFuture> documentLink(DocumentLinkParams params) { - return CompletableFuture.supplyAsync(() -> { - String uri = params.getTextDocument().getUri(); - AsciidocDocumentModel model = docs.get(uri); - if (model == null) { - return Collections.emptyList(); - } - - List links = new ArrayList<>(); - List lines = model.getLines(); - - for (int i = 0; i < lines.size(); i++) { - collectLinks(uri, lines.get(i), i, links); - } - - return links; - }); - } - - private void collectLinks(String baseUri, String lineContent, int lineIndex, List links) { - // Pattern for include::path[...], image::path[...], and link:path[...] - Pattern pattern = Pattern.compile("(include|image|link):[:]?([^\\s\\[\\]]+)\\[[^\\]]*\\]"); - Matcher matcher = pattern.matcher(lineContent); - while (matcher.find()) { - String type = matcher.group(1); - String path = matcher.group(2); - int startChar = matcher.start(2); - int endChar = matcher.end(2); - - String targetUri = null; - - if ("link".equals(type)) { - // Handle link: syntax - if (path.startsWith("http://") || path.startsWith("https://")) { - // External link - use URL directly - targetUri = path; - } else { - // Internal file link - resolve relative path - Location loc = resolveFileLocation(baseUri, path); - if (loc != null) { - targetUri = loc.getUri(); - } - } - } else { - // Handle include:: and image:: syntax - Location loc = resolveFileLocation(baseUri, path); - if (loc == null && "image".equals(type)) { - loc = resolveFileLocation(baseUri, "img/" + path); - } - if (loc != null) { - targetUri = loc.getUri(); - } - } - - if (targetUri != null) { - Range range = new Range(new Position(lineIndex, startChar), new Position(lineIndex, endChar)); - DocumentLink link = new DocumentLink(range, targetUri, "Open " + path); - links.add(link); - } - } - } - - @Override - public CompletableFuture>> documentSymbol( - DocumentSymbolParams params) { - return CompletableFuture.supplyAsync(() -> { - // Create a list to hold the symbols - List> symbols = new ArrayList<>(); - - // Create a symbol for a class - DocumentSymbol classSymbol = new DocumentSymbol(); - classSymbol.setName("MyClass"); - classSymbol.setKind(SymbolKind.Class); - classSymbol.setRange(new Range(new Position(0, 0), new Position(0, 10))); - classSymbol.setSelectionRange(new Range(new Position(0, 0), new Position(0, 10))); - - // Create a symbol for a method inside the class - DocumentSymbol methodSymbol = new DocumentSymbol(); - methodSymbol.setName("myMethod"); - methodSymbol.setKind(SymbolKind.Method); - methodSymbol.setRange(new Range(new Position(1, 0), new Position(1, 10))); - methodSymbol.setSelectionRange(new Range(new Position(1, 0), new Position(1, 10))); - - // Add the method symbol as a child of the class symbol - classSymbol.setChildren(List.of(methodSymbol)); - - // Add the class symbol to the list of symbols - symbols.add(Either.forRight(classSymbol)); - - // Return the list of symbols - return symbols; - }); - } - - @Override - public CompletableFuture hover(HoverParams params) { - return CompletableFuture.supplyAsync(() -> { - String uri = params.getTextDocument().getUri(); - AsciidocDocumentModel model = docs.get(uri); - if (model == null) - return null; - - int lineNum = params.getPosition().getLine(); - int charPos = params.getPosition().getCharacter(); - String lineContent = model.getLineContent(lineNum); - if (lineContent == null) - return null; - - // Check for image macro - // Matches image::path[...] or image:path[...] - Pattern imagePattern = Pattern.compile("(image:[:]?([^\\s\\[\\]]+)\\[[^\\]]*\\])"); - Matcher matcher = imagePattern.matcher(lineContent); - - while (matcher.find()) { - // Check if the cursor is within the match range - if (charPos >= matcher.start() && charPos <= matcher.end()) { - String imageName = matcher.group(2); - if (!imageName.isEmpty()) { - try { - URI docUri = new URI(uri); - File docFile = new File(docUri); - File parentDir = docFile.getParentFile(); - - // Try both 'img/' subdirectory and current directory - File imgFile = new File(parentDir, "img/" + imageName); - if (!imgFile.exists()) { - imgFile = new File(parentDir, imageName); - } - - Hover hover = new Hover(); - if (imgFile.exists()) { - String imgUri = imgFile.toURI().toString(); - // Render the actual image in Markdown - String content = String.format("![%s](%s)", imageName, imgUri); - hover.setContents(new MarkupContent(MarkupKind.MARKDOWN, content)); - } else { - // Explicitly inform that the image was not found - String content = String.format("**Image not found:** `%s`\n\nChecked in:\n* `%s`\n* `%s`", - imageName, new File(parentDir, "img/").getPath(), parentDir.getPath()); - hover.setContents(new MarkupContent(MarkupKind.MARKDOWN, content)); - } - return hover; - } catch (Exception e) { - // Fallback to default - } - } - } - } - return null; - }); - } - @Override - public CompletableFuture, List>> definition( - DefinitionParams params) { - - String uri = params.getTextDocument().getUri(); - AsciidocDocumentModel model = this.docs.get(uri); - if (model == null) { - return CompletableFuture.completedFuture(Either.forLeft(Collections.emptyList())); - } - - int line = params.getPosition().getLine(); - int character = params.getPosition().getCharacter(); - - String lineContent = model.getLineContent(line); - if (lineContent == null) { - return CompletableFuture.completedFuture(Either.forLeft(Collections.emptyList())); - } - - // Detect include::path[...] - Pattern includePattern = Pattern.compile("include::([^\\s\\[\\]]+)\\[[^\\]]*\\]"); - Matcher matcher = includePattern.matcher(lineContent); - while (matcher.find()) { - int start = matcher.start(1); - int end = matcher.end(1); - if (character >= start && character <= end) { - String path = matcher.group(1); - Location loc = resolveFileLocation(uri, path); - if (loc != null) { - return CompletableFuture.completedFuture(Either.forLeft(Collections.singletonList(loc))); - } - } - } - - // Detect image::path[...] - Pattern imagePattern = Pattern.compile("image:[:]?([^\\s\\[\\]]+)\\[[^\\]]*\\]"); - matcher = imagePattern.matcher(lineContent); - while (matcher.find()) { - int start = matcher.start(1); - int end = matcher.end(1); - if (character >= start && character <= end) { - String path = matcher.group(1); - // Try direct path - Location loc = resolveFileLocation(uri, path); - if (loc == null) { - // Try in img/ subdirectory - loc = resolveFileLocation(uri, "img/" + path); - } - if (loc != null) { - return CompletableFuture.completedFuture(Either.forLeft(Collections.singletonList(loc))); - } - } - } - - return CompletableFuture.completedFuture(Either.forLeft(Collections.emptyList())); - } - - private Location resolveFileLocation(String baseUri, String relativePath) { - try { - URI uri = new URI(baseUri); - File baseFile = new File(uri); - File parentDir = baseFile.getParentFile(); - File targetFile = new File(parentDir, relativePath); - if (targetFile.exists()) { - Location location = new Location(); - // Normalize the path to remove ./ and ../ components - location.setUri(targetFile.toPath().normalize().toUri().toString()); - location.setRange(new Range(new Position(0, 0), new Position(0, 0))); - return location; - } - } catch (Exception e) { - // ignore - } - return null; - } - - - /** - * Utility method to find the word under the cursor in a given line of text. - */ - private String getWordAtPosition(String lineContent, int character) { - // Define word boundaries (spaces or punctuation) to split the line into words. - // This example assumes simple word boundaries. - int start = character; - int end = character; - - // Find the start of the word (left of the cursor) - while (start > 0 && Character.isLetterOrDigit(lineContent.charAt(start - 1))) { - start--; - } - - // Find the end of the word (right of the cursor) - while (end < lineContent.length() && Character.isLetterOrDigit(lineContent.charAt(end))) { - end++; - } - - // Extract the word - return lineContent.substring(start, end); - } - - @Override - public CompletableFuture resolveCompletionItem(CompletionItem unresolved) { - return null; - } - - - @Override - public CompletableFuture>> codeAction(CodeActionParams params) { - List> actions = new ArrayList<>(); - - // Check the diagnostics for the current document - for (Diagnostic diagnostic : params.getContext().getDiagnostics()) { - if ("placeholder.text.issue".equals(diagnostic.getCode().getLeft())) { - // Create a text edit for replacing the placeholder - TextEdit edit = new TextEdit(); - edit.setRange(diagnostic.getRange()); - edit.setNewText("replacement_text"); - - // Create a workspace edit - WorkspaceEdit workspaceEdit = new WorkspaceEdit(); - workspaceEdit.setChanges(Collections.singletonMap(params.getTextDocument().getUri(), List.of(edit))); - - // Create the code action - CodeAction codeAction = new CodeAction("Replace placeholder with 'replacement_text'"); - codeAction.setKind(CodeActionKind.QuickFix); - codeAction.setEdit(workspaceEdit); - - // Add to the actions list - actions.add(Either.forRight(codeAction)); - } - } - - // Return the actions as a CompletableFuture - return CompletableFuture.completedFuture(actions); - } - - @Override - public CompletableFuture> codeLens(CodeLensParams params) { - return CompletableFuture.supplyAsync(() -> { - // Retrieve the document text from your model - String uri = params.getTextDocument().getUri(); - AsciidocDocumentModel model = docs.get(uri); - if (model == null) { - return Collections.emptyList(); - } - - List codeLenses = new ArrayList<>(); - List lines = model.getLines(); - - // Scan for "TODO" comments - for (int i = 0; i < lines.size(); i++) { - String line = lines.get(i); - int todoIndex = line.indexOf("TODO"); - if (todoIndex != -1) { - // Define the range for the TODO - Range range = new Range(new Position(i, todoIndex), new Position(i, todoIndex + "TODO".length())); - - // Create a CodeLens with a command - Command command = new Command("Resolve TODO", "example.resolveTodo", - Collections.singletonList("Resolve the TODO at line " + (i + 1))); - - CodeLens codeLens = new CodeLens(range, command, null); - codeLenses.add(codeLens); - } - } - - return codeLenses; - }); - } - - @Override - public CompletableFuture resolveCodeLens(CodeLens unresolved) { - return null; - } - - @Override - public CompletableFuture> formatting(DocumentFormattingParams params) { - return null; - } - - @Override - public CompletableFuture> rangeFormatting(DocumentRangeFormattingParams params) { - return null; - } - - @Override - public CompletableFuture> onTypeFormatting(DocumentOnTypeFormattingParams params) { - return null; - } - - @Override - public CompletableFuture rename(RenameParams params) { - return null; - } - - @Override - public void didOpen(DidOpenTextDocumentParams params) { - AsciidocDocumentModel model = new AsciidocDocumentModel(params.getTextDocument().getText()); - this.docs.put(params.getTextDocument().getUri(), model); - CompletableFuture.runAsync(() -> languageServer.client - .publishDiagnostics(new PublishDiagnosticsParams(params.getTextDocument().getUri(), validate(model)))); - - } - - @Override - public void didChange(DidChangeTextDocumentParams params) { - AsciidocDocumentModel model = new AsciidocDocumentModel(params.getContentChanges().get(0).getText()); - this.docs.put(params.getTextDocument().getUri(), model); - CompletableFuture.runAsync(() -> languageServer.client - .publishDiagnostics(new PublishDiagnosticsParams(params.getTextDocument().getUri(), validate(model)))); - - } - - @Override - public void didClose(DidCloseTextDocumentParams params) { - this.docs.remove(params.getTextDocument().getUri()); - } - - @Override - public void didSave(DidSaveTextDocumentParams params) { - } - - private List validate(AsciidocDocumentModel model) { - List diagnostics = new ArrayList<>(); - - // Simulate finding a placeholder issue - for (int i = 0; i < model.getResolvedLines().size(); i++) { - String line = model.getResolvedLines().get(i).text; - int index = line.indexOf("PLACEHOLDER_TEXT"); - if (index != -1) { - // Create a diagnostic for the placeholder text issue - Diagnostic diagnostic = new Diagnostic(); - diagnostic.setSeverity(DiagnosticSeverity.Warning); - diagnostic.setMessage("Found placeholder text that should be replaced."); - diagnostic.setCode("placeholder.text.issue"); - diagnostic.setRange( - new Range(new Position(i, index), new Position(i, index + "PLACEHOLDER_TEXT".length()))); - diagnostics.add(diagnostic); - } - } - - return diagnostics; - } - -} diff --git a/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocWorkspaceService.java b/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocWorkspaceService.java deleted file mode 100644 index c95601e..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocWorkspaceService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.vogella.lsp.asciidoc.server; - -import org.eclipse.lsp4j.DidChangeConfigurationParams; -import org.eclipse.lsp4j.DidChangeWatchedFilesParams; -import org.eclipse.lsp4j.services.WorkspaceService; - -public class AsciidocWorkspaceService implements WorkspaceService { - - - @Override - public void didChangeConfiguration(DidChangeConfigurationParams params) { - } - - @Override - public void didChangeWatchedFiles(DidChangeWatchedFilesParams params) { - } - -} diff --git a/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/Main.java b/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/Main.java deleted file mode 100644 index d49762e..0000000 --- a/lsp/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/Main.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.vogella.lsp.asciidoc.server; - -import java.io.InputStream; -import java.io.OutputStream; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; - -import org.eclipse.lsp4j.jsonrpc.Launcher; -import org.eclipse.lsp4j.launch.LSPLauncher; -import org.eclipse.lsp4j.services.LanguageClient; - -public class Main { - - public static void main(String[] args) throws InterruptedException, ExecutionException { - startServer(System.in, System.out); - } - - public static void startServer(InputStream in, OutputStream out) throws InterruptedException, ExecutionException { - AsciidocLanguageServer server = new AsciidocLanguageServer(); // <.> - Launcher l = LSPLauncher.createServerLauncher(server, in, out); // <.> - Future startListening = l.startListening(); - server.setRemoteProxy(l.getRemoteProxy()); // <.> - startListening.get(); // <.> - } -} diff --git a/lsp/pom.tycho b/lsp/pom.tycho deleted file mode 100644 index d9cb9c2..0000000 --- a/lsp/pom.tycho +++ /dev/null @@ -1,12 +0,0 @@ -# Modules of the "lsp" aggregator. -# -# This file replaces an lsp/pom.xml. Tycho's pomless build reads it and -# generates an aggregator with packaging=pom and artifactId "lsp" (the folder -# name). One module per line, "#" comments and blank lines are ignored. -# -# An explicit list is required here because "lsp" is not one of the folder -# names Tycho scans automatically (bundles, plugins, tests, features, sites, -# products, releng). -com.vogella.lsp.asciidoc.client -com.vogella.lsp.asciidoc.server -com.vogella.lsp.asciidoc.server.tests diff --git a/updatesite/category.xml b/updatesite/category.xml index 7899d07..739bb91 100644 --- a/updatesite/category.xml +++ b/updatesite/category.xml @@ -3,26 +3,16 @@ - - - - - - - - - - Adds "Alt+" and "Alt-" shortcut to perform a next search.