3 | This document is the API specification for the Spring Statemachine project.
4 |
5 |
6 |
7 |
8 | For further API reference and developer documentation, see the
9 | Spring Statemachine Project Page.
10 | There you can find the latest news, links to documentation, books, presentations and webinars.
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docs/src/info/changelog.txt:
--------------------------------------------------------------------------------
1 | SPRING DSL CHANGELOG
2 | ==========================
3 | http://spring.io/spring-dsl/
4 |
5 | Issues: https://github.com/spring-project/spring-dsl/issues
6 |
7 |
--------------------------------------------------------------------------------
/docs/src/info/notice.txt:
--------------------------------------------------------------------------------
1 | ======================================================================
2 | == NOTICE file corresponding to section 4 d of the Apache License, ==
3 | == Version 2.0, for the Spring Framework distribution. ==
4 | ======================================================================
5 |
6 | This product includes software developed by
7 | the Apache Software Foundation (http://www.apache.org).
8 |
9 | The end-user documentation included with a redistribution, if any,
10 | must include the following acknowledgement:
11 |
12 | "This product includes software developed by the Spring Framework
13 | Project (http://www.springframework.org)."
14 |
15 | Alternately, this acknowledgement may appear in the software itself,
16 | if and wherever such third-party acknowledgements normally appear.
17 |
18 | The names "Spring", "Spring Framework" and "Spring Cloud IoT"
19 | must not be used to endorse or promote products derived from this
20 | software without prior written permission. For written permission,
21 | please contact enquiries@springsource.com.
22 |
--------------------------------------------------------------------------------
/docs/src/info/readme.txt:
--------------------------------------------------------------------------------
1 | SPRING CLOUD DSL
2 | ------------------------
3 | http://spring.io/spring-dsl
4 |
5 | 1. INTRODUCTION
6 |
7 | Spring Cloud DSL is a framework extension introducing DSL
8 | concepts in a spring world.
9 |
10 | 2. RELEASE NOTES
11 |
12 | This release comes with complete reference documentation. For further
13 | details, consult the provided javadoc for specific packages and classes.
14 |
15 | 3. DISTRIBUTION JAR FILES
16 |
17 | The Spring DSL jars files can be found in the 'dist' directory.
18 |
19 | 4. GETTING STARTED
20 |
21 | Please see the reference documentation.
22 | Additionally the blog at http://blog.spring.io as well
23 | as sections of interest in the reference documentation.
24 |
25 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/.gitignore:
--------------------------------------------------------------------------------
1 | samples/*
2 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/Guardfile:
--------------------------------------------------------------------------------
1 | require 'asciidoctor'
2 | require 'erb'
3 |
4 | guard 'shell' do
5 | watch(/^.*\.adoc$/) {|m|
6 | Asciidoctor.render_file(m[0], :to_dir => "build/", :safe => Asciidoctor::SafeMode::UNSAFE, :attributes=> {'idprefix' => '', 'idseparator' => '-', 'copycss' => '', 'icons' => 'font', 'source-highlighter' => 'prettify', 'sectanchors' => '', 'doctype' => 'book','toc2' => '', 'spring-hadoop-version' => '2.1.0.BUILD-SNAPSHOT','spring-version' => '4.1.3.RELEASE', 'revnumber' => '2.1.0.BUILD-SNAPSHOT', 'numbered'=>'' })
7 | }
8 | end
9 |
10 | guard 'livereload' do
11 | watch(%r{build/.+\.(css|js|html)$})
12 | end
13 |
14 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/appendix-concepts-crashcourse.adoc:
--------------------------------------------------------------------------------
1 | [[crashcourse]]
2 | === Dsl Crash Course
3 | This appendix provides generic crash course to Dsl concepts.
4 |
5 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/appendix-concepts-glossary.adoc:
--------------------------------------------------------------------------------
1 | [glossary]
2 | === Glossary
3 |
4 | [[glossary-lsp]]
5 | *LSP*::
6 | Language Server Protocol (https://microsoft.github.io/language-server-protocol/)
7 | defines the protocol used between an editor or IDE and a language server that
8 | provides language features like auto complete, etc.
9 |
10 | [[glossary-jsonrpc]]
11 | *JSONRPC*::
12 | _JSONRPC_ is a stateless, light-weight remote procedure call (RPC) protocol.
13 | (https://www.jsonrpc.org/specification)
14 |
15 | [[glossary-linter]]
16 | *Linter*::
17 | A _linter_ or _lint_ refers to tools that analyze source code to flag programming
18 | errors, bugs, stylistic errors, etc.
19 | +
20 | Linting is one of a central concepts when working with various programming
21 | languages to figure out correctness of a language or dsl.
22 |
23 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/appendix-running-ides.adoc:
--------------------------------------------------------------------------------
1 | include::appendix-running-sts.adoc[]
2 | include::appendix-running-vi.adoc[]
3 |
4 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/appendix-running-sts.adoc:
--------------------------------------------------------------------------------
1 | [[appendix-sts]]
2 | === STS
3 | TBD.
4 |
5 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/appendix-running-vi.adoc:
--------------------------------------------------------------------------------
1 | [[appendix-vi]]
2 | === VI
3 | TBD.
4 |
5 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/appendix.adoc:
--------------------------------------------------------------------------------
1 | [[appendices]]
2 | = Appendices
3 |
4 | :numbered!:
5 |
6 | [appendix]
7 | == Spring Dsl Concepts
8 | This appendix provides generic information about Dsl.
9 |
10 | include::appendix-concepts-glossary.adoc[]
11 | include::appendix-concepts-crashcourse.adoc[]
12 |
13 | //[appendix]
14 | //== IDE Integrations
15 | //This appendix provides generic information about integration into IDE's.
16 |
17 | //include::appendix-running-ides.adoc[]
18 |
19 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-antlr.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-antlr]]
2 |
3 | == ANTLR
4 | As many languages are parsed and lexed using _ANTLR_ we try to provide
5 | integration support so that your path to use _ANTLR_ would be as easy
6 | as possible. Realistically this means that we try to be relatively
7 | conservative what comes from _ANTLR_ by providing base implementations
8 | to other parts of the _Spring DSL_.
9 |
10 | Two major areas _Spring DSL_ can help with integration into _ANTLR_ is
11 | _reconciliation_ and _code completion_ which usually are first things
12 | a language developer needs to tackle.
13 |
14 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-boot.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-boot]]
2 |
3 | == Spring Boot Auto Configuration
4 | _Spring Dsl_ is currently not managed by a _Spring Boot_, thus we have our
5 | own `Auto-Configuration` module. `Auto-Configuration` greatly simplifies
6 | cases where _Language Services_ needs to be created.
7 |
8 | As _Language Server_ is usually used in different connection configurations,
9 | `spring.dsl.lsp.server.mode` can have values `PROCESS`, `SOCKET` or
10 | `WEBSOCKET`. Process mode simply uses standard input/output, socket mode
11 | a configured native socket and a websocket mode assumes websocket via webflux
12 | is available.
13 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-core-codecompletion.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-core-codecompletion]]
2 | === Code Completion
3 | `Completioner` is an interface to provide a `Flux` of `CompletionItem`
4 | for a `Document` in a particular `Position`.
5 |
6 | [source,java,indent=0]
7 | ----
8 | include::samples/org/springframework/dsl/docs/CompletionDocs.java[tags=snippet1]
9 | ----
10 |
11 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-core-document.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-core-document]]
2 | === Document
3 | `Document` is an abstraction over tbd.
4 |
5 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-core-domain.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-core-domain]]
2 | === LSP Domain Classes
3 | LSP itself have a set of domain classes defining a contract in a JSONRPC json structures.
4 | While some of these classes are only useful with an actual integration between IDE and
5 | a Language Server, some classes are generally useful as a generic way to pass information
6 | between components.
7 |
8 | All these domain classes are kept in a _Spring Dsl_ core and generally contain _Builder_
9 | and other convenience methods to construct instances of these classes. For example below
10 | we create an instances of a `Position` class.
11 |
12 | [source,java,indent=0]
13 | ----
14 | include::samples/org/springframework/dsl/docs/DomainClassesDocs.java[tags=snippet1]
15 | ----
16 |
17 | And an instances of a `Range` class.
18 |
19 | [source,java,indent=0]
20 | ----
21 | include::samples/org/springframework/dsl/docs/DomainClassesDocs.java[tags=snippet2]
22 | ----
23 |
24 | [NOTE]
25 | ====
26 | Rest of a _LSP_ domain classes follow same pattern.
27 | ====
28 |
29 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-core-dslservice.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-core-dslservice]]
2 | === Dsl Service
3 | `DslService` is an interface a service can implement providing services for various
4 | languages. It currently have only one method returning list of `LanguageId` a
5 | particular service supports. This allows _Spring Dsl_ framework to conditionally
6 | choose services per currently handled `Document`.
7 |
8 | [source,java,indent=0]
9 | ----
10 | include::samples/org/springframework/dsl/docs/CoreDocs.java[tags=snippet2]
11 | ----
12 |
13 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-core-hover.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-core-hover]]
2 | === Hovering
3 | `Hoverer` is an interface to provide a `Hover` information for a `Document`
4 | in a particular `Position`.
5 |
6 | [source,java,indent=0]
7 | ----
8 | include::samples/org/springframework/dsl/docs/HoverDocs.java[tags=snippet1]
9 | ----
10 |
11 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-core-languageid.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-core-languageid]]
2 | === Language Id
3 | _LSP_ itself defines a set or languages it knows natively. We thought it would be a
4 | good idea to have an abstraction over `LanguageId` class. _Spring Dsl_ have mappings
5 | for all languages defined in _LSP_ itself, but if you want to have your own, just
6 | defined it like:
7 |
8 | [source,java,indent=0]
9 | ----
10 | include::samples/org/springframework/dsl/docs/CoreDocs.java[tags=snippet1]
11 | ----
12 |
13 | First time one is about to use `LanguageId` is with <>.
14 |
15 | `LanguageId` also have a method `isCompatibleWith(LanguageId other)` which allows
16 | to check if one language support other type of languages.
17 |
18 | [source,java,indent=0]
19 | ----
20 | include::samples/org/springframework/dsl/docs/CoreDocs.java[tags=snippet3]
21 | ----
22 |
23 | [TIP]
24 | ====
25 | `LanguageId.ALL` supports all languages and can be used in services which
26 | want to support everything. For example `DefaultReconciler` which is dispatching
27 | to all linters, naturally support all languages.
28 | ====
29 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-core-reconcile.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-core-reconcile]]
2 | === Reconciling
3 | Base interface for _reconciliation_ is a _Linter_ which implements a method shown below.
4 |
5 | [source,java,indent=0]
6 | ----
7 | include::samples/org/springframework/dsl/docs/ReconcileDocs.java[tags=snippet1]
8 | ----
9 |
10 | [NOTE]
11 | ====
12 | Bear in mind that we're just throwing out concepts like `Document` and `ReconcileProblem`.
13 | We need to get started from one concept until we get to next one and then glue all
14 | these together.
15 | ====
16 |
17 | Other interface for _reconciliation_ is a _Reconciler_ which is similar than _Linter_
18 | but works on a LSP's `PublishDiagnosticsParams`. Together these two interfaces allow
19 | flexible ways to choose how different documents are reconciled.
20 |
21 | [source,java,indent=0]
22 | ----
23 | include::samples/org/springframework/dsl/docs/ReconcileDocs.java[tags=snippet2]
24 | ----
25 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-core-rename.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-core-rename]]
2 | === Renaming
3 | `Renamer` is an interface to provide a `WorkspaceEdit` information for a `Document` in a `Position` with a new name.
4 |
5 | [source,java,indent=0]
6 | ----
7 | include::samples/org/springframework/dsl/docs/RenameDocs.java[tags=snippet1]
8 | ----
9 |
10 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-core-symbol.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-core-symbol]]
2 | === Symboling
3 | `Symbolizer` is an interface to provide a `Symbol` information for a `Document`.
4 |
5 | [source,java,indent=0]
6 | ----
7 | include::samples/org/springframework/dsl/docs/SymbolDocs.java[tags=snippet1]
8 | ----
9 |
10 | _Symbol_ is a relatively loose concept in terms of a `Document` reconciliation
11 | or checking, what can be said is that with `Symbol` information you can identify
12 | centain parts of a `Document` which most likely are interested when _LSP_
13 | is used with an real _IDE_. Well that was a mouthful, so lets go through what is
14 | a _Symbol_. In _Spring Lsp_ we are basing this interface as a
15 | `SymbolizeInfo` which itself is an interface providing optional methods
16 | returning a `Flux` of `DocumentSymbol` or a `SymbolInformation`. These maps
17 | to a _LSP_ domain with similar structure.
18 |
19 | [NOTE]
20 | ====
21 | There is more detailed chapter about generic use of a _Symboltable_
22 | in a <>.
23 | ====
24 |
25 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-core.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-core]]
2 | == Core Language Services
3 | As you've already seen from an introduction _Spring Dsl_ is heavily based on concepts
4 | around <>. _LSP_ is pretty much based on _JSON_ structures defined
5 | in a protocol itself and these structures are generally quite useful because their
6 | base on a design of a interaction between IDE and a server implementing
7 | _Language Services_. However things tends to get quite low level when working with
8 | plain raw _JSON_ structures so we've think about a lot to abstract away some generic
9 | concepts how _Language Services_ could be made more user friendly.
10 |
11 | To get one started to understand these concepts, lets first tackle the most common
12 | problem of a language or a dsl, that being a <> a language.
13 | Other term is a _reconcile_ which pretty much is a synonym to _linter_.
14 |
15 | include::dsl-core-languageid.adoc[]
16 | include::dsl-core-dslservice.adoc[]
17 | include::dsl-core-domain.adoc[]
18 | include::dsl-core-reconcile.adoc[]
19 | include::dsl-core-codecompletion.adoc[]
20 | include::dsl-core-hover.adoc[]
21 | include::dsl-core-symbol.adoc[]
22 | include::dsl-core-rename.adoc[]
23 |
24 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-jsonrpc-controller.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-jsonrpc-controller]]
2 | === Controller Methods
3 | You can also return any other reactive type similarly as it is possible in
4 | a _Spring WebFlux_. In below example method is annotated with `JsonRpcResponseResult`
5 | which means that returned values needs to be sent back to client.
6 |
7 | [source,java,indent=0]
8 | ----
9 | include::samples/org/springframework/dsl/jsonrpc/docs/ControllerDocs.java[tags=snippet3]
10 | ----
11 |
12 | Methods can just be a plain notification endpoints which is instructed using
13 | `JsonRpcNotification` annotation.
14 |
15 | [source,java,indent=0]
16 | ----
17 | include::samples/org/springframework/dsl/jsonrpc/docs/ControllerDocs.java[tags=snippet4]
18 | ----
19 |
20 | `JsonRpcNotification` annotation also takes an optional _method_ parameter which
21 | modifies how notification is processed. If _method_ parameter exists then values
22 | from a method are sent back as notifications using using same method parameter.
23 |
24 | [source,java,indent=0]
25 | ----
26 | include::samples/org/springframework/dsl/jsonrpc/docs/ControllerDocs.java[tags=snippet5]
27 | ----
28 |
29 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-jsonrpc-session.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-jsonrpc-session]]
2 | === Session
3 | `JsonRpcSession` can be used to store variables and other information between requests until
4 | particular session is kept alive. If you've ever used `WebSession` from a _WebFlux`, this
5 | concept is very similar.
6 |
7 | To access `JsonRpcSession` in a controller methods, simply add is as an parameter and
8 | a framework will call method with associated session. In a below example session id is
9 | simple returned as a mono.
10 |
11 | [source,java,indent=0]
12 | ----
13 | include::samples/org/springframework/dsl/jsonrpc/docs/ControllerDocs.java[tags=snippet6]
14 | ----
15 |
16 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-lsp-controller.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-lsp-controller]]
2 | === Controller Methods
3 | TBD.
4 |
5 | [NOTE]
6 | ====
7 | As _LSP_ features are built atop of generic _JSONRPC_ controller, things documented
8 | in <> are automatically available.
9 | ====
10 |
11 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-lsp-extension.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-lsp-extension]]
2 | === Protocol Extension
3 | Having a custom protocol extension is simple as just registering
4 | a new `JsonRpcController` and defining appropriate
5 | `JsonRpcRequestMapping` for methods. Generic documentation for this
6 | can be found from <>. More about actual method and
7 | method parameters is more closely discussed in <>.
8 |
9 | [source,java,indent=0]
10 | ----
11 | include::samples/org/springframework/dsl/lsp/docs/ExtensionDocs.java[tags=snippet1]
12 | ----
13 |
14 | [source,java,indent=0]
15 | ----
16 | include::samples/org/springframework/dsl/lsp/docs/ExtensionDocs.java[tags=snippet2]
17 | ----
18 |
19 | [source,java,indent=0]
20 | ----
21 | include::samples/org/springframework/dsl/lsp/docs/ExtensionDocs.java[tags=snippet3]
22 | ----
23 |
24 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-lsp-server.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-lsp-server]]
2 | === Language Server
3 | This section describes how a _Language Server_ is created using _Spring Dsl_.
4 |
5 | ==== With Language Services
6 | If you rely solely on services from <> there is not that much you
7 | need to understand about _LSP_ itself.
8 |
9 | There are two server related controllers, `RootLanguageServerController`
10 | and `TextDocumentLanguageServerController` providing basis of a shared
11 | functionality for _Language Servers_.
12 |
13 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-lsp.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-lsp]]
2 | == LSP
3 | Traditionally a _Language Server_ and a _Language Client_ implementations
4 | are just arbitry components following a contract defined in a <>
5 | protocol. While you are free to implement everything from scratch by just
6 | handling _JSONRPC_ traffic between client and server, this is usually rather
7 | tedious process as you need to get very deep understanding how _LSP_ actually
8 | works. We think that integrating a more higher level services described in
9 | <> into a generic controllers handling _LSP_ traffic is much more
10 | user friendly way to implement language services.
11 |
12 | include::dsl-lsp-server.adoc[]
13 | include::dsl-lsp-client.adoc[]
14 | include::dsl-lsp-extension.adoc[]
15 | //include::dsl-lsp-controller.adoc[]
16 |
17 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-symboltable-default.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-sybmoltable-default]]
2 | === Default Symboltable
3 | Default _Symboltable_ implementation in a _Spring Dsl_ is based on
4 | an original implemenation from _ANTLR_ project with modifications to
5 | support further enchacements needed for intergration into _LSP_ features.
6 |
7 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl-symboltable.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-symboltable]]
2 |
3 | == Symboltable
4 | _Symboltable_ is a relatively vague concept of representing various
5 | internals of a symbol information during a translation of an language
6 | into an internal representation of a language itself. It is vague
7 | concept because it is essentially a simple repository or a data
8 | structure not really based on any real world specification.
9 |
10 | [quote, wiki]
11 | ____
12 | Symbol table is a data structure used by a language translator such as
13 | a compiler or interpreter, where each identifier (a.k.a. symbol) in
14 | a program's source code is associated with information relating to its
15 | declaration or appearance in the source. Symbol table stores the
16 | information related about the symbol.
17 | ____
18 |
19 | Most of a time language parsers and lexer really don't care about symbol
20 | information as it really is not their responsibility. For example things
21 | done natively in <> would not be aware of any cross referencing
22 | symbols and if one needs to have this information, one way to do it
23 | is through custom symbol tables. Providing a generic custom table
24 | implementation is one way how _Spring DSL_ can help with these concepts.
25 |
26 | include::dsl-symboltable-default.adoc[]
27 |
28 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/dsl.adoc:
--------------------------------------------------------------------------------
1 | [[dsl]]
2 | = Using Spring Dsl
3 | This part documents how _Spring DSL_ is used.
4 |
5 | include::dsl-core.adoc[]
6 | include::dsl-jsonrpc.adoc[]
7 | include::dsl-lsp.adoc[]
8 | include::dsl-antlr.adoc[]
9 | include::dsl-symboltable.adoc[]
10 | include::dsl-boot.adoc[]
11 |
12 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/faq.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-faq]]
2 | = FAQ
3 | This chapter tries to give solutions to question user is most likely
4 | to ask.
5 |
6 | == DSL
7 | TBD.
8 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/getting-started.adoc:
--------------------------------------------------------------------------------
1 | [[dsl-getting-started]]
2 | = Getting started
3 | If you’re just getting started with Spring Dsl,
4 | this is the section for you! Here we answer the basic
5 | “what?”, “how?” and “why?” questions. You’ll find a gentle
6 | introduction to Spring Dsl.
7 |
8 | == System Requirements
9 | Spring Dsl {revnumber} is built and tested with
10 | JDK 8, Spring Framework {spring-version}, Spring Boot
11 | {spring-boot-version} and ANTLR {antlr-version}.
12 |
13 | == Modules
14 | The following modules are available for Spring Dsl
15 |
16 | |===
17 | |Module |Description
18 |
19 | |spring-dsl-antrl
20 | |ANTLR support Module
21 |
22 | |spring-dsl-autoconfigure
23 | |Spring Boot Autoconfigure Module
24 |
25 | |spring-dsl-bom
26 | |Spring DSL Bill of Materials Module
27 |
28 | |spring-dsl-core
29 | |Core system of a Spring DSL
30 |
31 | |spring-dsl-jsonrpc
32 | |Core JSONRPC Module
33 |
34 | |spring-dsl-lsp-core
35 | |Core LSP Module
36 |
37 | |spring-dsl-symboltable
38 | |Spring DSL Symboltable
39 |
40 | |spring-dsl-websocket
41 | |Spring DSL Websocket Module
42 |
43 | |===
44 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/images/dsl-examples-showcase-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/docs/src/reference/asciidoc/images/dsl-examples-showcase-1.png
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/index-docinfo.xml:
--------------------------------------------------------------------------------
1 | {revnumber}
2 | Spring Dsl
3 |
4 |
5 | Janne
6 | Valkealahti
7 | Pivotal
8 |
9 |
10 | Kris
11 | De Volder
12 | Pivotal
13 |
14 |
15 |
16 |
17 | 2018
18 | Pivotal Software, Inc.
19 |
20 |
21 |
22 | Copies of this document may be made for your own use and for
23 | distribution to others, provided that you do not charge any fee for such
24 | copies and further provided that each copy contains this Copyright
25 | Notice, whether distributed in print or electronically.
26 |
27 |
28 |
--------------------------------------------------------------------------------
/docs/src/reference/asciidoc/preface.adoc:
--------------------------------------------------------------------------------
1 | [preface]
2 | == Preface
3 | This reference documentation contains the following parts.
4 |
5 | <> introduction to this reference documentation
6 |
7 | <> Getting started
8 |
9 | <> Spring Dsl documentation
10 |
11 | <> Spring Dsl Samples
12 |
13 | <> Frequently asked questions
14 |
15 | <> generic info about used material
16 |
17 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | version=0.0.1.BUILD-SNAPSHOT
2 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/spring-dsl-antlr/src/main/java/org/springframework/dsl/antlr/AntlrCompletionResult.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.antlr;
17 |
18 | import java.util.List;
19 | import java.util.Map;
20 |
21 | /**
22 | * Contract representing a results from a {@link AntlrCompletionEngine}.
23 | *
24 | * @author Janne Valkealahti
25 | *
26 | */
27 | public interface AntlrCompletionResult {
28 |
29 | /**
30 | * Gets the result tokens.
31 | *
32 | * @return the tokens
33 | */
34 | Map> getTokens();
35 |
36 | /**
37 | * Gets the result rules.
38 | *
39 | * @return the rules
40 | */
41 | Map> getRules();
42 | }
43 |
--------------------------------------------------------------------------------
/spring-dsl-antlr/src/test/antlr/Test1.g4:
--------------------------------------------------------------------------------
1 | grammar Test1;
2 |
3 | r : AB ;
4 |
5 | AB : 'AB' ;
6 |
--------------------------------------------------------------------------------
/spring-dsl-antlr/src/test/antlr/Test2Grammar.g4:
--------------------------------------------------------------------------------
1 | // taking partial grammar from a spring statemachine to test various concepts
2 | parser grammar Test2Grammar;
3 |
4 | options {
5 | tokenVocab=Test2Lexer;
6 | }
7 |
8 | definitions : ( statemachine* | machineObjectList) EOF;
9 | machineObjectList : ( state | transition )* ;
10 | statemachine : STATEMACHINE id LBRACE machineObjectList RBRACE ;
11 | state : STATE id LBRACE stateParameters RBRACE ;
12 | transition : TRANSITION id? LBRACE transitionParameters RBRACE ;
13 | stateParameters : ( stateParameter SEMI? )* ;
14 | stateParameter : stateType id? ;
15 | stateType : INITIAL | END ;
16 | transitionParameters : ( transitionParameter SEMI? )* ;
17 | transitionParameter : transitionType ;
18 | transitionType : SOURCE sourceId | TARGET targetId ;
19 | sourceId : ID ;
20 | targetId : ID ;
21 | id : ID ;
22 |
--------------------------------------------------------------------------------
/spring-dsl-antlr/src/test/antlr/Test2Lexer.g4:
--------------------------------------------------------------------------------
1 | // taking partial grammar from a spring statemachine to test various concepts
2 | lexer grammar Test2Lexer;
3 |
4 | STATE : [Ss][Tt][Aa][Tt][Ee] ;
5 | STATEMACHINE : [Ss][Tt][Aa][Tt][Ee][Mm][Aa][Cc][Hh][Ii][Nn][Ee] ;
6 | LBRACE : '{' ;
7 | RBRACE : '}' ;
8 | TRANSITION : [Tt][Rr][Aa][Nn][Ss][Ii][Tt][Ii][Oo][Nn] ;
9 | INITIAL : [Ii][Nn][Ii][Tt][Ii][Aa][Ll] ;
10 | END : [Ee][Nn][Dd] ;
11 | SOURCE : [Ss][Oo][Uu][Rr][Cc][Ee] ;
12 | TARGET : [Tt][Aa][Rr][Gg][Ee][Tt] ;
13 | ID : LETTER (LETTER|DIGIT)* ;
14 | fragment LETTER : [a-zA-Z\u0080-\u00FF_] ;
15 | SEMI : ';' ;
16 | fragment DIGIT : [0-9] ;
17 | WS : [ \t\n\r]+ -> channel(HIDDEN) ;
18 |
--------------------------------------------------------------------------------
/spring-dsl-antlr/src/test/java/org/springframework/dsl/antlr/Test2ErrorListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.antlr;
17 |
18 | import java.util.List;
19 |
20 | import org.springframework.dsl.antlr.support.AbstractAntlrErrorListener;
21 | import org.springframework.dsl.service.reconcile.ReconcileProblem;
22 |
23 | public class Test2ErrorListener extends AbstractAntlrErrorListener {
24 |
25 | public Test2ErrorListener(List errors) {
26 | super(errors);
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/spring-dsl-antlr/src/test/resources/org/springframework/dsl/antlr/AntlrCompletionerTests-1.test2:
--------------------------------------------------------------------------------
1 | state S1 {
2 | initial
3 | }
4 | state S2 {}
5 | state S3 {
6 | end
7 | }
8 |
9 | transition T1 {
10 | source S1
11 | target S2
12 | }
13 | transition T2 {
14 | source S2
15 | target S3
16 | }
17 |
--------------------------------------------------------------------------------
/spring-dsl-antlr/src/test/resources/org/springframework/dsl/antlr/AntlrCompletionerTests-2.test2:
--------------------------------------------------------------------------------
1 | state S1 {
2 | initial
3 | }
4 | state S2 {}
5 | state S3 {
6 | end
7 | }
8 |
9 | transition T1 {
10 | source
--------------------------------------------------------------------------------
/spring-dsl-antlr/src/test/resources/org/springframework/dsl/antlr/AntlrLinterTests-1.test2:
--------------------------------------------------------------------------------
1 | state S1 {
2 | initial
3 | }
4 | state S2 {}
5 | state S3 {
6 | end
7 | }
8 |
9 | transition T1 {
10 | source S1
11 | target S2
12 | }
13 | transition T2 {
14 | source S2
15 | target S3
16 | }
17 |
--------------------------------------------------------------------------------
/spring-dsl-antlr/src/test/resources/org/springframework/dsl/antlr/AntlrLinterTests-2.test2:
--------------------------------------------------------------------------------
1 | state S1 {
2 | initial
3 |
4 | state S2 {}
5 | state S3 {
6 | end
7 | }
8 |
9 | transition T1 {
10 | source S1
11 | target S2
12 | }
13 | transition T2 {
14 | source S2
15 | target S3
16 | }
17 |
--------------------------------------------------------------------------------
/spring-dsl-antlr/src/test/resources/org/springframework/dsl/antlr/AntlrLinterTests-3.test2:
--------------------------------------------------------------------------------
1 | state S1 {
2 | initial
3 | }
4 | state S2 {}
5 | state S3 {
6 | end
7 | }
8 |
9 | transition T1 {
10 | source S1
11 | target S4
12 | }
13 | transition T2 {
14 | source S2
15 | target S4
16 | }
17 |
--------------------------------------------------------------------------------
/spring-dsl-antlr/src/test/resources/org/springframework/dsl/antlr/AntlrLinterTests-4.test2:
--------------------------------------------------------------------------------
1 | statemachine M1 {
2 |
3 | state S1 {
4 | initial
5 | }
6 | state S2 {}
7 | state S3 {
8 | end
9 | }
10 |
11 | transition T1 {
12 | source S1
13 | target S4
14 | }
15 | transition T2 {
16 | source S2
17 | target S4
18 | }
19 |
20 | }
--------------------------------------------------------------------------------
/spring-dsl-antlr/src/test/resources/org/springframework/dsl/antlr/AntlrLinterTests-5.test2:
--------------------------------------------------------------------------------
1 | s
--------------------------------------------------------------------------------
/spring-dsl-antlr/src/test/resources/org/springframework/dsl/antlr/AntlrSymbolizerTests-1.test2:
--------------------------------------------------------------------------------
1 | state S1 {
2 | initial
3 | }
4 |
--------------------------------------------------------------------------------
/spring-dsl-autoconfigure/src/main/java/org/springframework/dsl/autoconfigure/DslConfigurationProperties.java:
--------------------------------------------------------------------------------
1 | package org.springframework.dsl.autoconfigure;
2 |
3 | import org.springframework.boot.context.properties.ConfigurationProperties;
4 | import org.springframework.dsl.lsp.server.config.DslProperties;
5 |
6 | /**
7 | * {@link ConfigurationProperties} for settings under {@code spring.dsl}.
8 | *
9 | * @author Janne Valkealahti
10 | *
11 | */
12 | @ConfigurationProperties(prefix = "spring.dsl")
13 | public class DslConfigurationProperties extends DslProperties {
14 | }
15 |
--------------------------------------------------------------------------------
/spring-dsl-autoconfigure/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | # Auto Configure
2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
3 | org.springframework.dsl.autoconfigure.DslAutoConfiguration,\
4 | org.springframework.dsl.autoconfigure.LspClientAutoConfiguration,\
5 | org.springframework.dsl.autoconfigure.LspServerAutoConfiguration,\
6 | org.springframework.dsl.autoconfigure.LanguageServerControllerAutoConfiguration
7 |
--------------------------------------------------------------------------------
/spring-dsl-bom/spring-dsl-bom.txt:
--------------------------------------------------------------------------------
1 | This meta-project is used to generate a bill-of-materials POM that contains the other
2 | projects in a dependencyManagement section.
3 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/DslParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl;
17 |
18 | import org.springframework.core.io.Resource;
19 |
20 | /**
21 | * Interface for a parser able to parse a content into a {@link DslParserResult}.
22 | *
23 | * @author Janne Valkealahti
24 | *
25 | * @param the type of {@link DslParserResult} value
26 | */
27 | public interface DslParser {
28 |
29 | /**
30 | * Parse given {@link Resource} into a {@link DslParserResult}.
31 | *
32 | * @param resource the parse source
33 | * @return the parsed {@code DslParserResult}
34 | */
35 | DslParserResult parse(Resource resource);
36 | }
37 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/DslSystemConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl;
17 |
18 | /**
19 | * Various constants defined for a whole {@code DSL} space.
20 | *
21 | * @author Janne Valkealahti
22 | *
23 | */
24 | public final class DslSystemConstants {
25 | }
26 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/document/Region.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.document;
17 |
18 | /**
19 | * Describes a raw reqion as offset as starting point and length as ending point.
20 | *
21 | * @author Kris De Volder
22 | * @author Janne Valkealahti
23 | *
24 | */
25 | public interface Region {
26 |
27 | /**
28 | * Gets the offset.
29 | *
30 | * @return the offset
31 | */
32 | int getOffset();
33 |
34 | /**
35 | * Gets the length.
36 | *
37 | * @return the length
38 | */
39 | int getLength();
40 | }
41 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/domain/CompletionTriggerKind.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.domain;
17 |
18 | public enum CompletionTriggerKind {
19 |
20 | Invoked(1),
21 |
22 | TriggerCharacter(2),
23 |
24 | TriggerForIncompleteCompletions(3);
25 |
26 | private final int value;
27 |
28 | CompletionTriggerKind(int value) {
29 | this.value = value;
30 | }
31 |
32 | public int getValue() {
33 | return value;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/domain/CreateFileKind.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.domain;
17 |
18 | public enum CreateFileKind {
19 |
20 | create;
21 | }
22 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/domain/DeleteFileKind.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.domain;
17 |
18 | public enum DeleteFileKind {
19 |
20 | delete;
21 | }
22 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/domain/FoldingRangeKind.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.domain;
17 |
18 | /**
19 | * Possible kinds for a {@link FoldingRange}.
20 | *
21 | * @author Janne Valkealahti
22 | *
23 | */
24 | public enum FoldingRangeKind {
25 |
26 | comment,
27 |
28 | imports,
29 |
30 | region;
31 | }
32 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/domain/InitializedParams.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.domain;
17 |
18 | public class InitializedParams {
19 |
20 | @Override
21 | public boolean equals(final Object obj) {
22 | if (this == obj)
23 | return true;
24 | if (obj == null)
25 | return false;
26 | if (getClass() != obj.getClass())
27 | return false;
28 | return true;
29 | }
30 |
31 | @Override
32 | public int hashCode() {
33 | int result = 1;
34 | return result;
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/domain/InsertTextFormat.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.domain;
17 |
18 | public enum InsertTextFormat {
19 |
20 | PlainText(1),
21 |
22 | Snippet(2);
23 |
24 | private final int value;
25 |
26 | InsertTextFormat(int value) {
27 | this.value = value;
28 | }
29 |
30 | public int getValue() {
31 | return value;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/domain/MarkupKind.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.domain;
17 |
18 | public enum MarkupKind {
19 |
20 | plaintext,
21 |
22 | markdown;
23 | }
24 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/domain/RenameFileKind.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.domain;
17 |
18 | public enum RenameFileKind {
19 |
20 | rename;
21 | }
22 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/domain/SaveOptions.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.domain;
17 |
18 | public class SaveOptions {
19 |
20 | private Boolean includeText;
21 |
22 | public Boolean getIncludeText() {
23 | return includeText;
24 | }
25 |
26 | public void setIncludeText(Boolean includeText) {
27 | this.includeText = includeText;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/service/DslService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.service;
17 |
18 | import java.util.List;
19 |
20 | import org.springframework.dsl.model.LanguageId;
21 |
22 | /**
23 | * Base interface for {@code DslService}s.
24 | *
25 | * @author Janne Valkealahti
26 | *
27 | */
28 | public interface DslService {
29 |
30 | /**
31 | * Gets the supported language ids.
32 | *
33 | * @return the supported language ids
34 | */
35 | List getSupportedLanguageIds();
36 | }
37 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/service/Folderer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.service;
17 |
18 | import org.springframework.dsl.domain.FoldingRange;
19 |
20 | import reactor.core.publisher.Flux;
21 |
22 | /**
23 | * Strategy interface providing {@link FoldingRange} info for current document.
24 | *
25 | * @author Janne Valkealahti
26 | *
27 | */
28 | public interface Folderer extends DslService {
29 |
30 | /**
31 | * Provide folding range information for a given document.
32 | *
33 | * @param context the context
34 | * @return a folding range info
35 | */
36 | Flux fold(DslContext context);
37 | }
38 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/service/Lenser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.dsl.service;
18 |
19 | import org.springframework.dsl.domain.CodeLens;
20 |
21 | import reactor.core.publisher.Flux;
22 |
23 | /**
24 | * Strategy interface providing {@link CodeLens} info for current document.
25 | *
26 | * @author Janne Valkealahti
27 | *
28 | */
29 | public interface Lenser extends DslService {
30 |
31 | /**
32 | * Provide lense information for a given document.
33 | *
34 | * @param context the context
35 | * @return a code lense info
36 | */
37 | Flux lense(DslContext context);
38 | }
39 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/service/ListenerList.java:
--------------------------------------------------------------------------------
1 | package org.springframework.dsl.service;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 | import java.util.function.Consumer;
6 |
7 | import reactor.core.Disposable;
8 |
9 | public class ListenerList {
10 |
11 | private List> listeners = new ArrayList<>();
12 |
13 | public synchronized void fire(T evt) {
14 | for (Consumer l : listeners) {
15 | l.accept(evt);
16 | }
17 | }
18 |
19 | public synchronized Disposable add(Consumer l) {
20 | listeners.add(l);
21 | return () -> {
22 | synchronized (this) {
23 | listeners.remove(l);
24 | }
25 | };
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/service/document/DocumentServiceHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.service.document;
17 |
18 | import java.net.URI;
19 |
20 | /**
21 | *
22 | * @author Janne Valkealahti
23 | *
24 | */
25 | public interface DocumentServiceHandler {
26 |
27 | boolean supports(URI uri);
28 |
29 | String get(URI uri);
30 |
31 | void save(URI uri, String document);
32 | }
33 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/main/java/org/springframework/dsl/support/DomainBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.support;
17 |
18 | /**
19 | * Base interface for domain builder classes.
20 | *
21 | * @author Janne Valkealahti
22 | *
23 | * @param
the parent builder type
24 | */
25 | public interface DomainBuilder {
26 |
27 | /**
28 | * Switches back to parent builder.
29 | *
30 | * @return the parent builder
31 | */
32 | P and();
33 |
34 | /**
35 | * Builds a configured object.
36 | *
37 | * @return the build object
38 | */
39 | T build();
40 | }
41 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/test/java/org/springframework/dsl/docs/CompletionDocs.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.docs;
17 |
18 | import org.springframework.dsl.domain.CompletionItem;
19 | import org.springframework.dsl.domain.Position;
20 | import org.springframework.dsl.service.Completioner;
21 | import org.springframework.dsl.service.DslContext;
22 |
23 | import reactor.core.publisher.Flux;
24 |
25 | public class CompletionDocs {
26 |
27 | interface DocsCompletioner extends Completioner {
28 |
29 | @Override
30 | // tag::snippet1[]
31 | Flux complete(DslContext context, Position position);
32 | // end::snippet1[]
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/test/java/org/springframework/dsl/docs/HoverDocs.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.docs;
17 |
18 | import org.springframework.dsl.domain.Hover;
19 | import org.springframework.dsl.domain.Position;
20 | import org.springframework.dsl.service.DslContext;
21 | import org.springframework.dsl.service.Hoverer;
22 |
23 | import reactor.core.publisher.Mono;
24 |
25 | public class HoverDocs {
26 |
27 | interface DocsHoverer extends Hoverer {
28 |
29 | @Override
30 | // tag::snippet1[]
31 | Mono hover(DslContext context, Position position);
32 | // end::snippet1[]
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/test/java/org/springframework/dsl/docs/RenameDocs.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.docs;
17 |
18 | import org.springframework.dsl.domain.Position;
19 | import org.springframework.dsl.domain.WorkspaceEdit;
20 | import org.springframework.dsl.service.DslContext;
21 | import org.springframework.dsl.service.Renamer;
22 |
23 | import reactor.core.publisher.Mono;
24 |
25 | public class RenameDocs {
26 |
27 | interface DocsRenamer extends Renamer {
28 |
29 | @Override
30 | // tag::snippet1[]
31 | Mono rename(DslContext context, Position position, String newName);
32 | // end::snippet1[]
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/spring-dsl-core/src/test/java/org/springframework/dsl/docs/SymbolDocs.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.docs;
17 |
18 | import org.springframework.dsl.service.DslContext;
19 | import org.springframework.dsl.service.symbol.SymbolizeInfo;
20 | import org.springframework.dsl.service.symbol.Symbolizer;
21 |
22 | public class SymbolDocs {
23 |
24 | interface DocsHoverer extends Symbolizer {
25 |
26 | @Override
27 | // tag::snippet1[]
28 | SymbolizeInfo symbolize(DslContext context);
29 | // end::snippet1[]
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/spring-dsl-jsonrpc/src/main/java/org/springframework/dsl/jsonrpc/JsonRpcHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.jsonrpc;
17 |
18 | import reactor.core.publisher.Mono;
19 |
20 | /**
21 | * Contract to handle a {@code JSONRCP} request.
22 | *
23 | * @author Janne Valkealahti
24 | *
25 | */
26 | public interface JsonRpcHandler {
27 |
28 | /**
29 | * Handle the json rpc exchange.
30 | *
31 | * @param exchange the current json rpc exchange
32 | * @return {@code Mono} to indicate when request handling is complete
33 | */
34 | Mono handle(ServerJsonRpcExchange exchange);
35 | }
36 |
--------------------------------------------------------------------------------
/spring-dsl-jsonrpc/src/main/java/org/springframework/dsl/jsonrpc/JsonRpcHandlerMapping.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.dsl.jsonrpc;
17 |
18 | import reactor.core.publisher.Mono;
19 |
20 | public interface JsonRpcHandlerMapping {
21 |
22 | Mono