├── .gitignore ├── CODE_OF_CONDUCT.adoc ├── LICENSE ├── README.adoc ├── build.gradle ├── docs └── src │ ├── api │ ├── overview.html │ └── stylesheet.css │ ├── info │ ├── changelog.txt │ ├── license.txt │ ├── notice.txt │ └── readme.txt │ └── reference │ └── asciidoc │ ├── .gitignore │ ├── Guardfile │ ├── appendix-concepts-crashcourse.adoc │ ├── appendix-concepts-glossary.adoc │ ├── appendix-running-ides.adoc │ ├── appendix-running-sts.adoc │ ├── appendix-running-vi.adoc │ ├── appendix.adoc │ ├── dsl-antlr.adoc │ ├── dsl-boot.adoc │ ├── dsl-core-codecompletion.adoc │ ├── dsl-core-document.adoc │ ├── dsl-core-domain.adoc │ ├── dsl-core-dslservice.adoc │ ├── dsl-core-hover.adoc │ ├── dsl-core-languageid.adoc │ ├── dsl-core-reconcile.adoc │ ├── dsl-core-rename.adoc │ ├── dsl-core-symbol.adoc │ ├── dsl-core.adoc │ ├── dsl-examples-dot.adoc │ ├── dsl-examples-showcase.adoc │ ├── dsl-examples-simple.adoc │ ├── dsl-examples-wordcheck.adoc │ ├── dsl-examples.adoc │ ├── dsl-jsonrpc-controller.adoc │ ├── dsl-jsonrpc-session.adoc │ ├── dsl-jsonrpc.adoc │ ├── dsl-lsp-client.adoc │ ├── dsl-lsp-controller.adoc │ ├── dsl-lsp-extension.adoc │ ├── dsl-lsp-server.adoc │ ├── dsl-lsp.adoc │ ├── dsl-symboltable-default.adoc │ ├── dsl-symboltable.adoc │ ├── dsl.adoc │ ├── faq.adoc │ ├── getting-started.adoc │ ├── images │ └── dsl-examples-showcase-1.png │ ├── index-docinfo.xml │ ├── index.adoc │ ├── introduction.adoc │ └── preface.adoc ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── publish-maven.gradle ├── settings.gradle ├── spring-dsl-antlr └── src │ ├── main │ └── java │ │ └── org │ │ └── springframework │ │ └── dsl │ │ └── antlr │ │ ├── AntlrCompletionEngine.java │ │ ├── AntlrCompletionResult.java │ │ ├── AntlrFactory.java │ │ ├── AntlrParseResult.java │ │ ├── AntlrParseService.java │ │ └── support │ │ ├── AbstractAntlrCompletioner.java │ │ ├── AbstractAntlrDslService.java │ │ ├── AbstractAntlrErrorListener.java │ │ ├── AbstractAntlrHoverer.java │ │ ├── AbstractAntlrLinter.java │ │ ├── AbstractAntlrParseResultFunction.java │ │ ├── AbstractAntlrSymbolizer.java │ │ ├── AntlrObjectSupport.java │ │ ├── AntlrUtils.java │ │ ├── DefaultAntlrCompletionEngine.java │ │ └── DefaultAntlrParseService.java │ └── test │ ├── antlr │ ├── Test1.g4 │ ├── Test2Grammar.g4 │ └── Test2Lexer.g4 │ ├── java │ └── org │ │ └── springframework │ │ └── dsl │ │ └── antlr │ │ ├── AntlrCompletionerTests.java │ │ ├── AntlrHovererTests.java │ │ ├── AntlrLinterTests.java │ │ ├── AntlrSymbolizerTests.java │ │ ├── Test2AntlrCompletioner.java │ │ ├── Test2AntlrHoverer.java │ │ ├── Test2AntlrLinter.java │ │ ├── Test2AntlrParseResultFunction.java │ │ ├── Test2AntlrSymbolizer.java │ │ ├── Test2ErrorListener.java │ │ ├── Test2Visitor.java │ │ ├── TestAntrlUtils.java │ │ ├── TestResourceUtils.java │ │ └── support │ │ ├── DefaultAntlrCompletionEngineTests.java │ │ └── DefaultAntlrParseServiceTests.java │ └── resources │ └── org │ └── springframework │ └── dsl │ └── antlr │ ├── AntlrCompletionerTests-1.test2 │ ├── AntlrCompletionerTests-2.test2 │ ├── AntlrLinterTests-1.test2 │ ├── AntlrLinterTests-2.test2 │ ├── AntlrLinterTests-3.test2 │ ├── AntlrLinterTests-4.test2 │ ├── AntlrLinterTests-5.test2 │ └── AntlrSymbolizerTests-1.test2 ├── spring-dsl-autoconfigure └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── dsl │ │ │ └── autoconfigure │ │ │ ├── DslAutoConfiguration.java │ │ │ ├── DslConfigurationProperties.java │ │ │ ├── LanguageServerControllerAutoConfiguration.java │ │ │ ├── LspClientAutoConfiguration.java │ │ │ └── LspServerAutoConfiguration.java │ └── resources │ │ └── META-INF │ │ └── spring.factories │ └── test │ └── java │ └── org │ └── springframework │ └── dsl │ └── autoconfigure │ └── LspServerAutoConfigurationTests.java ├── spring-dsl-bom └── spring-dsl-bom.txt ├── spring-dsl-build-tests └── src │ └── test │ └── java │ └── org │ └── springframework │ └── dsl │ └── buildtests │ ├── AbstractLspIntegrationTests.java │ └── LspNettySocketLspServerIntegrationTests.java ├── spring-dsl-core └── src │ ├── main │ └── java │ │ └── org │ │ └── springframework │ │ └── dsl │ │ ├── DslException.java │ │ ├── DslParser.java │ │ ├── DslParserResult.java │ │ ├── DslSystemConstants.java │ │ ├── document │ │ ├── BadLocationException.java │ │ ├── DefaultDocumentLineTracker.java │ │ ├── DefaultRegion.java │ │ ├── Document.java │ │ ├── DocumentLineTracker.java │ │ ├── DocumentRegion.java │ │ ├── DocumentText.java │ │ ├── Region.java │ │ ├── TextDocument.java │ │ └── TextDocumentState.java │ │ ├── domain │ │ ├── ClientCapabilities.java │ │ ├── CodeLens.java │ │ ├── CodeLensOptions.java │ │ ├── CodeLensParams.java │ │ ├── Command.java │ │ ├── CompletionClientCapabilities.java │ │ ├── CompletionContext.java │ │ ├── CompletionItem.java │ │ ├── CompletionItemCapabilities.java │ │ ├── CompletionItemKind.java │ │ ├── CompletionItemKindCapabilities.java │ │ ├── CompletionList.java │ │ ├── CompletionOptions.java │ │ ├── CompletionParams.java │ │ ├── CompletionTriggerKind.java │ │ ├── CreateFile.java │ │ ├── CreateFileKind.java │ │ ├── CreateFileOptions.java │ │ ├── DeleteFile.java │ │ ├── DeleteFileKind.java │ │ ├── DeleteFileOptions.java │ │ ├── Diagnostic.java │ │ ├── DiagnosticSeverity.java │ │ ├── DidChangeTextDocumentParams.java │ │ ├── DidCloseTextDocumentParams.java │ │ ├── DidOpenTextDocumentParams.java │ │ ├── DidSaveTextDocumentParams.java │ │ ├── DocumentSymbol.java │ │ ├── DocumentSymbolParams.java │ │ ├── DynamicRegistration.java │ │ ├── FoldingRange.java │ │ ├── FoldingRangeKind.java │ │ ├── FoldingRangeParams.java │ │ ├── Hover.java │ │ ├── InitializeParams.java │ │ ├── InitializeResult.java │ │ ├── InitializedParams.java │ │ ├── InsertTextFormat.java │ │ ├── Location.java │ │ ├── LogMessageParams.java │ │ ├── MarkedString.java │ │ ├── MarkupContent.java │ │ ├── MarkupKind.java │ │ ├── MessageActionItem.java │ │ ├── MessageParams.java │ │ ├── MessageType.java │ │ ├── Position.java │ │ ├── PublishDiagnosticsParams.java │ │ ├── Range.java │ │ ├── Registration.java │ │ ├── RegistrationParams.java │ │ ├── RenameFile.java │ │ ├── RenameFileKind.java │ │ ├── RenameFileOptions.java │ │ ├── RenameParams.java │ │ ├── SaveOptions.java │ │ ├── ServerCapabilities.java │ │ ├── ShowMessageRequestParams.java │ │ ├── SymbolInformation.java │ │ ├── SymbolKind.java │ │ ├── Synchronization.java │ │ ├── TextDocumentClientCapabilities.java │ │ ├── TextDocumentContentChangeEvent.java │ │ ├── TextDocumentEdit.java │ │ ├── TextDocumentIdentifier.java │ │ ├── TextDocumentItem.java │ │ ├── TextDocumentPositionParams.java │ │ ├── TextDocumentSaveReason.java │ │ ├── TextDocumentSyncKind.java │ │ ├── TextDocumentSyncOptions.java │ │ ├── TextEdit.java │ │ ├── Unregistration.java │ │ ├── VersionedTextDocumentIdentifier.java │ │ ├── WillSaveTextDocumentParams.java │ │ ├── WorkspaceEdit.java │ │ └── WorkspaceSymbolParams.java │ │ ├── model │ │ ├── LanguageId.java │ │ └── TrackedDocument.java │ │ ├── service │ │ ├── AbstractDslService.java │ │ ├── Completioner.java │ │ ├── DefaultDocumentStateTracker.java │ │ ├── DefaultDslServiceRegistry.java │ │ ├── DocumentStateTracker.java │ │ ├── DslContext.java │ │ ├── DslService.java │ │ ├── DslServiceRegistry.java │ │ ├── Folderer.java │ │ ├── Hoverer.java │ │ ├── Lenser.java │ │ ├── ListenerList.java │ │ ├── Renamer.java │ │ ├── document │ │ │ ├── DefaultDocumentService.java │ │ │ ├── DocumentService.java │ │ │ └── DocumentServiceHandler.java │ │ ├── reconcile │ │ │ ├── DefaultReconcileProblem.java │ │ │ ├── DefaultReconciler.java │ │ │ ├── Linter.java │ │ │ ├── ProblemSeverity.java │ │ │ ├── ProblemType.java │ │ │ ├── ProblemTypes.java │ │ │ ├── ReconcileProblem.java │ │ │ └── Reconciler.java │ │ └── symbol │ │ │ ├── SymbolizeInfo.java │ │ │ └── Symbolizer.java │ │ └── support │ │ ├── AbstractDomainBuilder.java │ │ ├── DefaultDslContextBuilder.java │ │ ├── DomainBuilder.java │ │ ├── DslUtils.java │ │ └── SymbolizeInfoWrapper.java │ └── test │ └── java │ └── org │ └── springframework │ └── dsl │ ├── docs │ ├── CompletionDocs.java │ ├── CoreDocs.java │ ├── DomainClassesDocs.java │ ├── HoverDocs.java │ ├── ReconcileDocs.java │ ├── RenameDocs.java │ └── SymbolDocs.java │ ├── document │ ├── DefaultDocumentLineTrackerTests.java │ ├── DocumentRegionTests.java │ ├── DocumentTextTests.java │ ├── TextDocumentStateTests.java │ └── TextDocumentTests.java │ ├── domain │ └── RangeTests.java │ ├── model │ └── LanguageIdTests.java │ └── service │ ├── DefaultDocumentStateTrackerTests.java │ └── reconcile │ └── DefaultReconcilerTests.java ├── spring-dsl-jsonrpc └── src │ ├── main │ └── java │ │ └── org │ │ └── springframework │ │ └── dsl │ │ └── jsonrpc │ │ ├── JsonRpcHandler.java │ │ ├── JsonRpcHandlerAdapter.java │ │ ├── JsonRpcHandlerMapping.java │ │ ├── JsonRpcHandlerResult.java │ │ ├── JsonRpcHandlerResultHandler.java │ │ ├── JsonRpcInputMessage.java │ │ ├── JsonRpcMessage.java │ │ ├── JsonRpcOutputMessage.java │ │ ├── JsonRpcRequest.java │ │ ├── JsonRpcResponse.java │ │ ├── JsonRpcSystemConstants.java │ │ ├── ServerJsonRpcExchange.java │ │ ├── annotation │ │ ├── JsonRpcController.java │ │ ├── JsonRpcNotification.java │ │ ├── JsonRpcRequestMapping.java │ │ ├── JsonRpcRequestParams.java │ │ └── JsonRpcResponseResult.java │ │ ├── codec │ │ ├── DefaultJsonRpcExtractorStrategiesBuilder.java │ │ ├── Jackson2JsonRpcMessageWriter.java │ │ ├── JsonRpcExtractor.java │ │ ├── JsonRpcExtractorStrategies.java │ │ └── JsonRpcMessageWriter.java │ │ ├── config │ │ ├── DelegatingJsonRpcConfiguration.java │ │ ├── EnableJsonRpc.java │ │ └── JsonRpcJacksonConfiguration.java │ │ ├── jackson │ │ ├── JsonRpcJackson2ObjectMapperBuilder.java │ │ ├── JsonRpcJackson2ObjectMapperBuilderCustomizer.java │ │ └── JsonRpcJackson2ObjectMapperFactoryBean.java │ │ ├── result │ │ ├── HandlerResultHandlerSupport.java │ │ ├── condition │ │ │ ├── AbstractRequestCondition.java │ │ │ ├── JsonRcpRequestMethodsRequestCondition.java │ │ │ └── JsonRpcRequestCondition.java │ │ └── method │ │ │ ├── AbstractHandlerMethodMapping.java │ │ │ ├── HandlerMethod.java │ │ │ ├── InvocableHandlerMethod.java │ │ │ ├── JsonRpcHandlerMethodArgumentResolver.java │ │ │ ├── JsonRpcMethodParamsArgumentResolver.java │ │ │ ├── JsonRpcRequestMappingInfo.java │ │ │ ├── JsonRpcRequestParamsArgumentResolver.java │ │ │ └── annotation │ │ │ ├── AbstractMessageWriterResultHandler.java │ │ │ ├── JsonRpcNotificationResultHandler.java │ │ │ ├── JsonRpcRequestMappingHandlerAdapter.java │ │ │ ├── JsonRpcRequestMappingHandlerMapping.java │ │ │ ├── JsonRpcResponseResultResultHandler.java │ │ │ └── ServerJsonRpcExchangeArgumentResolver.java │ │ ├── session │ │ ├── DefaultJsonRpcSessionManager.java │ │ ├── InMemoryJsonRpcSessionStore.java │ │ ├── JsonRpcSession.java │ │ ├── JsonRpcSessionIdResolver.java │ │ ├── JsonRpcSessionManager.java │ │ ├── JsonRpcSessionStore.java │ │ └── RequestSessionIdJsonRpcSessionIdResolver.java │ │ └── support │ │ ├── AbstractJsonRpcObject.java │ │ ├── AbstractJsonRpcOutputMessage.java │ │ ├── ChannelSendOperator.java │ │ ├── ControllerMethodResolver.java │ │ ├── DefaultJsonRpcRequest.java │ │ ├── DefaultJsonRpcRequestJsonDeserializer.java │ │ ├── DefaultJsonRpcResponse.java │ │ ├── DefaultJsonRpcResponseJsonDeserializer.java │ │ ├── DefaultServerJsonRpcExchange.java │ │ ├── DispatcherJsonRpcHandler.java │ │ ├── JsonRpcRequestJsonDeserializer.java │ │ └── JsonRpcResponseJsonDeserializer.java │ └── test │ └── java │ └── org │ └── springframework │ └── dsl │ └── jsonrpc │ ├── DispatcherJsonRpcHandlerTests.java │ ├── ResolvableMethod.java │ ├── codec │ └── JsonRpcExtractorStrategiesTests.java │ ├── docs │ └── ControllerDocs.java │ ├── result │ └── method │ │ ├── HandlerMethodMappingTests.java │ │ ├── InvocableHandlerMethodTests.java │ │ └── annotation │ │ ├── JsonRpcRequestMappingHandlerMappingTests.java │ │ └── JsonRpcResponseResultResultHandlerTests.java │ └── support │ ├── DispatcherJsonRpcHandlerTests.java │ ├── MockJsonRpcInputMessage.java │ ├── MockJsonRpcOutputMessage.java │ └── MockServerJsonRpcExchange.java ├── spring-dsl-lsp-core └── src │ ├── main │ └── java │ │ └── org │ │ └── springframework │ │ └── dsl │ │ └── lsp │ │ ├── LspSystemConstants.java │ │ ├── LspVersionDetector.java │ │ ├── client │ │ ├── AbstractLspClient.java │ │ ├── ClientReactorJsonRpcHandlerAdapter.java │ │ ├── DefaultLspClientBuilder.java │ │ ├── DefaultLspClientResponse.java │ │ ├── DefaultLspClientResponseBuilder.java │ │ ├── ExchangeNotificationFunction.java │ │ ├── ExchangeRequestFunction.java │ │ ├── LspClient.java │ │ ├── LspClientResponse.java │ │ ├── NettyBoundedLspClient.java │ │ ├── NettyTcpClientLspClient.java │ │ ├── config │ │ │ └── EnableLanguageClient.java │ │ └── controller │ │ │ └── WindowLanguageClientController.java │ │ └── server │ │ ├── LspServer.java │ │ ├── LspServerException.java │ │ ├── LspServerFactory.java │ │ ├── PortInUseException.java │ │ ├── config │ │ ├── DslProperties.java │ │ ├── EnableLanguageServer.java │ │ ├── GenericLspConfiguration.java │ │ ├── LspDomainJacksonConfiguration.java │ │ ├── LspServerSocketConfiguration.java │ │ └── LspServerStdioConfiguration.java │ │ ├── controller │ │ ├── RootLanguageServerController.java │ │ ├── TextDocumentLanguageServerController.java │ │ └── WorkspaceLanguageServerController.java │ │ ├── domain │ │ ├── CompletionItemKindDeserializer.java │ │ ├── CompletionItemKindSerializer.java │ │ ├── DiagnosticSeverityDeserializer.java │ │ ├── DiagnosticSeveritySerializer.java │ │ ├── FoldingRangeKindDeserializer.java │ │ ├── FoldingRangeKindSerializer.java │ │ ├── MarkupKindDeserializer.java │ │ ├── MarkupKindSerializer.java │ │ ├── MessageTypeDeserializer.java │ │ ├── MessageTypeSerializer.java │ │ ├── ServerCapabilitiesJsonDeserializer.java │ │ ├── ServerCapabilitiesJsonSerializer.java │ │ ├── SymbolKindDeserializer.java │ │ ├── SymbolKindSerializer.java │ │ ├── WorkspaceEditDeserializer.java │ │ └── WorkspaceEditSerializer.java │ │ ├── jsonrpc │ │ ├── LspClientArgumentResolver.java │ │ ├── LspDomainArgumentResolver.java │ │ ├── LspJsonRpcDecoder.java │ │ ├── LspJsonRpcEncoder.java │ │ ├── LspSessionState.java │ │ ├── NettyTcpServer.java │ │ ├── ReactorJsonRpcHandlerAdapter.java │ │ ├── ReactorJsonRpcOutputMessage.java │ │ ├── RpcHandler.java │ │ └── RpcJsonRpcHandlerAdapter.java │ │ └── support │ │ ├── JvmLspExiter.java │ │ ├── LspExiter.java │ │ ├── LspServerRefreshListener.java │ │ └── StdioSocketBridge.java │ └── test │ ├── java │ └── org │ │ └── springframework │ │ └── dsl │ │ └── lsp │ │ ├── LspVersionDetectorTests.java │ │ ├── client │ │ └── DefaultLspClientResponseTests.java │ │ ├── docs │ │ ├── ClientDocs.java │ │ └── ExtensionDocs.java │ │ └── server │ │ ├── controller │ │ └── RootLanguageServerControllerTests.java │ │ ├── domain │ │ └── LspDomainJacksonSerializationTests.java │ │ └── jsonrpc │ │ ├── LspDomainArgumentResolverTests.java │ │ ├── LspJsonRpcDecoderTests.java │ │ └── NettyTcpServerIntegrationTests.java │ └── resources │ └── org │ └── springframework │ └── dsl │ └── lsp │ └── server │ └── domain │ ├── ClientCapabilities1.json │ ├── CodeLens1.json │ ├── CodeLensOptions1.json │ ├── CodeLensParams1.json │ ├── Command1.json │ ├── Command2.json │ ├── Command3.json │ ├── CompletionClientCapabilities1.json │ ├── CompletionItem1.json │ ├── CompletionItemCapabilities1.json │ ├── CompletionItemKindCapabilities1.json │ ├── CompletionList1.json │ ├── CompletionOptions1.json │ ├── Diagnostic1.json │ ├── DocumentSymbol1.json │ ├── DocumentSymbolParams1.json │ ├── DynamicRegistration1.json │ ├── FoldingRange1.json │ ├── FoldingRangeParams1.json │ ├── Hover1.json │ ├── Hover2.json │ ├── InitializeParams1.json │ ├── InitializeResult1.json │ ├── Location1.json │ ├── LogMessageParams1.json │ ├── MarkupContent1.json │ ├── MessageActionItem1.json │ ├── MessageParams1.json │ ├── PublishDiagnosticsParams1.json │ ├── PublishDiagnosticsParams2.json │ ├── Range1.json │ ├── Registration1.json │ ├── Registration2.json │ ├── RegistrationParams1.json │ ├── RenameParams1.json │ ├── ServerCapabilities1.json │ ├── ServerCapabilities2.json │ ├── ShowMessageRequestParams1.json │ ├── ShowMessageRequestParams2.json │ ├── ShowMessageRequestParams3.json │ ├── SymbolInformation1.json │ ├── Synchronization1.json │ ├── TextDocumentClientCapabilities1.json │ ├── TextDocumentEdit1.json │ ├── TextDocumentPositionParams1.json │ ├── TextDocumentSyncOptions1.json │ ├── TextEdit1.json │ ├── Unregistration1.json │ ├── WorkspaceEdit1.json │ ├── WorkspaceEdit2.json │ ├── WorkspaceEdit3.json │ ├── WorkspaceEdit4.json │ ├── WorkspaceEdit5.json │ ├── WorkspaceEdit6.json │ └── WorkspaceSymbolParams1.json ├── spring-dsl-lsp-web └── src │ └── main │ └── java │ └── org │ └── springframework │ └── dsl │ └── lsp │ └── web │ └── DocumentController.java ├── spring-dsl-samples ├── build.gradle ├── dotdsl │ └── src │ │ ├── main │ │ ├── antlr │ │ │ └── DOT.g4 │ │ └── java │ │ │ └── demo │ │ │ └── dotdsl │ │ │ ├── DOTAntlrParseResultFunction.java │ │ │ ├── DOTLanguageConfiguration.java │ │ │ ├── DOTLanguageLinter.java │ │ │ ├── DOTLanguageVisitor.java │ │ │ └── EnableDOTLanguage.java │ │ └── test │ │ └── java │ │ └── demo │ │ └── dotdsl │ │ └── DOTLanguageLinterTests.java ├── showcase │ └── src │ │ └── main │ │ └── java │ │ └── demo │ │ └── showcase │ │ ├── EnableShowcaseFeatures.java │ │ ├── ShowcaseCommandsController.java │ │ ├── ShowcaseConfiguration.java │ │ └── ShowcaseHoverer.java ├── showcaseeditor │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── demo │ │ │ │ └── showcaseeditor │ │ │ │ └── Application.java │ │ │ └── resources │ │ │ └── application.yml │ └── ui │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── README.md │ │ ├── angular.json │ │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── patch.js │ │ ├── src │ │ ├── app │ │ │ ├── actions.ts │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ └── editor-tab-group │ │ │ │ ├── editor-tab-group.component.css │ │ │ │ ├── editor-tab-group.component.html │ │ │ │ └── editor-tab-group.component.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ │ ├── tsconfig.json │ │ └── tslint.json ├── simpledsl │ └── src │ │ ├── main │ │ └── java │ │ │ └── demo │ │ │ └── simpledsl │ │ │ ├── EnableSimpleLanguage.java │ │ │ ├── SimpleLanguage.java │ │ │ ├── SimpleLanguageCompletioner.java │ │ │ ├── SimpleLanguageConfiguration.java │ │ │ ├── SimpleLanguageDslService.java │ │ │ ├── SimpleLanguageHoverer.java │ │ │ ├── SimpleLanguageLinter.java │ │ │ └── SimpleLanguageSymbolizer.java │ │ └── test │ │ └── java │ │ └── demo │ │ └── simpledsl │ │ ├── SimpleLanguageCompletionerTests.java │ │ ├── SimpleLanguageHovererTests.java │ │ ├── SimpleLanguageLinterTests.java │ │ ├── SimpleLanguageSymbolizerTests.java │ │ └── SimpleLanguageTests.java ├── simpledsleditor │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── demo │ │ │ │ └── simpledsleditor │ │ │ │ └── Application.java │ │ │ └── resources │ │ │ └── application.yml │ └── ui │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── README.md │ │ ├── angular.json │ │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── patch.js │ │ ├── src │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ └── app.module.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ │ ├── tsconfig.json │ │ └── tslint.json ├── simpledslprocessserver │ └── src │ │ ├── main │ │ ├── java │ │ │ └── demo │ │ │ │ └── simpledslprocessserver │ │ │ │ └── Application.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── logback-spring.xml │ │ └── test │ │ └── resources │ │ └── test.ssml ├── simpledslsocketserver │ └── src │ │ ├── main │ │ ├── java │ │ │ └── demo │ │ │ │ └── simpledslsocketserver │ │ │ │ └── Application.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── resources │ │ └── test.ssml ├── spring-dsl-editor-lib │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── patch.js │ ├── projects │ │ └── spring-dsl-editor │ │ │ ├── karma.conf.js │ │ │ ├── ng-package.json │ │ │ ├── ng-package.prod.json │ │ │ ├── package.json │ │ │ ├── src │ │ │ ├── empty.ts │ │ │ ├── lib │ │ │ │ ├── config.ts │ │ │ │ ├── spring-dsl-document-service.spec.ts │ │ │ │ ├── spring-dsl-document.service.ts │ │ │ │ ├── spring-dsl-editor.component.css │ │ │ │ ├── spring-dsl-editor.component.html │ │ │ │ ├── spring-dsl-editor.component.spec.ts │ │ │ │ ├── spring-dsl-editor.component.ts │ │ │ │ ├── spring-dsl-editor.module.ts │ │ │ │ ├── spring-dsl-editor.service.spec.ts │ │ │ │ ├── spring-dsl-editor.service.ts │ │ │ │ └── spring-monaco-editor │ │ │ │ │ ├── base-editor.ts │ │ │ │ │ ├── config.ts │ │ │ │ │ ├── monaco-editor.service.spec.ts │ │ │ │ │ ├── monaco-editor.service.ts │ │ │ │ │ ├── monaco-loader.service.spec.ts │ │ │ │ │ ├── monaco-loader.service.ts │ │ │ │ │ ├── spring-monaco-editor.component.css │ │ │ │ │ ├── spring-monaco-editor.component.html │ │ │ │ │ ├── spring-monaco-editor.component.spec.ts │ │ │ │ │ ├── spring-monaco-editor.component.ts │ │ │ │ │ └── types.ts │ │ │ ├── public_api.ts │ │ │ └── test.ts │ │ │ ├── tsconfig.lib.json │ │ │ ├── tsconfig.spec.json │ │ │ └── tslint.json │ ├── proxy.conf.json │ ├── src │ │ ├── app │ │ │ ├── actions.ts │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ └── editor-tab-group │ │ │ │ ├── editor-tab-group.component.css │ │ │ │ ├── editor-tab-group.component.html │ │ │ │ └── editor-tab-group.component.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── src │ └── main │ │ └── java │ │ └── demo │ │ └── common │ │ └── SampleRedirectConfiguration.java ├── wordcheckdsl │ └── src │ │ ├── main │ │ └── java │ │ │ └── demo │ │ │ └── wordcheckdsl │ │ │ ├── EnableWordcheckLanguage.java │ │ │ ├── FuzzyMatcher.java │ │ │ ├── WordcheckLanguageCompletioner.java │ │ │ ├── WordcheckLanguageConfiguration.java │ │ │ ├── WordcheckLanguageLinter.java │ │ │ ├── WordcheckLanguageRenamer.java │ │ │ ├── WordcheckLanguageSupport.java │ │ │ ├── WordcheckLanguageSymbolizer.java │ │ │ └── WordcheckProperties.java │ │ └── test │ │ └── java │ │ └── demo │ │ └── wordcheckdsl │ │ ├── WordcheckLanguageCompletionerTests.java │ │ ├── WordcheckLanguageLinterTests.java │ │ ├── WordcheckLanguageRenamerTests.java │ │ └── WordcheckLanguageSymbolizerTests.java ├── wordcheckdsleditor │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── demo │ │ │ │ └── wordcheckdsleditor │ │ │ │ └── Application.java │ │ │ └── resources │ │ │ └── application.yml │ └── ui │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── README.md │ │ ├── angular.json │ │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── patch.js │ │ ├── src │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ └── app.module.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ │ ├── tsconfig.json │ │ └── tslint.json ├── wordcheckdsleditorservlet │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── demo │ │ │ │ └── wordcheckdsleditorservlet │ │ │ │ └── Application.java │ │ │ └── resources │ │ │ └── application.yml │ └── ui │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── README.md │ │ ├── angular.json │ │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── patch.js │ │ ├── src │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ └── app.module.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ │ ├── tsconfig.json │ │ └── tslint.json └── wordcheckdslprocessserver │ └── src │ └── main │ ├── java │ └── demo │ │ └── wordcheckdslprocessserver │ │ └── Application.java │ └── resources │ ├── application.yml │ └── logback-spring.xml ├── spring-dsl-starter-lspserver-reactive └── spring-dsl-starter-lspserver-reactive.txt ├── spring-dsl-starter-lspserver-servlet └── spring-dsl-starter-lspserver-servlet.txt ├── spring-dsl-starter-lspserver └── spring-dsl-starter-lspserver.txt ├── spring-dsl-symboltable └── src │ ├── main │ └── java │ │ └── org │ │ └── springframework │ │ └── dsl │ │ └── symboltable │ │ ├── MemberSymbol.java │ │ ├── Modifier.java │ │ ├── Scope.java │ │ ├── Symbol.java │ │ ├── SymbolTable.java │ │ ├── SymbolTableException.java │ │ ├── SymbolTableVisitor.java │ │ ├── Type.java │ │ ├── TypedSymbol.java │ │ ├── model │ │ ├── ArrayType.java │ │ ├── BaseModifier.java │ │ ├── BaseScope.java │ │ ├── BaseSymbol.java │ │ ├── ClassSymbol.java │ │ ├── DataAggregateSymbol.java │ │ ├── FieldSymbol.java │ │ ├── FunctionSymbol.java │ │ ├── FunctionType.java │ │ ├── GlobalScope.java │ │ ├── InvalidType.java │ │ ├── LocalScope.java │ │ ├── MethodSymbol.java │ │ ├── NamedModifier.java │ │ ├── ParameterSymbol.java │ │ ├── PointerType.java │ │ ├── PredefinedScope.java │ │ ├── PrimitiveType.java │ │ ├── StructSymbol.java │ │ ├── SymbolWithScope.java │ │ ├── TypeAlias.java │ │ ├── VariableSymbol.java │ │ └── VisibilityModifier.java │ │ └── support │ │ ├── AbstractSymbolTable.java │ │ ├── DefaultSymbolTable.java │ │ ├── DocumentSymbolTableVisitor.java │ │ ├── StringTable.java │ │ └── Utils.java │ └── test │ └── java │ └── org │ └── springframework │ └── dsl │ └── symboltable │ ├── ClassSymbolTests.java │ ├── DocumentSymbolTableVisitorTests.java │ ├── LocalScopeTests.java │ ├── SymbolTableTests.java │ └── TestSymbolTableVisitor.java ├── spring-dsl-websocket-reactive └── src │ └── main │ └── java │ └── org │ └── springframework │ └── dsl │ └── lsp │ └── server │ └── websocket │ └── reactive │ ├── LspWebSocketConfig.java │ ├── LspWebSocketHandler.java │ └── WebSocketBoundedLspClient.java └── spring-dsl-websocket-servlet └── src └── main └── java └── org └── springframework └── dsl └── lsp └── server └── websocket └── servlet ├── LspServletWebSocketConfig.java ├── LspServletWebSocketHandler.java ├── LspServletWebSocketHandlerConfig.java └── WebSocketBoundedLspClient.java /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | bin 3 | build 4 | .settings 5 | .classpath 6 | .project 7 | *.iml 8 | *.log 9 | *.ipr 10 | *.iws 11 | *.swp 12 | *.tmp 13 | metastore_db 14 | /src/test/resources/s3.properties 15 | /.idea/ 16 | .DS_Store 17 | /out/ 18 | target 19 | classes 20 | .sts4-cache 21 | .attach_pid* 22 | node_modules 23 | *.log 24 | *.gz 25 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | # spring-dsl is no longer actively maintained by VMware, Inc. 2 | 3 | = Spring Dsl 4 | 5 | The Spring Dsl project aims to provide a common infrastructure to work with various concepts around different languages 6 | integrating those into a _Spring_ world. 7 | 8 | [NOTE] 9 | ==== 10 | This project is currently in incubation. 11 | ==== 12 | 13 | == Code of Conduct 14 | This project adheres to the Contributor Covenant 15 | link:CODE_OF_CONDUCT.adoc[code of conduct]. 16 | By participating, you are expected to uphold this code. Please report 17 | unacceptable behavior to spring-code-of-conduct@pivotal.io. 18 | 19 | == License 20 | Spring Dsl is Open Source software released under the 21 | http://www.apache.org/licenses/LICENSE-2.0.html[Apache 2.0 license]. 22 | 23 | -------------------------------------------------------------------------------- /docs/src/api/overview.html: -------------------------------------------------------------------------------- 1 | 2 | 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 getHandler(ServerJsonRpcExchange request); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /spring-dsl-jsonrpc/src/main/java/org/springframework/dsl/jsonrpc/JsonRpcMessage.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 | /** 19 | * Base {@code JSONRPC} message aware of {@code jsonrpc} and {@code id} mandatory fields. 20 | * 21 | * @author Janne Valkealahti 22 | * 23 | */ 24 | public interface JsonRpcMessage { 25 | 26 | /** 27 | * Gets the jsonrpc field. 28 | * 29 | * @return the jsonrpc 30 | */ 31 | String getJsonrpc(); 32 | 33 | /** 34 | * Gets the id field. 35 | * 36 | * @return the id 37 | */ 38 | String getId(); 39 | } 40 | -------------------------------------------------------------------------------- /spring-dsl-jsonrpc/src/main/java/org/springframework/dsl/jsonrpc/JsonRpcRequest.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 | /** 19 | * Base {@code JSONRPC} request message aware of {@code method} and {@code params} fields. 20 | * 21 | * @author Janne Valkealahti 22 | * 23 | */ 24 | public interface JsonRpcRequest extends JsonRpcMessage { 25 | 26 | /** 27 | * Gets the method. 28 | * 29 | * @return the method 30 | */ 31 | public String getMethod(); 32 | 33 | /** 34 | * Gets the params. 35 | * 36 | * @return the params 37 | */ 38 | public Object getParams(); 39 | } 40 | -------------------------------------------------------------------------------- /spring-dsl-jsonrpc/src/main/java/org/springframework/dsl/jsonrpc/JsonRpcResponse.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 | /** 19 | * Base {@code JSONRPC} request message aware of {@code result} and {@code error} fields. 20 | * 21 | * @author Janne Valkealahti 22 | * 23 | */ 24 | public interface JsonRpcResponse extends JsonRpcMessage { 25 | 26 | /** 27 | * Gets the result. 28 | * 29 | * @return the result 30 | */ 31 | public String getResult(); 32 | 33 | /** 34 | * Gets the error. 35 | * 36 | * @return the error 37 | */ 38 | public String getError(); 39 | } 40 | -------------------------------------------------------------------------------- /spring-dsl-jsonrpc/src/main/java/org/springframework/dsl/jsonrpc/JsonRpcSystemConstants.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 | /** 19 | * Various constants defined for a whole {@code JSONRPC} space. 20 | * 21 | * @author Janne Valkealahti 22 | * 23 | */ 24 | public class JsonRpcSystemConstants { 25 | 26 | /** Bean name for jsonrpc jackson object mapper */ 27 | public final static String JSONRPC_OBJECT_MAPPER_BEAN_NAME = "jsonRpcObjectMapper"; 28 | } 29 | -------------------------------------------------------------------------------- /spring-dsl-jsonrpc/src/main/java/org/springframework/dsl/jsonrpc/codec/JsonRpcExtractor.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.codec; 17 | 18 | import org.springframework.dsl.jsonrpc.JsonRpcMessage; 19 | 20 | import com.fasterxml.jackson.databind.ObjectMapper; 21 | 22 | @FunctionalInterface 23 | public interface JsonRpcExtractor { 24 | 25 | T extract(M message, Context context); 26 | 27 | interface Context { 28 | 29 | ObjectMapper objectMapper(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring-dsl-jsonrpc/src/main/java/org/springframework/dsl/jsonrpc/jackson/JsonRpcJackson2ObjectMapperBuilderCustomizer.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.jackson; 17 | 18 | @FunctionalInterface 19 | public interface JsonRpcJackson2ObjectMapperBuilderCustomizer { 20 | 21 | /** 22 | * Customize the Jackson2ObjectMapperBuilder. 23 | * 24 | * @param builder the builder to customize 25 | */ 26 | void customize(JsonRpcJackson2ObjectMapperBuilder builder); 27 | } 28 | -------------------------------------------------------------------------------- /spring-dsl-jsonrpc/src/test/java/org/springframework/dsl/jsonrpc/DispatcherJsonRpcHandlerTests.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 org.springframework.dsl.jsonrpc.support.DispatcherJsonRpcHandler; 19 | 20 | /** 21 | * Tests for {@link DispatcherJsonRpcHandler}. 22 | * 23 | * @author Janne Valkealahti 24 | * 25 | */ 26 | public class DispatcherJsonRpcHandlerTests { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/main/java/org/springframework/dsl/lsp/server/jsonrpc/LspSessionState.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.lsp.server.jsonrpc; 17 | 18 | /** 19 | * Enumeration of a possible lsp session states. 20 | * 21 | * @author Janne Valkealahti 22 | * 23 | */ 24 | public enum LspSessionState { 25 | 26 | CREATED, 27 | INITIALIZED; 28 | } 29 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/java/org/springframework/dsl/lsp/server/controller/RootLanguageServerControllerTests.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.lsp.server.controller; 17 | 18 | /** 19 | * Tests for {@link RootLanguageServerController}. 20 | * 21 | * @author Janne Valkealahti 22 | * 23 | */ 24 | public class RootLanguageServerControllerTests { 25 | 26 | static class Config { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/ClientCapabilities1.json: -------------------------------------------------------------------------------- 1 | { 2 | "textDocument": { 3 | "synchronization": { 4 | "dynamicRegistration": true, 5 | "willSave": true, 6 | "willSaveWaitUntil": true, 7 | "didSave": true 8 | } 9 | }, 10 | "experimental": "experimental" 11 | } -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/CodeLens1.json: -------------------------------------------------------------------------------- 1 | { 2 | "range": { 3 | "start": { 4 | "line": 0, 5 | "character": 0 6 | }, 7 | "end": { 8 | "line": 1, 9 | "character": 1 10 | } 11 | }, 12 | "command": { 13 | "title": "title", 14 | "command": "command", 15 | "arguments": [ 16 | "arg1", 17 | "arg2" 18 | ] 19 | }, 20 | "data": "data" 21 | } 22 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/CodeLensOptions1.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolveProvider": true 3 | } 4 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/CodeLensParams1.json: -------------------------------------------------------------------------------- 1 | { 2 | "textDocument": { 3 | "uri": "uri" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/Command1.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "title", 3 | "command": "command", 4 | "arguments": [ 5 | "arg1", 6 | "arg2" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/Command2.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "title", 3 | "command": "command" 4 | } 5 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/Command3.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "title", 3 | "command": "command", 4 | "arguments": [ 5 | "arg1" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/CompletionClientCapabilities1.json: -------------------------------------------------------------------------------- 1 | { 2 | "dynamicRegistration": true, 3 | "contextSupport": true, 4 | "completionItem": { 5 | "snippetSupport": true, 6 | "commitCharactersSupport": true, 7 | "documentationFormat": [ 8 | "markdown", 9 | "plaintext" 10 | ], 11 | "deprecatedSupport": true, 12 | "preselectSupport": true 13 | }, 14 | "completionItemKind": { 15 | "valueSet": [ 16 | 1, 17 | 2, 18 | 3 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/CompletionItemCapabilities1.json: -------------------------------------------------------------------------------- 1 | { 2 | "snippetSupport": true, 3 | "commitCharactersSupport": true, 4 | "documentationFormat": [ 5 | "markdown", 6 | "plaintext" 7 | ], 8 | "deprecatedSupport": true, 9 | "preselectSupport": true 10 | } 11 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/CompletionItemKindCapabilities1.json: -------------------------------------------------------------------------------- 1 | { 2 | "valueSet": [ 3 | 1, 4 | 2, 5 | 25 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/CompletionList1.json: -------------------------------------------------------------------------------- 1 | { 2 | "isIncomplete": true, 3 | "items": [ 4 | { 5 | "label": "label1", 6 | "kind": null, 7 | "detail": null, 8 | "documentation": null, 9 | "sortText": null, 10 | "filterText": null, 11 | "insertText": null, 12 | "insertTextFormat": null, 13 | "textEdit": null, 14 | "additionalTextEdits": null, 15 | "commitCharacters": null, 16 | "command": null, 17 | "data": null 18 | }, 19 | { 20 | "label": "label2", 21 | "kind": null, 22 | "detail": null, 23 | "documentation": null, 24 | "sortText": null, 25 | "filterText": null, 26 | "insertText": null, 27 | "insertTextFormat": null, 28 | "textEdit": null, 29 | "additionalTextEdits": null, 30 | "commitCharacters": null, 31 | "command": null, 32 | "data": null 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/CompletionOptions1.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolveProvider": true, 3 | "triggerCharacters": [ 4 | "a", 5 | "b" 6 | ] 7 | } -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/Diagnostic1.json: -------------------------------------------------------------------------------- 1 | { 2 | "range": { 3 | "start": { 4 | "line": 1, 5 | "character": 1 6 | }, 7 | "end": { 8 | "line": 2, 9 | "character": 2 10 | } 11 | }, 12 | "severity": 1, 13 | "code": "code", 14 | "source": "source", 15 | "message": "message" 16 | } -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/DocumentSymbol1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "name", 3 | "detail": "detail", 4 | "kind": 18, 5 | "deprecated": true, 6 | "range": { 7 | "start": { 8 | "line": 1, 9 | "character": 1 10 | }, 11 | "end": { 12 | "line": 2, 13 | "character": 2 14 | } 15 | }, 16 | "selectionRange": { 17 | "start": { 18 | "line": 1, 19 | "character": 1 20 | }, 21 | "end": { 22 | "line": 2, 23 | "character": 2 24 | } 25 | }, 26 | "children": [ 27 | { 28 | "name": "name1" 29 | }, 30 | { 31 | "name": "name2" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/DocumentSymbolParams1.json: -------------------------------------------------------------------------------- 1 | { 2 | "textDocument": { 3 | "uri": "uri" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/DynamicRegistration1.json: -------------------------------------------------------------------------------- 1 | { 2 | "dynamicRegistration": true 3 | } -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/FoldingRange1.json: -------------------------------------------------------------------------------- 1 | { 2 | "startLine": 1, 3 | "startCharacter": 2, 4 | "endLine": 3, 5 | "endCharacter": 4, 6 | "kind": "imports" 7 | } 8 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/FoldingRangeParams1.json: -------------------------------------------------------------------------------- 1 | { 2 | "textDocument": { 3 | "uri": "uri" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/Hover1.json: -------------------------------------------------------------------------------- 1 | { 2 | "contents": { 3 | "kind": "plaintext", 4 | "value": "value" 5 | }, 6 | "range": { 7 | "start": { 8 | "line": 1, 9 | "character": 1 10 | }, 11 | "end": { 12 | "line": 2, 13 | "character": 2 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/Hover2.json: -------------------------------------------------------------------------------- 1 | { 2 | "contents": { 3 | "kind": "markdown", 4 | "value": "value" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/InitializeResult1.json: -------------------------------------------------------------------------------- 1 | { 2 | "capabilities": { 3 | "textDocumentSync": { 4 | "openClose": true, 5 | "willSave": true, 6 | "willSaveWaitUntil": true 7 | }, 8 | "hoverProvider": true, 9 | "completionProvider": { 10 | "resolveProvider": true, 11 | "triggerCharacters": [ 12 | "a", 13 | "b" 14 | ] 15 | }, 16 | "codeLensProvider": { 17 | "resolveProvider": true 18 | }, 19 | "renameProvider": true 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/Location1.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "uri", 3 | "range": { 4 | "start": { 5 | "line": 1, 6 | "character": 1 7 | }, 8 | "end": { 9 | "line": 2, 10 | "character": 2 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/LogMessageParams1.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": 1, 3 | "message": "message" 4 | } 5 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/MarkupContent1.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "markdown", 3 | "value": "value" 4 | } -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/MessageActionItem1.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "title" 3 | } 4 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/MessageParams1.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": 3, 3 | "message": "message" 4 | } 5 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/PublishDiagnosticsParams1.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "uri", 3 | "diagnostics": [ 4 | { 5 | "range": { 6 | "start": { 7 | "line": 1, 8 | "character": 1 9 | }, 10 | "end": { 11 | "line": 2, 12 | "character": 2 13 | } 14 | }, 15 | "severity": null, 16 | "code": null, 17 | "source": null, 18 | "message": null 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/PublishDiagnosticsParams2.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "uri", 3 | "diagnostics": [ 4 | { 5 | "range": { 6 | "start": { 7 | "line": 1, 8 | "character": 1 9 | }, 10 | "end": { 11 | "line": 2, 12 | "character": 2 13 | } 14 | }, 15 | "severity": null, 16 | "code": null, 17 | "source": null, 18 | "message": null 19 | }, 20 | { 21 | "range": { 22 | "start": { 23 | "line": 3, 24 | "character": 3 25 | }, 26 | "end": { 27 | "line": 4, 28 | "character": 4 29 | } 30 | }, 31 | "severity": null, 32 | "code": null, 33 | "source": null, 34 | "message": null 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/Range1.json: -------------------------------------------------------------------------------- 1 | { 2 | "start": { 3 | "line": 1, 4 | "character": 1 5 | }, 6 | "end": { 7 | "line": 2, 8 | "character": 2 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/Registration1.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "id", 3 | "method": "method", 4 | "registerOptions": "registerOptions" 5 | } 6 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/Registration2.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "id", 3 | "method": "method" 4 | } 5 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/RegistrationParams1.json: -------------------------------------------------------------------------------- 1 | { 2 | "registrations": [ 3 | { 4 | "id": "id", 5 | "method": "method", 6 | "registerOptions": "registerOptions" 7 | }, 8 | { 9 | "id": "id", 10 | "method": "method" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/RenameParams1.json: -------------------------------------------------------------------------------- 1 | { 2 | "textDocument": { 3 | "uri": "uri" 4 | }, 5 | "position": { 6 | "line": 1, 7 | "character": 1 8 | }, 9 | "newName": "newName" 10 | } 11 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/ServerCapabilities1.json: -------------------------------------------------------------------------------- 1 | { 2 | "textDocumentSync": { 3 | "openClose": true, 4 | "willSave": true, 5 | "willSaveWaitUntil": true 6 | }, 7 | "hoverProvider": true, 8 | "documentSymbolProvider": true, 9 | "completionProvider": { 10 | "resolveProvider": true, 11 | "triggerCharacters": [ 12 | "a", 13 | "b" 14 | ] 15 | }, 16 | "workspaceSymbolProvider": true 17 | } 18 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/ServerCapabilities2.json: -------------------------------------------------------------------------------- 1 | { 2 | "textDocumentSync":2, 3 | "hoverProvider": true, 4 | "completionProvider": { 5 | "resolveProvider": true, 6 | "triggerCharacters": [ 7 | "a", 8 | "b" 9 | ] 10 | }, 11 | "renameProvider": true 12 | } 13 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/ShowMessageRequestParams1.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [ 3 | { 4 | "title": "title" 5 | } 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/ShowMessageRequestParams2.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [ 3 | { 4 | "title": "title1" 5 | }, 6 | { 7 | "title": "title2" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/ShowMessageRequestParams3.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": 3, 3 | "message": "message", 4 | "actions": [ 5 | { 6 | "title": "title" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/SymbolInformation1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "name", 3 | "kind": 18, 4 | "deprecated": true, 5 | "location": { 6 | "uri": "uri", 7 | "range": { 8 | "start": { 9 | "line": 1, 10 | "character": 1 11 | }, 12 | "end": { 13 | "line": 2, 14 | "character": 2 15 | } 16 | } 17 | }, 18 | "containerName": "containerName" 19 | } 20 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/Synchronization1.json: -------------------------------------------------------------------------------- 1 | { 2 | "dynamicRegistration": true, 3 | "willSave": true, 4 | "willSaveWaitUntil": true, 5 | "didSave": true 6 | } -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/TextDocumentClientCapabilities1.json: -------------------------------------------------------------------------------- 1 | { 2 | "synchronization": { 3 | "dynamicRegistration": true, 4 | "willSave": true, 5 | "willSaveWaitUntil": true, 6 | "didSave": true 7 | }, 8 | "completion": { 9 | "dynamicRegistration": true, 10 | "contextSupport": true, 11 | "completionItem": { 12 | "snippetSupport": true, 13 | "commitCharactersSupport": true, 14 | "documentationFormat": [ 15 | "markdown", 16 | "plaintext" 17 | ], 18 | "deprecatedSupport": true, 19 | "preselectSupport": true 20 | }, 21 | "completionItemKind": { 22 | "valueSet": [ 23 | 1, 24 | 2, 25 | 3 26 | ] 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/TextDocumentEdit1.json: -------------------------------------------------------------------------------- 1 | { 2 | "textDocument": { 3 | "uri": "uri", 4 | "version": 1 5 | }, 6 | "edits": [ 7 | { 8 | "range": { 9 | "start": { 10 | "line": 0, 11 | "character": 0 12 | }, 13 | "end": { 14 | "line": 1, 15 | "character": 1 16 | } 17 | }, 18 | "newText": "newText" 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/TextDocumentPositionParams1.json: -------------------------------------------------------------------------------- 1 | { 2 | "textDocument": { 3 | "uri": "uri" 4 | }, 5 | "position": { 6 | "line": 1, 7 | "character": 1 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/TextDocumentSyncOptions1.json: -------------------------------------------------------------------------------- 1 | { 2 | "openClose": true, 3 | "change": 2, 4 | "willSave": true, 5 | "willSaveWaitUntil": true 6 | } -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/TextEdit1.json: -------------------------------------------------------------------------------- 1 | { 2 | "range": { 3 | "start": { 4 | "line": 0, 5 | "character": 0 6 | }, 7 | "end": { 8 | "line": 1, 9 | "character": 1 10 | } 11 | }, 12 | "newText": "newText" 13 | } -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/Unregistration1.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "id", 3 | "method": "method" 4 | } 5 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/WorkspaceEdit1.json: -------------------------------------------------------------------------------- 1 | { 2 | "changes": { 3 | "uri1": [ 4 | { 5 | "range": { 6 | "start": { 7 | "line": 0, 8 | "character": 0 9 | }, 10 | "end": { 11 | "line": 1, 12 | "character": 1 13 | } 14 | }, 15 | "newText": "newText" 16 | } 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/WorkspaceEdit2.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/WorkspaceEdit3.json: -------------------------------------------------------------------------------- 1 | { 2 | "documentChanges": [ 3 | { 4 | "textDocument": { 5 | "uri": "uri", 6 | "version": 1 7 | }, 8 | "edits": [ 9 | { 10 | "range": { 11 | "start": { 12 | "line": 0, 13 | "character": 0 14 | }, 15 | "end": { 16 | "line": 1, 17 | "character": 1 18 | } 19 | }, 20 | "newText": "newText" 21 | } 22 | ] 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/WorkspaceEdit4.json: -------------------------------------------------------------------------------- 1 | { 2 | "documentChanges": [ 3 | { 4 | "kind": "create", 5 | "uri": "uri1", 6 | "options": { 7 | "override": true, 8 | "ignoreIfExists": true 9 | } 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/WorkspaceEdit5.json: -------------------------------------------------------------------------------- 1 | { 2 | "documentChanges": [ 3 | { 4 | "kind": "rename", 5 | "oldUri": "uri1", 6 | "newUri": "uri2", 7 | "options": { 8 | "override": true, 9 | "ignoreIfExists": true 10 | } 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/WorkspaceEdit6.json: -------------------------------------------------------------------------------- 1 | { 2 | "documentChanges": [ 3 | { 4 | "kind": "delete", 5 | "uri": "uri1", 6 | "options": { 7 | "override": true, 8 | "ignoreIfExists": true 9 | } 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /spring-dsl-lsp-core/src/test/resources/org/springframework/dsl/lsp/server/domain/WorkspaceSymbolParams1.json: -------------------------------------------------------------------------------- 1 | { 2 | "query": "query" 3 | } 4 | -------------------------------------------------------------------------------- /spring-dsl-samples/dotdsl/src/main/java/demo/dotdsl/DOTLanguageVisitor.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 demo.dotdsl; 17 | 18 | import org.springframework.dsl.antlr.AntlrParseResult; 19 | 20 | /** 21 | * {@code ANTLR} visitor for {@code dot} language; 22 | *

23 | * currently visitor is just used to lint it, so no actual result is needed, 24 | * thus just dummy Object type 25 | * 26 | * @author Janne Valkealahti 27 | * 28 | */ 29 | //tag::snippet1[] 30 | public class DOTLanguageVisitor extends DOTBaseVisitor> { 31 | } 32 | //end::snippet1[] 33 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging: 2 | level: 3 | org.springframework.dsl: trace 4 | #tag::snippet1[] 5 | spring: 6 | dsl: 7 | lsp: 8 | server: 9 | mode: WEBSOCKET 10 | #end::snippet1[] 11 | #tag::snippet2[] 12 | demo: 13 | wordcheckdsl: 14 | words: 15 | - "all" 16 | - "work" 17 | - "and" 18 | - "no" 19 | - "play" 20 | - "makes" 21 | - "jack" 22 | - "a" 23 | - "dull" 24 | - "boy" 25 | #end::snippet1[] 26 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/README.md: -------------------------------------------------------------------------------- 1 | # Ui 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.8. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to ui!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/patch.js: -------------------------------------------------------------------------------- 1 | //https://github.com/angular/angular-cli/issues/1548 2 | const fs = require('fs'); 3 | const f = 'node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js'; 4 | 5 | fs.readFile(f, 'utf8', function (err,data) { 6 | if (err) { 7 | return console.log(err); 8 | } 9 | var result = data.replace(/node: false,/g, 'node: {crypto: true, stream: true, fs: \'empty\', net: \'empty\', clearImmediate: true, setImmediate: true}, resolve: {alias: {\'vscode\': require.resolve(\'monaco-languageclient/lib/vscode-compatibility\')}}'); 10 | 11 | fs.writeFile(f, result, 'utf8', function (err) { 12 | if (err) return console.log(err); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/showcaseeditor/ui/src/app/app.component.css -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

2 |

3 | Welcome to Spring Dsl Showcase Demo 4 |

5 |
6 | 7 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'app'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('app'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to ui!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/app/editor-tab-group/editor-tab-group.component.css: -------------------------------------------------------------------------------- 1 | .editor-open-tab-button { 2 | margin-left: 8px; 3 | margin-right: 8px; 4 | } 5 | .editor-tab-close-icon { 6 | margin-left: 8px; 7 | margin-right: 8px; 8 | font-size: 10px; 9 | height: 12px; 10 | width: 12px; 11 | } 12 | .editor-tab-content { 13 | height: 300px; 14 | } 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/showcaseeditor/ui/src/assets/.gitkeep -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-11 -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * In development mode, to ignore zone related error stack frames such as 11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 12 | * import the following file, but please comment it out in production mode 13 | * because it will have performance impact when throw error 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/showcaseeditor/ui/src/favicon.ico -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ui 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import "~@angular/material/prebuilt-themes/indigo-pink.css"; 3 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "types": [] 7 | }, 8 | "exclude": [ 9 | "src/test.ts", 10 | "**/*.spec.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-dsl-samples/showcaseeditor/ui/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es5", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsl/src/main/java/demo/simpledsl/SimpleLanguageDslService.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 demo.simpledsl; 17 | 18 | import org.springframework.dsl.service.AbstractDslService; 19 | 20 | /** 21 | * Base class for all {@code simple} language services. 22 | * 23 | * @author Janne Valkealahti 24 | * 25 | */ 26 | //tag::snippet1[] 27 | public abstract class SimpleLanguageDslService extends AbstractDslService { 28 | 29 | public SimpleLanguageDslService() { 30 | super(SimpleLanguage.LANGUAGEID); 31 | } 32 | } 33 | //end::snippet1[] 34 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging: 2 | level: 3 | org.springframework.dsl: trace 4 | org.eclipse.lsp4j: trace 5 | spring: 6 | dsl: 7 | lsp: 8 | server: 9 | mode: WEBSOCKET 10 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/README.md: -------------------------------------------------------------------------------- 1 | # Ui 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.8. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to ui!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/patch.js: -------------------------------------------------------------------------------- 1 | //https://github.com/angular/angular-cli/issues/1548 2 | const fs = require('fs'); 3 | const f = 'node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js'; 4 | 5 | fs.readFile(f, 'utf8', function (err,data) { 6 | if (err) { 7 | return console.log(err); 8 | } 9 | var result = data.replace(/node: false,/g, 'node: {crypto: true, stream: true, fs: \'empty\', net: \'empty\', clearImmediate: true, setImmediate: true}, resolve: {alias: {\'vscode\': require.resolve(\'monaco-languageclient/lib/vscode-compatibility\')}}'); 10 | 11 | fs.writeFile(f, result, 'utf8', function (err) { 12 | if (err) return console.log(err); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/simpledsleditor/ui/src/app/app.component.css -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | Welcome to {{ title }}! 4 |

5 |
6 | 7 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'app'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('app'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to ui!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app'; 10 | } 11 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { AppComponent } from './app.component'; 5 | import { SpringDslEditorModule, SpringDslEditorConfig, SpringMonacoEditorConfig } from 'spring-dsl-editor'; 6 | 7 | const springMonacoEditorConfig: SpringMonacoEditorConfig = { 8 | defaultOptions: { 9 | language: 'simple' 10 | }, 11 | onMonacoLoad: () => { 12 | (window).monaco.languages.register({ id: 'simple' }); 13 | } 14 | }; 15 | 16 | const springDslEditorConfig: SpringDslEditorConfig = { 17 | documentSelector: ['simple'] 18 | }; 19 | 20 | @NgModule({ 21 | declarations: [ 22 | AppComponent 23 | ], 24 | imports: [ 25 | BrowserModule, 26 | FormsModule, 27 | SpringDslEditorModule.forRoot(springMonacoEditorConfig, springDslEditorConfig) 28 | ], 29 | providers: [], 30 | bootstrap: [AppComponent] 31 | }) 32 | export class AppModule { } 33 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/simpledsleditor/ui/src/assets/.gitkeep -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-11 -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * In development mode, to ignore zone related error stack frames such as 11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 12 | * import the following file, but please comment it out in production mode 13 | * because it will have performance impact when throw error 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/simpledsleditor/ui/src/favicon.ico -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ui 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "types": [] 7 | }, 8 | "exclude": [ 9 | "src/test.ts", 10 | "**/*.spec.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledsleditor/ui/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es5", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledslprocessserver/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging: 2 | file: simpledslprocessserver.log 3 | level: 4 | org.springframework.dsl: trace 5 | spring: 6 | main: 7 | banner-mode: "off" 8 | dsl: 9 | lsp: 10 | server: 11 | mode: PROCESS 12 | force-jvm-exit-on-shutdown: false 13 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledslprocessserver/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledslprocessserver/src/test/resources/test.ssml: -------------------------------------------------------------------------------- 1 | 12345678ns 2 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledslsocketserver/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging: 2 | file: /tmp/simplesocketserver.log 3 | level: 4 | org.springframework.dsl: trace 5 | org.eclipse.lsp4j: trace 6 | spring: 7 | main: 8 | banner-mode: "off" 9 | dsl: 10 | lsp: 11 | server: 12 | mode: SOCKET 13 | -------------------------------------------------------------------------------- /spring-dsl-samples/simpledslsocketserver/src/test/resources/test.ssml: -------------------------------------------------------------------------------- 1 | 12345678ns 2 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | .idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/README.md: -------------------------------------------------------------------------------- 1 | # SpringDslEditorLibApp 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.8. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to spring-dsl-editor-app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/patch.js: -------------------------------------------------------------------------------- 1 | //https://github.com/angular/angular-cli/issues/1548 2 | const fs = require('fs'); 3 | const f = 'node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js'; 4 | 5 | fs.readFile(f, 'utf8', function (err,data) { 6 | if (err) { 7 | return console.log(err); 8 | } 9 | var result = data.replace(/node: false,/g, 'node: {crypto: true, stream: true, fs: \'empty\', net: \'empty\', clearImmediate: true, setImmediate: true}, resolve: {alias: {\'vscode\': require.resolve(\'monaco-languageclient/lib/vscode-compatibility\')}}'); 10 | 11 | fs.writeFile(f, result, 'utf8', function (err) { 12 | if (err) return console.log(err); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; 32 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", 3 | "dest": "../../dist/spring-dsl-editor", 4 | "deleteDestPath": false, 5 | "lib": { 6 | "entryFile": "src/public_api.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/ng-package.prod.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", 3 | "dest": "../../dist/spring-dsl-editor", 4 | "lib": { 5 | "entryFile": "src/public_api.ts" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "spring-dsl-editor", 3 | "version": "0.0.1", 4 | "peerDependencies": { 5 | "@angular/common": "^6.0.0-rc.0 || ^6.0.0", 6 | "@angular/core": "^6.0.0-rc.0 || ^6.0.0", 7 | "monaco-languageclient": "^0.7.2", 8 | "normalize-url": "^3.2.0", 9 | "vscode-ws-jsonrpc": "^0.0.2-1" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/src/empty.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/src/empty.ts -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/src/lib/spring-dsl-editor.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/src/lib/spring-dsl-editor.component.css -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/src/lib/spring-dsl-editor.component.html: -------------------------------------------------------------------------------- 1 |
2 | 6 | 7 |
8 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/src/lib/spring-monaco-editor/monaco-editor.service.spec.ts: -------------------------------------------------------------------------------- 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 | import { TestBed, inject } from '@angular/core/testing'; 17 | 18 | import { MonacoEditorService } from './monaco-editor.service'; 19 | 20 | describe('MonacoEditorService', () => { 21 | beforeEach(() => { 22 | TestBed.configureTestingModule({ 23 | providers: [ 24 | MonacoEditorService 25 | ] 26 | }); 27 | }); 28 | 29 | it('should be created', inject([MonacoEditorService], (service: MonacoEditorService) => { 30 | expect(service).toBeTruthy(); 31 | })); 32 | }); 33 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/src/lib/spring-monaco-editor/spring-monaco-editor.component.css: -------------------------------------------------------------------------------- 1 | :host { 2 | display: block; 3 | height: 600px; 4 | } 5 | 6 | .editor-container { 7 | width: 100%; 8 | height: 98%; 9 | } 10 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/src/lib/spring-monaco-editor/spring-monaco-editor.component.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/src/lib/spring-monaco-editor/types.ts: -------------------------------------------------------------------------------- 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 | 17 | export interface SpringMonacoEditorModel { 18 | value: string; 19 | language?: string; 20 | uri?: any; 21 | } 22 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/src/public_api.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of spring-dsl-editor 3 | */ 4 | 5 | export * from './lib/spring-dsl-editor.service'; 6 | export * from './lib/spring-dsl-document.service'; 7 | export * from './lib/spring-dsl-editor.component'; 8 | export * from './lib/spring-dsl-editor.module'; 9 | export * from './lib/spring-monaco-editor/spring-monaco-editor.component'; 10 | export * from './lib/spring-monaco-editor/config'; 11 | export * from './lib/config'; 12 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'core-js/es7/reflect'; 4 | import 'zone.js/dist/zone'; 5 | import 'zone.js/dist/zone-testing'; 6 | import { getTestBed } from '@angular/core/testing'; 7 | import { 8 | BrowserDynamicTestingModule, 9 | platformBrowserDynamicTesting 10 | } from '@angular/platform-browser-dynamic/testing'; 11 | 12 | declare const require: any; 13 | 14 | // First, initialize the Angular testing environment. 15 | getTestBed().initTestEnvironment( 16 | BrowserDynamicTestingModule, 17 | platformBrowserDynamicTesting() 18 | ); 19 | // Then we find all the tests. 20 | const context = require.context('./', true, /\.spec\.ts$/); 21 | // And load the modules. 22 | context.keys().map(context); 23 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/lib", 5 | "target": "es2015", 6 | "module": "es2015", 7 | "moduleResolution": "node", 8 | "declaration": true, 9 | "sourceMap": true, 10 | "inlineSources": true, 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "importHelpers": true, 14 | "types": [], 15 | "lib": [ 16 | "dom", 17 | "es2015" 18 | ] 19 | }, 20 | "angularCompilerOptions": { 21 | "annotateForClosureCompiler": true, 22 | "skipTemplateCodegen": true, 23 | "strictMetadataEmit": true, 24 | "fullTemplateTypeCheck": true, 25 | "strictInjectionParameters": true, 26 | "flatModuleId": "AUTOGENERATED", 27 | "flatModuleOutFile": "AUTOGENERATED" 28 | }, 29 | "exclude": [ 30 | "src/test.ts", 31 | "**/*.spec.ts" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ], 9 | "paths": { 10 | "vscode": [ "node_modules/monaco-languageclient/lib/vscode-compatibility.js" ], 11 | "net": [ 12 | "projects/spring-dsl-editor/src/empty.ts" 13 | ] 14 | } 15 | }, 16 | "files": [ 17 | "src/test.ts", 18 | "src/empty.ts" 19 | ], 20 | "include": [ 21 | "**/*.spec.ts", 22 | "**/*.d.ts" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/projects/spring-dsl-editor/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "spring", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "spring", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/ws": { 3 | "target": "http://localhost:8080", 4 | "secure": false, 5 | "ws":true 6 | }, 7 | "/document": { 8 | "target": "http://localhost:8080", 9 | "secure": false 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/spring-dsl-editor-lib/src/app/app.component.css -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | Welcome to Spring Dsl Test App 4 |

5 |
6 | 7 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/app/app.component.ts: -------------------------------------------------------------------------------- 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 | import { Component } from '@angular/core'; 17 | 18 | @Component({ 19 | selector: 'app-root', 20 | templateUrl: './app.component.html', 21 | styleUrls: ['./app.component.css'] 22 | }) 23 | export class AppComponent { 24 | title = 'app'; 25 | } 26 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/app/editor-tab-group/editor-tab-group.component.css: -------------------------------------------------------------------------------- 1 | .editor-open-tab-button { 2 | margin-left: 8px; 3 | margin-right: 8px; 4 | } 5 | .editor-tab-close-icon { 6 | margin-left: 8px; 7 | margin-right: 8px; 8 | font-size: 10px; 9 | height: 12px; 10 | width: 12px; 11 | } 12 | .editor-tab-content { 13 | height: 300px; 14 | } 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/spring-dsl-editor-lib/src/assets/.gitkeep -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-11 -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * In development mode, to ignore zone related error stack frames such as 11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 12 | * import the following file, but please comment it out in production mode 13 | * because it will have performance impact when throw error 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/spring-dsl-editor-lib/src/favicon.ico -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SpringDslEditorLibApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import "~@angular/material/prebuilt-themes/indigo-pink.css"; 3 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "types": [] 7 | }, 8 | "exclude": [ 9 | "src/test.ts", 10 | "**/*.spec.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-dsl-samples/spring-dsl-editor-lib/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es5", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ], 19 | "paths": { 20 | "spring-dsl-editor": [ 21 | "dist/spring-dsl-editor" 22 | ], 23 | "spring-dsl-editor/*": [ 24 | "dist/spring-dsl-editor/*" 25 | ] 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging: 2 | level: 3 | org.springframework.dsl: trace 4 | #tag::snippet1[] 5 | spring: 6 | dsl: 7 | lsp: 8 | server: 9 | mode: WEBSOCKET 10 | #end::snippet1[] 11 | #tag::snippet2[] 12 | demo: 13 | wordcheckdsl: 14 | words: 15 | - "all" 16 | - "work" 17 | - "and" 18 | - "no" 19 | - "play" 20 | - "makes" 21 | - "jack" 22 | - "a" 23 | - "dull" 24 | - "boy" 25 | #end::snippet1[] 26 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/README.md: -------------------------------------------------------------------------------- 1 | # Ui 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.8. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to ui!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/patch.js: -------------------------------------------------------------------------------- 1 | //https://github.com/angular/angular-cli/issues/1548 2 | const fs = require('fs'); 3 | const f = 'node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js'; 4 | 5 | fs.readFile(f, 'utf8', function (err,data) { 6 | if (err) { 7 | return console.log(err); 8 | } 9 | var result = data.replace(/node: false,/g, 'node: {crypto: true, stream: true, fs: \'empty\', net: \'empty\', clearImmediate: true, setImmediate: true}, resolve: {alias: {\'vscode\': require.resolve(\'monaco-languageclient/lib/vscode-compatibility\')}}'); 10 | 11 | fs.writeFile(f, result, 'utf8', function (err) { 12 | if (err) return console.log(err); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/wordcheckdsleditor/ui/src/app/app.component.css -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | Welcome to Spring Dsl Wordcheck Language Editor Sample! 4 |

5 |
6 |
7 | You are Jack in Shining writing endless lines of "all work and no play makes jack a dull boy". 8 | Bad words are checked while typing and completion assist can be forced by hitting ctrl+space. 9 |
10 | 11 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'app'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('app'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to ui!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { AppComponent } from './app.component'; 5 | import { SpringDslEditorModule, SpringDslEditorConfig, SpringMonacoEditorConfig } from 'spring-dsl-editor'; 6 | 7 | const springMonacoEditorConfig: SpringMonacoEditorConfig = { 8 | defaultOptions: { 9 | language: 'wordcheck' 10 | }, 11 | onMonacoLoad: () => { 12 | (window).monaco.languages.register({ id: 'wordcheck' }); 13 | } 14 | }; 15 | 16 | const springDslEditorConfig: SpringDslEditorConfig = { 17 | documentSelector: ['wordcheck'] 18 | }; 19 | 20 | 21 | @NgModule({ 22 | declarations: [ 23 | AppComponent 24 | ], 25 | imports: [ 26 | BrowserModule, 27 | FormsModule, 28 | SpringDslEditorModule.forRoot(springMonacoEditorConfig, springDslEditorConfig) 29 | ], 30 | providers: [], 31 | bootstrap: [AppComponent] 32 | }) 33 | export class AppModule { } 34 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/wordcheckdsleditor/ui/src/assets/.gitkeep -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-11 -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * In development mode, to ignore zone related error stack frames such as 11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 12 | * import the following file, but please comment it out in production mode 13 | * because it will have performance impact when throw error 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/wordcheckdsleditor/ui/src/favicon.ico -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ui 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "types": [] 7 | }, 8 | "exclude": [ 9 | "src/test.ts", 10 | "**/*.spec.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditor/ui/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es5", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging: 2 | level: 3 | org.springframework.dsl: trace 4 | #tag::snippet1[] 5 | spring: 6 | dsl: 7 | lsp: 8 | server: 9 | mode: WEBSOCKET 10 | #end::snippet1[] 11 | #tag::snippet2[] 12 | demo: 13 | wordcheckdsl: 14 | words: 15 | - "all" 16 | - "work" 17 | - "and" 18 | - "no" 19 | - "play" 20 | - "makes" 21 | - "jack" 22 | - "a" 23 | - "dull" 24 | - "boy" 25 | #end::snippet1[] 26 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/README.md: -------------------------------------------------------------------------------- 1 | # Ui 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.8. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to ui!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/patch.js: -------------------------------------------------------------------------------- 1 | //https://github.com/angular/angular-cli/issues/1548 2 | const fs = require('fs'); 3 | const f = 'node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js'; 4 | 5 | fs.readFile(f, 'utf8', function (err,data) { 6 | if (err) { 7 | return console.log(err); 8 | } 9 | var result = data.replace(/node: false,/g, 'node: {crypto: true, stream: true, fs: \'empty\', net: \'empty\', clearImmediate: true, setImmediate: true}, resolve: {alias: {\'vscode\': require.resolve(\'monaco-languageclient/lib/vscode-compatibility\')}}'); 10 | 11 | fs.writeFile(f, result, 'utf8', function (err) { 12 | if (err) return console.log(err); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/wordcheckdsleditorservlet/ui/src/app/app.component.css -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | Welcome to Spring Dsl Wordcheck Language Editor Sample! 4 |

5 |
6 |
7 | You are Jack in Shining writing endless lines of "all work and no play makes jack a dull boy". 8 | Bad words are checked while typing and completion assist can be forced by hitting ctrl+space. 9 |
10 | 11 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'app'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('app'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to ui!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { AppComponent } from './app.component'; 5 | import { SpringDslEditorModule, SpringDslEditorConfig, SpringMonacoEditorConfig } from 'spring-dsl-editor'; 6 | 7 | const springMonacoEditorConfig: SpringMonacoEditorConfig = { 8 | defaultOptions: { 9 | language: 'wordcheck' 10 | }, 11 | onMonacoLoad: () => { 12 | (window).monaco.languages.register({ id: 'wordcheck' }); 13 | } 14 | }; 15 | 16 | const springDslEditorConfig: SpringDslEditorConfig = { 17 | documentSelector: ['wordcheck'] 18 | }; 19 | 20 | 21 | @NgModule({ 22 | declarations: [ 23 | AppComponent 24 | ], 25 | imports: [ 26 | BrowserModule, 27 | FormsModule, 28 | SpringDslEditorModule.forRoot(springMonacoEditorConfig, springDslEditorConfig) 29 | ], 30 | providers: [], 31 | bootstrap: [AppComponent] 32 | }) 33 | export class AppModule { } 34 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/wordcheckdsleditorservlet/ui/src/assets/.gitkeep -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-11 -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * In development mode, to ignore zone related error stack frames such as 11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 12 | * import the following file, but please comment it out in production mode 13 | * because it will have performance impact when throw error 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-dsl/6b6eb6a29a5167de88ffac3ac0405f63448046cb/spring-dsl-samples/wordcheckdsleditorservlet/ui/src/favicon.ico -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ui 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "types": [] 7 | }, 8 | "exclude": [ 9 | "src/test.ts", 10 | "**/*.spec.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdsleditorservlet/ui/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es5", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdslprocessserver/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging: 2 | file: wordcheckdslprocessserver.log 3 | level: 4 | org.springframework.dsl: trace 5 | spring: 6 | main: 7 | banner-mode: "off" 8 | dsl: 9 | lsp: 10 | server: 11 | mode: PROCESS 12 | force-jvm-exit-on-shutdown: false 13 | demo: 14 | wordcheckdsl: 15 | words: 16 | - "all" 17 | - "work" 18 | - "and" 19 | - "no" 20 | - "play" 21 | - "makes" 22 | - "jack" 23 | - "a" 24 | - "dull" 25 | - "boy" 26 | 27 | --- 28 | # eclipse really doesn't work with DocumentSymbol so prefer SymbolInformation 29 | spring: 30 | profiles: eclipse 31 | dsl: 32 | lsp: 33 | server: 34 | text-document: 35 | document-symbol: 36 | prefer: SymbolInformation 37 | -------------------------------------------------------------------------------- /spring-dsl-samples/wordcheckdslprocessserver/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spring-dsl-starter-lspserver-reactive/spring-dsl-starter-lspserver-reactive.txt: -------------------------------------------------------------------------------- 1 | Starter for spring dsl lsp reactive server 2 | -------------------------------------------------------------------------------- /spring-dsl-starter-lspserver-servlet/spring-dsl-starter-lspserver-servlet.txt: -------------------------------------------------------------------------------- 1 | Starter for spring dsl lsp servlet server 2 | -------------------------------------------------------------------------------- /spring-dsl-starter-lspserver/spring-dsl-starter-lspserver.txt: -------------------------------------------------------------------------------- 1 | Starter for spring dsl lsp server 2 | -------------------------------------------------------------------------------- /spring-dsl-symboltable/src/main/java/org/springframework/dsl/symboltable/Modifier.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.symboltable; 17 | 18 | /** 19 | * 20 | * @author Janne Valkealahti 21 | * 22 | */ 23 | public interface Modifier { 24 | 25 | /** 26 | * Gets the name. 27 | * 28 | * @return the name 29 | */ 30 | public String getName(); 31 | } 32 | -------------------------------------------------------------------------------- /spring-dsl-symboltable/src/main/java/org/springframework/dsl/symboltable/TypedSymbol.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.symboltable; 17 | 18 | /** 19 | * This interface tags user-defined symbols that have static type information, 20 | * like variables and functions. 21 | * 22 | * @author Original ANTLR Authors 23 | * @author Janne Valkealahti 24 | * 25 | */ 26 | public interface TypedSymbol { 27 | 28 | /** 29 | * Gets the type. 30 | * 31 | * @return the type 32 | */ 33 | Type getType(); 34 | 35 | /** 36 | * Sets the type. 37 | * 38 | * @param type the new type 39 | */ 40 | void setType(Type type); 41 | } 42 | -------------------------------------------------------------------------------- /spring-dsl-symboltable/src/main/java/org/springframework/dsl/symboltable/model/BaseModifier.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.symboltable.model; 17 | 18 | import org.springframework.dsl.symboltable.Modifier; 19 | 20 | /** 21 | * 22 | * @author Janne Valkealahti 23 | * 24 | */ 25 | public abstract class BaseModifier implements Modifier { 26 | 27 | private String name; 28 | 29 | public BaseModifier(String name) { 30 | this.name = name; 31 | } 32 | 33 | @Override 34 | public String getName() { 35 | return name; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-dsl-symboltable/src/main/java/org/springframework/dsl/symboltable/model/GlobalScope.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.symboltable.model; 17 | 18 | import org.springframework.dsl.symboltable.Scope; 19 | 20 | /** 21 | * A {@link Scope} associated with globals. 22 | * 23 | * @author Original ANTLR Authors 24 | * @author Janne Valkealahti 25 | * 26 | */ 27 | public class GlobalScope extends BaseScope { 28 | 29 | public GlobalScope(Scope scope) { 30 | super(scope); 31 | } 32 | 33 | @Override 34 | public String getName() { 35 | return "global"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spring-dsl-symboltable/src/main/java/org/springframework/dsl/symboltable/model/InvalidType.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.symboltable.model; 17 | 18 | import org.springframework.dsl.symboltable.Type; 19 | 20 | /** 21 | * 22 | * 23 | * @author Original ANTLR Authors 24 | * @author Janne Valkealahti 25 | * 26 | */ 27 | public class InvalidType implements Type { 28 | 29 | @Override 30 | public String getName() { 31 | return "INVALID"; 32 | } 33 | 34 | @Override 35 | public int getTypeIndex() { 36 | return -1; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spring-dsl-symboltable/src/main/java/org/springframework/dsl/symboltable/model/LocalScope.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.symboltable.model; 17 | 18 | import org.springframework.dsl.symboltable.Scope; 19 | 20 | /** 21 | * A scope object typically associated with {...} code blocks 22 | * 23 | * @author Original ANTLR Authors 24 | * @author Janne Valkealahti 25 | * 26 | */ 27 | public class LocalScope extends BaseScope { 28 | 29 | public LocalScope(Scope enclosingScope) { 30 | super(enclosingScope); 31 | } 32 | 33 | @Override 34 | public String getName() { 35 | return "local"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spring-dsl-symboltable/src/main/java/org/springframework/dsl/symboltable/model/NamedModifier.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.symboltable.model; 17 | 18 | /** 19 | * 20 | * @author Janne Valkealahti 21 | * 22 | */ 23 | public class NamedModifier extends BaseModifier { 24 | 25 | public NamedModifier(String name) { 26 | super(name); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /spring-dsl-symboltable/src/main/java/org/springframework/dsl/symboltable/model/ParameterSymbol.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.symboltable.model; 17 | 18 | /** 19 | * A parameter is just kind of variable used as an argument to a function or 20 | * method. 21 | * 22 | * @author Original ANTLR Authors 23 | * @author Janne Valkealahti 24 | * 25 | */ 26 | public class ParameterSymbol extends VariableSymbol { 27 | 28 | public ParameterSymbol(String name) { 29 | super(name); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring-dsl-symboltable/src/main/java/org/springframework/dsl/symboltable/model/PredefinedScope.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.symboltable.model; 17 | 18 | /** 19 | * A scope to hold predefined symbols of your language. This could be a list of 20 | * type names like int or methods like print. 21 | * 22 | * @author Original ANTLR Authors 23 | * @author Janne Valkealahti 24 | * 25 | */ 26 | public class PredefinedScope extends BaseScope { 27 | 28 | @Override 29 | public String getName() { 30 | return "predefined"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-dsl-symboltable/src/main/java/org/springframework/dsl/symboltable/model/StructSymbol.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.symboltable.model; 17 | 18 | /** 19 | * 20 | * 21 | * @author Original ANTLR Authors 22 | * @author Janne Valkealahti 23 | * 24 | */ 25 | public class StructSymbol extends DataAggregateSymbol { 26 | 27 | public StructSymbol(String name) { 28 | super(name); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-dsl-symboltable/src/main/java/org/springframework/dsl/symboltable/model/VisibilityModifier.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.symboltable.model; 17 | 18 | /** 19 | * 20 | * @author Janne Valkealahti 21 | * 22 | */ 23 | public class VisibilityModifier extends NamedModifier { 24 | 25 | public VisibilityModifier(String name) { 26 | super(name); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /spring-dsl-symboltable/src/main/java/org/springframework/dsl/symboltable/support/DefaultSymbolTable.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.symboltable.support; 17 | 18 | public class DefaultSymbolTable extends AbstractSymbolTable { 19 | } 20 | --------------------------------------------------------------------------------