From e47e235f6268ea57988bced6df6a9164603c1cc3 Mon Sep 17 00:00:00 2001 From: Martin Lippert Date: Tue, 11 Jan 2022 12:22:28 +0100 Subject: [PATCH 1/5] setup new builds for upcoming Eclipse 2022-03 release stream --- .../category.xml | 184 +++++ .../entitlements.plist | 18 + .../macos-notarize.sh | 46 ++ .../org.springframework.boot.ide.product | 136 ++++ .../p2.inf | 16 + .../pom.xml | 655 ++++++++++++++++++ ...tool-suite-4-dmg-config-e4.23-aarch64.json | 10 + ...ing-tool-suite-4-dmg-config-e4.23-x86.json | 10 + eclipse-distribution/pom.xml | 171 ++++- eclipse-language-servers/pom.xml | 60 +- 10 files changed, 1292 insertions(+), 14 deletions(-) create mode 100644 eclipse-distribution/org.springframework.boot.ide.product.e423/category.xml create mode 100644 eclipse-distribution/org.springframework.boot.ide.product.e423/entitlements.plist create mode 100755 eclipse-distribution/org.springframework.boot.ide.product.e423/macos-notarize.sh create mode 100644 eclipse-distribution/org.springframework.boot.ide.product.e423/org.springframework.boot.ide.product create mode 100644 eclipse-distribution/org.springframework.boot.ide.product.e423/p2.inf create mode 100644 eclipse-distribution/org.springframework.boot.ide.product.e423/pom.xml create mode 100644 eclipse-distribution/org.springframework.boot.ide.product.e423/spring-tool-suite-4-dmg-config-e4.23-aarch64.json create mode 100644 eclipse-distribution/org.springframework.boot.ide.product.e423/spring-tool-suite-4-dmg-config-e4.23-x86.json diff --git a/eclipse-distribution/org.springframework.boot.ide.product.e423/category.xml b/eclipse-distribution/org.springframework.boot.ide.product.e423/category.xml new file mode 100644 index 000000000..d991c89e4 --- /dev/null +++ b/eclipse-distribution/org.springframework.boot.ide.product.e423/category.xml @@ -0,0 +1,184 @@ + + + + Spring Tool Suite 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse-distribution/org.springframework.boot.ide.product.e423/entitlements.plist b/eclipse-distribution/org.springframework.boot.ide.product.e423/entitlements.plist new file mode 100644 index 000000000..6a297d495 --- /dev/null +++ b/eclipse-distribution/org.springframework.boot.ide.product.e423/entitlements.plist @@ -0,0 +1,18 @@ + + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.disable-executable-page-protection + + com.apple.security.cs.allow-dyld-environment-variables + + com.apple.security.cs.disable-library-validation + + com.apple.security.cs.debugger + + + diff --git a/eclipse-distribution/org.springframework.boot.ide.product.e423/macos-notarize.sh b/eclipse-distribution/org.springframework.boot.ide.product.e423/macos-notarize.sh new file mode 100755 index 000000000..448edb094 --- /dev/null +++ b/eclipse-distribution/org.springframework.boot.ide.product.e423/macos-notarize.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +DMG=$1 +NOTARIZE_SERVICE_URL=$2 + +echo "Notarize DMG" +echo ${DMG} + +RESPONSE=\ +$(curl -s -X POST \ + -F file=@${DMG} \ + -F 'options={"primaryBundleId": "SpringTools4", "staple": true};type=application/json' \ + ${NOTARIZE_SERVICE_URL}/macos-notarization-service/notarize) + +echo "Notarization request submitted" +echo ${RESPONSE} + +UUID=$(echo ${RESPONSE} | jq -r '.uuid') + +STATUS=$(echo ${RESPONSE} | jq -r '.notarizationStatus.status') + +echo "Status after submitting" +echo ${STATUS} + +while [[ ${STATUS} == 'IN_PROGRESS' ]]; do + sleep 60 + RESPONSE=$(curl -s ${NOTARIZE_SERVICE_URL}/macos-notarization-service/${UUID}/status) + STATUS=$(echo ${RESPONSE} | jq -r '.notarizationStatus.status') + + echo "Waiting for status to change" + echo ${RESPONSE} + echo ${STATUS} +done + +echo "Status is not in progress anymore" +echo ${RESPONSE} +echo ${STATUS} + +if [[ ${STATUS} != 'COMPLETE' ]]; then + echo "Notarization failed: ${RESPONSE}" + exit 1 +fi + +mv "${DMG}" "${DMG}-unnotarized" + +curl -o ${DMG} -J ${NOTARIZE_SERVICE_URL}/macos-notarization-service/${UUID}/download diff --git a/eclipse-distribution/org.springframework.boot.ide.product.e423/org.springframework.boot.ide.product b/eclipse-distribution/org.springframework.boot.ide.product.e423/org.springframework.boot.ide.product new file mode 100644 index 000000000..466ff07b7 --- /dev/null +++ b/eclipse-distribution/org.springframework.boot.ide.product.e423/org.springframework.boot.ide.product @@ -0,0 +1,136 @@ + + + + + + + + + -product org.springframework.boot.ide.branding.sts4 +--launcher.defaultAction openFile + + -Dosgi.requiredJavaVersion=11 +-Dosgi.dataAreaRequiresExplicitInit=true +-Xms256m +-Xmx2048m +--illegal-access=permit +--add-modules=ALL-SYSTEM + + + + -XstartOnFirstThread +-Dorg.eclipse.swt.internal.carbon.smallFonts -Xdock:icon=../Resources/sts4.icns + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse-distribution/org.springframework.boot.ide.product.e423/p2.inf b/eclipse-distribution/org.springframework.boot.ide.product.e423/p2.inf new file mode 100644 index 000000000..07a0ab677 --- /dev/null +++ b/eclipse-distribution/org.springframework.boot.ide.product.e423/p2.inf @@ -0,0 +1,16 @@ +instructions.configure=\ + org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:0,location:https${#58}//download.eclipse.org/releases/latest,name:Latest Eclipse Release);\ + org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:1,location:https${#58}//download.eclipse.org/releases/latest,name:Latest Eclipse Release);\ + org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:0,location:https${#58}//download.springsource.com/release/TOOLS/sts4/update/latest,name:Spring Tool Suite 4);\ + org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:1,location:https${#58}//download.springsource.com/release/TOOLS/sts4/update/latest,name:Spring Tool Suite 4);\ + org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:0,location:https${#58}//download.springsource.com/release/TOOLS/sts4-language-server-integrations,name:Spring Tools 4 Language Servers for Eclipse);\ + org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:1,location:https${#58}//download.springsource.com/release/TOOLS/sts4-language-server-integrations,name:Spring Tools 4 Language Servers for Eclipse);\ + org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/dropins); + +instructions.unconfigure=\ + org.eclipse.equinox.p2.touchpoint.eclipse.removeRepository(type:0,location:https${#58}//download.eclipse.org/releases/latest);\ + org.eclipse.equinox.p2.touchpoint.eclipse.removeRepository(type:1,location:https${#58}//download.eclipse.org/releases/latest);\ + org.eclipse.equinox.p2.touchpoint.eclipse.removeRepository(type:0,location:https${#58}//download.springsource.com/release/TOOLS/sts4/update/latest);\ + org.eclipse.equinox.p2.touchpoint.eclipse.removeRepository(type:1,location:https${#58}//download.springsource.com/release/TOOLS/sts4/update/latest);\ + org.eclipse.equinox.p2.touchpoint.eclipse.removeRepository(type:0,location:https${#58}//download.springsource.com/release/TOOLS/sts4-language-server-integrations);\ + org.eclipse.equinox.p2.touchpoint.eclipse.removeRepository(type:1,location:https${#58}//download.springsource.com/release/TOOLS/sts4-language-server-integrations); diff --git a/eclipse-distribution/org.springframework.boot.ide.product.e423/pom.xml b/eclipse-distribution/org.springframework.boot.ide.product.e423/pom.xml new file mode 100644 index 000000000..dc82d354b --- /dev/null +++ b/eclipse-distribution/org.springframework.boot.ide.product.e423/pom.xml @@ -0,0 +1,655 @@ + + + 4.0.0 + + + org.springframework.boot.ide + org.springframework.boot.ide + 4.13.1-SNAPSHOT + ../pom.xml + + + org.springframework.boot.ide.product + + eclipse-repository + + + https://download.eclipse.org/justj/jres/17/updates/release/latest/ + + + + + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + default-install + none + + + + + + org.eclipse.tycho + tycho-p2-repository-plugin + ${tycho-version} + + false + + + + + org.eclipse.tycho + tycho-p2-publisher-plugin + ${tycho-version} + + true + + + + + org.eclipse.tycho + tycho-p2-director-plugin + ${tycho-version} + + + materialize-products + + materialize-products + + package + + + archive-products + + archive-products + + verify + + + + + + org.springframework.boot.ide.branding.sts4 + sts-${unqualifiedVersion}.${p2.qualifier} + + SpringToolSuite4.app + + spring-tool-suite-4-${unqualifiedVersion}.${p2.qualifier}-${dist.target} + + + + tar.gz + tar.gz + + + + + + org.eclipse.tycho.extras + tycho-eclipserun-plugin + ${tycho-version} + + + + 2021-06 + p2 + https://download.eclipse.org/releases/2021-06 + + + -Declipse.p2.mirrors=false -Dorg.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=100000 -Dorg.eclipse.ecf.provider.filetransfer.retrieve.retryAttempts=30 -Dorg.eclipse.ecf.provider.filetransfer.retrieve.closeTimeout=100000 + + + org.eclipse.pde.api.tools + eclipse-plugin + + + org.eclipse.pde.build + eclipse-plugin + + + org.eclipse.pde.core + eclipse-plugin + + + org.eclipse.equinox.launcher + eclipse-plugin + + + org.eclipse.osgi.compatibility.state + eclipse-plugin + + + javax.annotation + eclipse-plugin + + + org.eclipse.equinox.p2.transport.ecf + eclipse-plugin + + + org.eclipse.equinox.p2.repository + eclipse-plugin + + + org.eclipse.equinox.p2.touchpoint.natives + eclipse-plugin + + + org.eclipse.equinox.p2.touchpoint.eclipse + eclipse-plugin + + + org.eclipse.equinox.p2.artifact.repository + + eclipse-plugin + + + org.eclipse.equinox.p2.director.app + eclipse-plugin + + + org.eclipse.equinox.ds + eclipse-plugin + + + org.eclipse.core.net + eclipse-plugin + + + + + + macos-x86_64 + package + + eclipse-run + + + -consoleLog -application org.eclipse.equinox.p2.director -nosplash -destination ${project.build.directory}/products/org.springframework.boot.ide.branding.sts4/macosx/cocoa/x86_64/SpringToolSuite4.app -repository ${justj.repository} -installIUs org.eclipse.justj.openjdk.hotspot.jre.full.feature.group + + + + macos-aarch_64 + package + + eclipse-run + + + -consoleLog -application org.eclipse.equinox.p2.director -nosplash -destination ${project.build.directory}/products/org.springframework.boot.ide.branding.sts4/macosx/cocoa/aarch64/SpringToolSuite4.app -repository ${justj.repository} -installIUs org.eclipse.justj.openjdk.hotspot.jre.full.feature.group + + + + windows-x86_64 + package + + eclipse-run + + + -consoleLog -application org.eclipse.equinox.p2.director -nosplash -destination ${project.build.directory}/products/org.springframework.boot.ide.branding.sts4/win32/win32/x86_64/sts-${unqualifiedVersion}.${p2.qualifier} -repository ${justj.repository} -installIUs org.eclipse.justj.openjdk.hotspot.jre.full.feature.group + + + + linux_x86_64 + package + + eclipse-run + + + -consoleLog -application org.eclipse.equinox.p2.director -nosplash -destination ${project.build.directory}/products/org.springframework.boot.ide.branding.sts4/linux/gtk/x86_64/sts-${unqualifiedVersion}.${p2.qualifier} -repository ${justj.repository} -installIUs org.eclipse.justj.openjdk.hotspot.jre.full.feature.group + + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + generate-license-files + package + + exec + + + java + + -jar + ${project.build.directory}/../../common/eclipse-distribution-license-file-generator.jar + ${project.build.directory}/products/org.springframework.boot.ide.branding.sts4/macosx/cocoa/x86_64/SpringToolSuite4.app/Contents/Eclipse/plugins/ + ${project.build.directory}/products/org.springframework.boot.ide.branding.sts4/macosx/cocoa/x86_64/SpringToolSuite4.app/Contents/Eclipse/open-source-licenses.txt + ${project.build.directory}/products/org.springframework.boot.ide.branding.sts4/macosx/cocoa/aarch64/SpringToolSuite4.app/Contents/Eclipse/plugins/ + ${project.build.directory}/products/org.springframework.boot.ide.branding.sts4/macosx/cocoa/aarch64/SpringToolSuite4.app/Contents/Eclipse/open-source-licenses.txt + ${project.build.directory}/products/org.springframework.boot.ide.branding.sts4/linux/gtk/x86_64/sts-${unqualifiedVersion}.${p2.qualifier}/plugins/ + ${project.build.directory}/products/org.springframework.boot.ide.branding.sts4/linux/gtk/x86_64/sts-${unqualifiedVersion}.${p2.qualifier}/open-source-licenses.txt + ${project.build.directory}/products/org.springframework.boot.ide.branding.sts4/win32/win32/x86_64/sts-${unqualifiedVersion}.${p2.qualifier}/plugins/ + ${project.build.directory}/products/org.springframework.boot.ide.branding.sts4/win32/win32/x86_64/sts-${unqualifiedVersion}.${p2.qualifier}/open-source-licenses.txt + + + + + + generate-self-extracting-jar + verify + + exec + + + java + + -jar + ${project.build.directory}/../../common/self-extracting-jar-creator.jar + ${project.build.directory}/products/spring-tool-suite-4-${unqualifiedVersion}.${p2.qualifier}-${dist.target}-win32.win32.x86_64.zip + + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.7 + + + + + win-exe-signing + package + + ${skip.win.signing} + + + + + + + + + + + + + + + + + + + + + + + + + + run + + + + + + osx-app-signing + package + + ${skip.osx.signing} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + run + + + + + + osx-dmg-creation + verify + + + + + + + + + + + + + + + + + + + + + run + + + + + osx-dmg-signing + verify + + ${skip.osx.signing} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + run + + + + + + osx-dmg-notarizing + verify + + ${skip.osx.notarizing} + + + + + + + + + + + + + + + + + + + + + + run + + + + + upload-product-bundles + deploy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + run + + + + + update-nightly-downloads + deploy + + ${skip.update-nightly-download-page} + + + + + + + + + + + + + + + + + + run + + + + + zip-sts-repository + install + + + + + + + + + + + + + + + + + + + + + + + run + + + + + upload-sts-repository + deploy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + run + + + + + + + org.springframework.build + org.springframework.build.aws.ant + 3.0.6.RELEASE + + + net.java.dev.jets3t + jets3t + 0.8.1 + + + ant-contrib + ant-contrib + 20020829 + + + + + + + + diff --git a/eclipse-distribution/org.springframework.boot.ide.product.e423/spring-tool-suite-4-dmg-config-e4.23-aarch64.json b/eclipse-distribution/org.springframework.boot.ide.product.e423/spring-tool-suite-4-dmg-config-e4.23-aarch64.json new file mode 100644 index 000000000..ba3c1e32b --- /dev/null +++ b/eclipse-distribution/org.springframework.boot.ide.product.e423/spring-tool-suite-4-dmg-config-e4.23-aarch64.json @@ -0,0 +1,10 @@ +{ + "title": "Spring Tool Suite 4", + "icon": "../org.springframework.boot.ide.branding/sts4.icns", + "contents": [ + { "x": 192, "y": 100, "type": "file", "path": "target/products/org.springframework.boot.ide.branding.sts4/macosx/cocoa/aarch64/SpringToolSuite4.app" }, + { "x": 448, "y": 100, "type": "link", "path": "/Applications" }, + { "x": 1000, "y": 2000, "type": "file", "path": "../org.springframework.boot.ide.branding/sts4.icns", "name": ".VolumeIcon.icns" } + ], + "format": "UDZO" +} diff --git a/eclipse-distribution/org.springframework.boot.ide.product.e423/spring-tool-suite-4-dmg-config-e4.23-x86.json b/eclipse-distribution/org.springframework.boot.ide.product.e423/spring-tool-suite-4-dmg-config-e4.23-x86.json new file mode 100644 index 000000000..c86b0023f --- /dev/null +++ b/eclipse-distribution/org.springframework.boot.ide.product.e423/spring-tool-suite-4-dmg-config-e4.23-x86.json @@ -0,0 +1,10 @@ +{ + "title": "Spring Tool Suite 4", + "icon": "../org.springframework.boot.ide.branding/sts4.icns", + "contents": [ + { "x": 192, "y": 100, "type": "file", "path": "target/products/org.springframework.boot.ide.branding.sts4/macosx/cocoa/x86_64/SpringToolSuite4.app" }, + { "x": 448, "y": 100, "type": "link", "path": "/Applications" }, + { "x": 1000, "y": 2000, "type": "file", "path": "../org.springframework.boot.ide.branding/sts4.icns", "name": ".VolumeIcon.icns" } + ], + "format": "UDZO" +} diff --git a/eclipse-distribution/pom.xml b/eclipse-distribution/pom.xml index 4d763297d..6ea323175 100644 --- a/eclipse-distribution/pom.xml +++ b/eclipse-distribution/pom.xml @@ -828,20 +828,15 @@ e422 - - - 2021-12-staging - p2 - https://download.eclipse.org/staging/2021-12/ orbit p2 - https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository + https://download.eclipse.org/tools/orbit/downloads/drops/R20211213173813/repository m2e @@ -978,6 +973,168 @@ + + e423 + + e4.23.0 + e4.23 + 2022-03 + 2022-03 (4.23) + 2022-03 + 4.23 + e423 + + + + + 2022-03-staging + p2 + https://download.eclipse.org/staging/2022-03/ + + + orbit + p2 + https://download.eclipse.org/tools/orbit/downloads/drops/I20220106214959/repository + + + m2e + p2 + https://download.eclipse.org/technology/m2e/releases/latest/ + + + latest-m2e-wtp + p2 + https://download.eclipse.org/m2e-wtp/snapshots/1.4/m2e-wtp/ + + + + maven-extras-mirror + p2 + https://download.springsource.com/release/TOOLS/third-party/m2e-sts310-signed/ + + + maven-egit + p2 + https://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-egit/0.15.1/N/LATEST + + + + maven-wro4j + p2 + https://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-wro4j/1.1.0-2014-06-25_06-16-31-H26/ + + + m2e-chromatic + p2 + https://sidespin.github.io/m2e-chromatic/update/ + + + maven-devtools + p2 + https://dist.springsource.com/release/TOOLS/mavendevtools/ + + + maven-dependency-support + p2 + https://ianbrandt.github.io/m2e-maven-dependency-plugin/ + + + ansi-console + p2 + https://www.mihai-nita.net/eclipse + + + + mylyn-markdown + p2 + https://download.eclipse.org/mylyn/docs/releases/3.0/ + + + wildwebdeveloper + p2 + https://download.eclipse.org/wildwebdeveloper/releases/latest + + + lsp4e + p2 + https://download.eclipse.org/lsp4e/snapshots/ + + + + + + + + org.springframework.boot.ide.product.e423 + + + + + + + org.eclipse.tycho + target-platform-configuration + ${tycho-version} + + + + macosx + cocoa + x86_64 + + + macosx + cocoa + aarch64 + + + win32 + win32 + x86_64 + + + linux + gtk + x86_64 + + + + + + + + + + build.springsource.com diff --git a/eclipse-language-servers/pom.xml b/eclipse-language-servers/pom.xml index ab28b4651..7005a4367 100644 --- a/eclipse-language-servers/pom.xml +++ b/eclipse-language-servers/pom.xml @@ -378,20 +378,66 @@ e422 - - - 2021-12-staging - p2 - https://download.eclipse.org/staging/2021-12/ orbit p2 - https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository + https://download.eclipse.org/tools/orbit/downloads/drops/R20211213173813/repository + + + mylyn-markdown + p2 + https://download.eclipse.org/mylyn/docs/releases/3.0/ + + + lsp4e + p2 + https://download.eclipse.org/lsp4e/snapshots/ + + + tm4e + p2 + https://download.eclipse.org/tm4e/snapshots/ + + + wwd + p2 + + https://download.eclipse.org/wildwebdeveloper/snapshots + + + + + + e423 + + e4.23.0 + e4.23 + 2022-03 + 2022-03 (4.23) + 2022-03 + 4.23 + e423 + + + + + 2022-03-staging + p2 + https://download.eclipse.org/staging/2022-03/ + + + orbit + p2 + https://download.eclipse.org/tools/orbit/downloads/drops/I20220106214959/repository mylyn-markdown From b0960b012a8925c81bd30bf4edbb19687b98f5dc Mon Sep 17 00:00:00 2001 From: BoykoAlex Date: Tue, 11 Jan 2022 17:29:43 -0500 Subject: [PATCH 2/5] Platform specific newline for multiline yaml completion --- .../commons/util/text/TextDocument.java | 2 +- .../yaml/completion/AppendTextBuilder.java | 25 +++++------ .../yaml/completion/YTypeAssistContext.java | 9 ++-- .../yaml/completion/YamlCompletionEngine.java | 14 +++---- .../commons/yaml/util/YamlIndentUtil.java | 2 +- .../languageserver/testharness/Editor.java | 7 +--- .../boot/test/ApplicationYamlEditorTest.java | 42 ++++++++++++++----- 7 files changed, 60 insertions(+), 41 deletions(-) diff --git a/headless-services/commons/commons-util/src/main/java/org/springframework/ide/vscode/commons/util/text/TextDocument.java b/headless-services/commons/commons-util/src/main/java/org/springframework/ide/vscode/commons/util/text/TextDocument.java index f2eaac2df..184411ef0 100644 --- a/headless-services/commons/commons-util/src/main/java/org/springframework/ide/vscode/commons/util/text/TextDocument.java +++ b/headless-services/commons/commons-util/src/main/java/org/springframework/ide/vscode/commons/util/text/TextDocument.java @@ -28,7 +28,7 @@ import javolution.text.Text; public class TextDocument implements IDocument { ILineTracker lineTracker = new DefaultLineTracker(); - private static final Pattern NEWLINE = Pattern.compile("\\r|\\n|\\r\\n|\\n\\r"); + private static final Pattern NEWLINE = Pattern.compile("\\n|\\r\\n"); private final LanguageId languageId; private final String uri; diff --git a/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/completion/AppendTextBuilder.java b/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/completion/AppendTextBuilder.java index 7a1ffa3da..3f23301ab 100644 --- a/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/completion/AppendTextBuilder.java +++ b/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/completion/AppendTextBuilder.java @@ -14,6 +14,7 @@ import org.springframework.ide.vscode.commons.util.Streams; import org.springframework.ide.vscode.commons.yaml.schema.YType; import org.springframework.ide.vscode.commons.yaml.schema.YTypeUtil; import org.springframework.ide.vscode.commons.yaml.schema.YTypedProperty; +import org.springframework.ide.vscode.commons.yaml.structure.YamlDocument; import org.springframework.ide.vscode.commons.yaml.util.YamlIndentUtil; /** @@ -29,7 +30,7 @@ public class AppendTextBuilder { this.typeUtil = typeUtil; } - public String buildFor(YType type) { + public String buildFor(YType type, YamlDocument doc) { //Note that caller is responsible for proper indentation //to align with the parent. The strings created here only need to contain //indentation spaces to indent *more* than the parent node. @@ -39,22 +40,22 @@ public class AppendTextBuilder { //(or potentially do a lot of string copying) StringBuilder text = new StringBuilder(); - build(type, 0, text); + build(type, 0, text, doc); return text.toString(); } - private void build(YType type, int indent, StringBuilder text) { + private void build(YType type, int indent, StringBuilder text, YamlDocument doc) { if (type==null) { //Assume its some kind of pojo bean - newline(text, indent+YamlIndentUtil.INDENT_BY); + newline(text, indent+YamlIndentUtil.INDENT_BY, doc); } else if (typeUtil.isMap(type)) { //ready to enter nested map key on next line - newline(text, indent+YamlIndentUtil.INDENT_BY); + newline(text, indent+YamlIndentUtil.INDENT_BY, doc); } else if (typeUtil.isSequencable(type)) { //ready to enter sequence element on next line - newline(text, indent); + newline(text, indent, doc); text.append("- "); - singleMostImportantProperty(typeUtil.getDomainType(type), indent+2, text); + singleMostImportantProperty(typeUtil.getDomainType(type), indent+2, text, doc); //Yes using 2 here instead of YamlIndentUtil.INDENT_BY is deliberate. It's the same value (now), // but the 2 used here is the width of the "- " which should determine nested indent level for things to // line up properly. @@ -62,11 +63,11 @@ public class AppendTextBuilder { //ready to enter whatever on the same line text.append(" "); } else { - newline(text, indent+YamlIndentUtil.INDENT_BY); + newline(text, indent+YamlIndentUtil.INDENT_BY, doc); } } - private void singleMostImportantProperty(YType type, int indent, StringBuilder text) { + private void singleMostImportantProperty(YType type, int indent, StringBuilder text, YamlDocument doc) { if (type!=null) { YTypedProperty singleProp = Streams.getSingle(typeUtil.getProperties(type).stream() .filter(p -> p.isPrimary())); @@ -77,13 +78,13 @@ public class AppendTextBuilder { if (singleProp!=null) { text.append(singleProp.getName()); text.append(':'); - build(singleProp.getType(), indent+YamlIndentUtil.INDENT_BY, text); + build(singleProp.getType(), indent+YamlIndentUtil.INDENT_BY, text, doc); } } } - private void newline(StringBuilder text, int indent) { - text.append("\n"); + private void newline(StringBuilder text, int indent, YamlDocument doc) { + text.append(doc == null || doc.getDocument() == null ? System.lineSeparator() : doc.getDocument().getDefaultLineDelimiter()); for (int i = 0; i < indent; i++) { text.append(' '); } diff --git a/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/completion/YTypeAssistContext.java b/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/completion/YTypeAssistContext.java index f029e6dd1..d0148d317 100644 --- a/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/completion/YTypeAssistContext.java +++ b/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/completion/YTypeAssistContext.java @@ -201,7 +201,7 @@ public class YTypeAssistContext extends AbstractYamlAssistContext { } snippet.append(p.getName()); snippet.append(":"); - snippet.append(appendTextFor(YType)); + snippet.append(appendTextFor(YType, doc)); edits.insert(queryOffset, indenter.applyIndentation(snippet.toString(), referenceIndent)); } ICompletionProposal completion = completionFactory().beanProperty(doc.getDocument(), @@ -262,9 +262,10 @@ public class YTypeAssistContext extends AbstractYamlAssistContext { /** * Computes the text that should be appended at the end of a completion * proposal depending on what type of value is expected. + * @param doc */ - protected String appendTextFor(YType type) { - return new AppendTextBuilder(typeUtil).buildFor(type); + protected String appendTextFor(YType type, YamlDocument doc) { + return new AppendTextBuilder(typeUtil).buildFor(type, doc); } private List getValueCompletions(YamlDocument doc, SNode node, int offset, String query) { @@ -461,7 +462,7 @@ public class YTypeAssistContext extends AbstractYamlAssistContext { @Override protected DocumentEdits transformEdit(DocumentEdits textEdit) { textEdit.transformFirstNonWhitespaceEdit((Integer offset, String insertText) -> { - YamlIndentUtil indenter = new YamlIndentUtil("\n"); + YamlIndentUtil indenter = new YamlIndentUtil(doc); if (needNewline(textEdit)) { return insertText.substring(0, offset) + "\n" +Strings.repeat(" ", node.getIndent())+"- " diff --git a/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/completion/YamlCompletionEngine.java b/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/completion/YamlCompletionEngine.java index 9e500241b..94f7673cd 100644 --- a/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/completion/YamlCompletionEngine.java +++ b/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/completion/YamlCompletionEngine.java @@ -114,7 +114,7 @@ public class YamlCompletionEngine implements ICompletionEngine { protected Collection getRelaxedCompletions(int offset, YamlDocument doc, SNode current, SNode contextNode, int baseIndent, double deempasizeBy) { try { return fixIndentations(getBaseCompletions(offset, doc, current, contextNode), - current, contextNode, baseIndent, deempasizeBy); + current, contextNode, baseIndent, deempasizeBy, doc); } catch (Exception e) { Log.log(e); } @@ -122,14 +122,14 @@ public class YamlCompletionEngine implements ICompletionEngine { } protected Collection fixIndentations(Collection completions, SNode currentNode, - SNode contextNode, int baseIndent, double deempasizeBy) { + SNode contextNode, int baseIndent, double deempasizeBy, YamlDocument doc) { if (!completions.isEmpty()) { int dashyIndent = getTargetIndent(contextNode, currentNode, true); int plainIndent = getTargetIndent(contextNode, currentNode, false); List transformed = new ArrayList<>(); for (ICompletionProposal p : completions) { int targetIndent = p.getLabel().startsWith("- ") ? dashyIndent : plainIndent; - ScoreableProposal p_fixed = indentFix((ScoreableProposal)p, targetIndent - baseIndent, currentNode, contextNode); + ScoreableProposal p_fixed = indentFix((ScoreableProposal)p, targetIndent - baseIndent, currentNode, contextNode, doc); if (p_fixed!=null) { p_fixed.deemphasize(deempasizeBy); transformed.add(p_fixed); @@ -140,12 +140,12 @@ public class YamlCompletionEngine implements ICompletionEngine { return Collections.emptyList(); } - protected ScoreableProposal indentFix(ScoreableProposal p, int fixIndentBy, SNode currentNode, SNode contextNode) { + protected ScoreableProposal indentFix(ScoreableProposal p, int fixIndentBy, SNode currentNode, SNode contextNode, YamlDocument doc) { if (fixIndentBy==0) { return p; } else if (fixIndentBy>0) { if (isExtraIndentRelaxable(contextNode, fixIndentBy)) { - return indented(p, Strings.repeat(" ", fixIndentBy)); + return indented(p, Strings.repeat(" ", fixIndentBy), doc); } } else { // fixIndentBy < 0 if (isLesserIndentRelaxable(currentNode, contextNode)) { @@ -228,7 +228,7 @@ public class YamlCompletionEngine implements ICompletionEngine { return null; } - public ScoreableProposal indented(ICompletionProposal proposal, String indentStr) { + public ScoreableProposal indented(ICompletionProposal proposal, String indentStr, YamlDocument doc) { int numArrows = (indentStr.length()+1)/2; ScoreableProposal transformed = new TransformedCompletion(proposal) { @Override public String tranformLabel(String originalLabel) { @@ -236,7 +236,7 @@ public class YamlCompletionEngine implements ICompletionEngine { } @Override public DocumentEdits transformEdit(DocumentEdits originalEdit) { // originalEdit.indentFirstEdit(indentStr); - YamlIndentUtil indenter = new YamlIndentUtil("\n"); + YamlIndentUtil indenter = new YamlIndentUtil(doc); if (originalEdit.hasRelativeIndents()) { originalEdit.transformFirstNonWhitespaceEdit((Integer offset, String insertText) -> { String prefix = insertText.substring(0, offset); diff --git a/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/util/YamlIndentUtil.java b/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/util/YamlIndentUtil.java index 573dd4c0f..c7d00da50 100644 --- a/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/util/YamlIndentUtil.java +++ b/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/util/YamlIndentUtil.java @@ -40,7 +40,7 @@ public class YamlIndentUtil { */ public final String NEWLINE; - public YamlIndentUtil(String newline) { + private YamlIndentUtil(String newline) { this.NEWLINE = newline; Assert.isNotNull(NEWLINE); } diff --git a/headless-services/commons/language-server-test-harness/src/main/java/org/springframework/ide/vscode/languageserver/testharness/Editor.java b/headless-services/commons/language-server-test-harness/src/main/java/org/springframework/ide/vscode/languageserver/testharness/Editor.java index ca53dcc61..6137080bc 100644 --- a/headless-services/commons/language-server-test-harness/src/main/java/org/springframework/ide/vscode/languageserver/testharness/Editor.java +++ b/headless-services/commons/language-server-test-harness/src/main/java/org/springframework/ide/vscode/languageserver/testharness/Editor.java @@ -241,7 +241,7 @@ public class Editor { if (selectionStart\n"); + editor.assertContextualCompletions(ci -> ci.getLabel().contains("spring.activemq.close-timeout"), + "springactcloti<*>", "spring:\n" + " activemq:\n" + " close-timeout: <*>" @@ -1435,7 +1436,9 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest { @Test public void testContentAssistSimple() throws Exception { defaultTestData(); - assertCompletion("port<*>", + Editor editor = newEditor("<*>\n"); + editor.assertContextualCompletions(ci -> ci.getLabel().contains("server.port"), + "port<*>", "server:\n"+ " port: <*>"); assertCompletion( @@ -1462,6 +1465,21 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest { // => nothing ); } + + /** + * https://github.com/spring-projects/sts4/issues/709 + */ + @Test public void testGH709() throws Exception { + data("server.port", "java.lang.Integer", null, "Server http port"); + + Editor editor = newEditor("logging:\r\n" + + " enabled: true\r\n" + + "ser<*>"); + editor.assertCompletions("logging:\r\n" + + " enabled: true\r\n" + + "server:\r\n" + + " port: <*>"); + } @Test public void testContentAssistNested() throws Exception { data("server.port", "java.lang.Integer", null, "Server http port"); @@ -1893,7 +1911,8 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest { defaultTestData(); //Ensure this test is not trivially passing because of missing test data - assertCompletion( + Editor editor = newEditor("<*>\n"); + editor.assertContextualCompletions(ci -> ci.getLabel().contains("server.port"), "po<*>" , "server:\n"+ @@ -2249,7 +2268,9 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest { useProject(createPredefinedMavenProject("enums-boot-1.3.2-app")); data("foo.color", "demo.Color", null, "A foonky colour"); - assertCompletion("foo.c<*>", + Editor editor = newEditor("<*>\n"); + editor.assertContextualCompletions(ci -> ci.getLabel().equals("foo.color"), + "foo.c<*>", "foo:\n" + " color: <*>" //Should complete on same line because enums are 'simple' values. ); @@ -2393,11 +2414,12 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest { ); //Map Enum -> Pojo: - assertCompletions("foo.coldat<*>", + Editor editor = newEditor("<*>\n"); + editor.assertContextualCompletions("foo.coldat<*>", "foo:\n" + " color-data:\n" + " <*>"); - assertCompletions( + editor.assertContextualCompletions( "foo:\n" + " color-data:\n" + " <*>", @@ -2415,7 +2437,7 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest { " red:\n" + " <*>" ); - assertCompletions( + editor.assertContextualCompletions( "foo:\n" + " color-data:\n" + " B<*>", @@ -2426,7 +2448,7 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest { " <*>" ); - assertCompletions( + editor.assertContextualCompletions( "foo:\n" + " color-data:\n" + " b<*>", @@ -2437,7 +2459,7 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest { " <*>" ); - assertCompletions( + editor.assertContextualCompletions( "foo:\n" + " color-data: b<*>", //=> From 9a0600f016ea18ae2bf01957c883a59454fd0b46 Mon Sep 17 00:00:00 2001 From: BoykoAlex Date: Tue, 11 Jan 2022 17:50:22 -0500 Subject: [PATCH 3/5] Try enabling tests for spring-boot ls --- headless-services/spring-boot-language-server/build.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/headless-services/spring-boot-language-server/build.sh b/headless-services/spring-boot-language-server/build.sh index d74135dfb..c19c435a1 100755 --- a/headless-services/spring-boot-language-server/build.sh +++ b/headless-services/spring-boot-language-server/build.sh @@ -6,7 +6,6 @@ cd ../jdt-ls-extension if command -v xvfb-run ; then echo "Using xvfb to run in headless environment..." xvfb-run ../mvnw \ - -DskipTests \ -DtrimStackTrace=false \ -f ../pom.xml \ -pl $modules \ @@ -14,7 +13,6 @@ if command -v xvfb-run ; then clean install else ../mvnw \ - -DskipTests \ -DtrimStackTrace=false \ -f ../pom.xml \ -pl $modules \ @@ -24,7 +22,6 @@ fi cd ../xml-ls-extension ../mvnw \ -DtrimStackTrace=false \ - -DskipTests \ -f ../pom.xml \ -pl xml-ls-extension \ -am \ From ec388d7b1b6ad7f188330f0e1f17e10119578984 Mon Sep 17 00:00:00 2001 From: BoykoAlex Date: Tue, 11 Jan 2022 18:08:21 -0500 Subject: [PATCH 4/5] Ignore some commons-maven tests --- .../ide/vscode/commons/maven/DependencyTreeTest.java | 2 ++ .../springframework/ide/vscode/commons/maven/JavaIndexTest.java | 2 ++ .../ide/vscode/commons/maven/MavenProjectCacheTest.java | 2 ++ 3 files changed, 6 insertions(+) diff --git a/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/DependencyTreeTest.java b/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/DependencyTreeTest.java index 4cafc0172..f6e01ba29 100644 --- a/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/DependencyTreeTest.java +++ b/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/DependencyTreeTest.java @@ -28,6 +28,7 @@ import java.util.stream.Collectors; import org.apache.maven.artifact.Artifact; import org.apache.maven.project.MavenProject; +import org.junit.Ignore; import org.junit.Test; /** @@ -41,6 +42,7 @@ import org.junit.Test; * 1. Takes 40 mins to execute for the concourse build * 2. The project is only used by tests and highly unlikely to be changed */ +@Ignore public class DependencyTreeTest { private void testMavenClasspath(String projectName) throws Exception { diff --git a/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/JavaIndexTest.java b/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/JavaIndexTest.java index 5ec4ebc5f..2af56a0b3 100644 --- a/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/JavaIndexTest.java +++ b/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/JavaIndexTest.java @@ -27,6 +27,7 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; +import org.junit.Ignore; import org.junit.Test; import org.springframework.ide.vscode.commons.java.IJavaModuleData; import org.springframework.ide.vscode.commons.java.IMethod; @@ -43,6 +44,7 @@ import com.google.common.cache.LoadingCache; import reactor.util.function.Tuple2; +@Ignore public class JavaIndexTest { private static BasicFileObserver fileObserver = new BasicFileObserver(); diff --git a/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/MavenProjectCacheTest.java b/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/MavenProjectCacheTest.java index 7268e6069..9f9d4a031 100644 --- a/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/MavenProjectCacheTest.java +++ b/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/MavenProjectCacheTest.java @@ -39,6 +39,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -64,6 +65,7 @@ import com.google.common.collect.ImmutableList; * @author Alex Boyko * */ +@Ignore public class MavenProjectCacheTest { private static final int TIMEOUT_SECONDS = 60; From 62041c8600c095ce3b02d512408bd2460b030685 Mon Sep 17 00:00:00 2001 From: Kris De Volder Date: Tue, 11 Jan 2022 15:28:21 -0800 Subject: [PATCH 5/5] Disable theia-image-build in ci --- concourse/pipeline.yml | 94 +++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/concourse/pipeline.yml b/concourse/pipeline.yml index af6045c08..da5fc4490 100644 --- a/concourse/pipeline.yml +++ b/concourse/pipeline.yml @@ -259,12 +259,12 @@ resources: username: ((docker_hub_username)) password: ((docker_hub_password)) repository: springci/sts4-build-env -- name: theia-docker-image - type: docker-image - source: - username: ((docker_hub_username)) - password: ((docker_hub_password)) - repository: springci/sts4-theia-snapshot +# - name: theia-docker-image +# type: docker-image +# source: +# username: ((docker_hub_username)) +# password: ((docker_hub_password)) +# repository: springci/sts4-theia-snapshot - name: maven-cache type: s3 source: @@ -401,40 +401,40 @@ jobs: params: rebase: true repository: sts4-wiki-out -- name: build-theia-docker-snapshot-image - serial: true - on_failure: - put: slack-notification - params: - text: | - Concourse ${BUILD_PIPELINE_NAME}/${BUILD_JOB_NAME}/${BUILD_NAME} has failed! - https://ci.spring.io/teams/tools/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME} - plan: - - in_parallel: - - get: s3-concourse-vsix-snapshot - trigger: true - passed: - - build-consourse-vsix-snapshot - - get: s3-spring-boot-vsix-snapshot - trigger: true - passed: - - build-spring-boot-vsix-snapshot - - get: s3-bosh-vsix-snapshot - trigger: true - passed: - - build-bosh-vsix-snapshot - - get: s3-manifest-yaml-vsix-snapshot - trigger: true - passed: - - build-manifest-yaml-vsix-snapshot - - get: sts4 - - task: prepare-theia-docker-image - file: sts4/concourse/tasks/prepare-theia-docker-image.yml - - put: theia-docker-image - params: - build: output - get_params: - skip_download: true +# - name: build-theia-docker-snapshot-image +# serial: true +# on_failure: +# put: slack-notification +# params: +# text: | +# Concourse ${BUILD_PIPELINE_NAME}/${BUILD_JOB_NAME}/${BUILD_NAME} has failed! +# https://ci.spring.io/teams/tools/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME} +# plan: +# - in_parallel: +# - get: s3-concourse-vsix-snapshot +# trigger: true +# passed: +# - build-consourse-vsix-snapshot +# - get: s3-spring-boot-vsix-snapshot +# trigger: true +# passed: +# - build-spring-boot-vsix-snapshot +# - get: s3-bosh-vsix-snapshot +# trigger: true +# passed: +# - build-bosh-vsix-snapshot +# - get: s3-manifest-yaml-vsix-snapshot +# trigger: true +# passed: +# - build-manifest-yaml-vsix-snapshot +# - get: sts4 +# - task: prepare-theia-docker-image +# file: sts4/concourse/tasks/prepare-theia-docker-image.yml +# - put: theia-docker-image +# params: +# build: output +# get_params: +# skip_download: true - name: build-docker-image serial: true plan: @@ -1025,13 +1025,13 @@ groups: - bump-version-patch - bump-version-minor - bump-version-major -- name: theia-snapshots - jobs: - - build-theia-docker-snapshot-image - - build-consourse-vsix-snapshot - - build-manifest-yaml-vsix-snapshot - - build-spring-boot-vsix-snapshot - - build-bosh-vsix-snapshot +# - name: theia-snapshots +# jobs: +# - build-theia-docker-snapshot-image +# - build-consourse-vsix-snapshot +# - build-manifest-yaml-vsix-snapshot +# - build-spring-boot-vsix-snapshot +# - build-bosh-vsix-snapshot - name: setup jobs: - build-mvn-cache