Some cleanup renamings of stuff in manifest yml editor

This commit is contained in:
Kris De Volder
2016-09-23 11:49:47 -07:00
parent 2b0927ed9b
commit 9e346dd90e
10 changed files with 19 additions and 170 deletions

View File

@@ -1,80 +0,0 @@
///*******************************************************************************
// * Copyright (c) 2016 Pivotal, Inc.
// * All rights reserved. This program and the accompanying materials
// * are made available under the terms of the Eclipse Public License v1.0
// * which accompanies this distribution, and is available at
// * http://www.eclipse.org/legal/epl-v10.html
// *
// * Contributors:
// * Pivotal, Inc. - initial API and implementation
// *******************************************************************************/
//package org.springframework.ide.eclipse.cloudfoundry.manifest.editor;
//
//import java.util.Collection;
//
//import javax.inject.Provider;
//
//import org.springframework.ide.eclipse.editor.support.yaml.schema.YValueHint;
//import org.springsource.ide.eclipse.commons.frameworks.core.ExceptionUtil;
//
//public class ManifestEditorActivator {
//
// // The plug-in ID
// public static final String PLUGIN_ID = "org.springframework.ide.eclipse.cloudfoundry.manifest.editor"; //$NON-NLS-1$
//
// // The shared instance
// private static ManifestEditorActivator plugin;
//
// /**
// * The constructor
// */
// public ManifestEditorActivator() {
// }
//
// /*
// * (non-Javadoc)
// * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
// */
// public void start(BundleContext context) throws Exception {
// super.start(context);
// plugin = this;
// }
//
// /*
// * (non-Javadoc)
// * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
// */
// public void stop(BundleContext context) throws Exception {
// plugin = null;
// super.stop(context);
// }
//
// /**
// * Returns the shared instance
// *
// * @return the shared instance
// */
// public static ManifestEditorActivator getDefault() {
// return plugin;
// }
//
// public static void log(Throwable e) {
// getDefault().getLog().log(ExceptionUtil.status(e));
// }
//
//
// /*
// *
// * "Framework" to contribute value hints into manifest editor
// */
//
// private Provider<Collection<YValueHint>> buildpackProvider;
//
// public void setBuildpackProvider(Provider<Collection<YValueHint>> buildpackProvider) {
// this.buildpackProvider = buildpackProvider;
// }
//
// public Provider<Collection<YValueHint>> getBuildpackProvider() {
// return this.buildpackProvider;
// }
//}

View File

@@ -1,74 +0,0 @@
///*******************************************************************************
// * Copyright (c) 2016 Pivotal, Inc.
// * All rights reserved. This program and the accompanying materials
// * are made available under the terms of the Eclipse Public License v1.0
// * which accompanies this distribution, and is available at
// * http://www.eclipse.org/legal/epl-v10.html
// *
// * Contributors:
// * Pivotal, Inc. - initial API and implementation
// *******************************************************************************/
//package org.springframework.ide.eclipse.cloudfoundry.manifest.editor;
//
//import javax.inject.Provider;
//
//import org.eclipse.jface.dialogs.IDialogSettings;
//import org.eclipse.jface.preference.IPreferenceStore;
//import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
//import org.eclipse.jface.text.source.ISourceViewer;
//import org.eclipse.swt.widgets.Shell;
//import org.springframework.ide.eclipse.editor.support.reconcile.IReconcileEngine;
//import org.springframework.ide.eclipse.editor.support.reconcile.ReconcileStrategy;
//import org.springframework.ide.eclipse.editor.support.yaml.AbstractYamlSourceViewerConfiguration;
//import org.springframework.ide.eclipse.editor.support.yaml.YamlAssistContextProvider;
//import org.springframework.ide.eclipse.editor.support.yaml.completions.SchemaBasedYamlAssistContextProvider;
//import org.springframework.ide.eclipse.editor.support.yaml.reconcile.YamlSchemaBasedReconcileEngine;
//import org.springframework.ide.eclipse.editor.support.yaml.structure.YamlStructureProvider;
//
///**
// * @author Kris De Volder
// */
//public class ManifestYamlSourceViewerConfiguration extends AbstractYamlSourceViewerConfiguration {
//
// private ManifestYmlSchema schema = new ManifestYmlSchema(ManifestEditorActivator.getDefault().getBuildpackProvider());
// private YamlAssistContextProvider assistContextProvider = new SchemaBasedYamlAssistContextProvider(schema);
//
// public ManifestYamlSourceViewerConfiguration(Provider<Shell> shellProvider) {
// super(shellProvider);
// }
//
// @Override
// protected YamlAssistContextProvider getAssistContextProvider() {
// return assistContextProvider;
// }
//
// @Override
// protected YamlStructureProvider getStructureProvider() {
// return YamlStructureProvider.DEFAULT;
// }
//
// @Override
// protected IDialogSettings getPluginDialogSettings() {
// return ManifestEditorActivator.getDefault().getDialogSettings();
// }
//
// @Override
// protected IReconcilingStrategy createReconcilerStrategy(ISourceViewer viewer) {
// IReconcileEngine engine = createReconcileEngine();
// return new ReconcileStrategy(viewer, engine);
// }
//
// private IReconcileEngine createReconcileEngine() {
// return new YamlSchemaBasedReconcileEngine(getAstProvider(), schema);
// }
//
// @Override
// protected IPreferenceStore getPreferencesStore() {
// return ManifestEditorActivator.getDefault().getPreferenceStore();
// }
//
// @Override
// protected String getPluginId() {
// return ManifestEditorActivator.PLUGIN_ID;
// }
//}

View File

@@ -1,4 +1,4 @@
package org.springframework.ide.vscode.yaml;
package org.springframework.ide.vscode.cloudfoundry.manifest.editor;
import java.io.IOException;
import java.io.InputStream;
@@ -79,7 +79,7 @@ public class Main {
* When the request stream is closed, wait for 5s for all outstanding responses to compute, then return.
*/
public static void run(Connection connection) {
YamlLanguageServer server = new YamlLanguageServer();
ManifestYamlLanguageServer server = new ManifestYamlLanguageServer();
LoggingJsonAdapter jsonServer = new LoggingJsonAdapter(server);
jsonServer.setMessageLog(new PrintWriter(System.out));

View File

@@ -1,3 +1,4 @@
package org.springframework.ide.vscode.cloudfoundry.manifest.editor;
///*******************************************************************************
// * Copyright (c) 2015 Pivotal, Inc.
// * All rights reserved. This program and the accompanying materials

View File

@@ -1,4 +1,4 @@
package org.springframework.ide.vscode.yaml;
package org.springframework.ide.vscode.cloudfoundry.manifest.editor;
import java.io.StringReader;
import java.util.ArrayList;
@@ -10,6 +10,7 @@ import org.springframework.ide.vscode.util.Futures;
import org.springframework.ide.vscode.util.SimpleLanguageServer;
import org.springframework.ide.vscode.util.SimpleTextDocumentService;
import org.springframework.ide.vscode.util.TextDocument;
import org.springframework.ide.vscode.yaml.ErrorCodes;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.error.MarkedYAMLException;
import org.yaml.snakeyaml.error.YAMLException;
@@ -29,11 +30,11 @@ import io.typefox.lsapi.RangeImpl;
import io.typefox.lsapi.ServerCapabilities;
import io.typefox.lsapi.ServerCapabilitiesImpl;
public class YamlLanguageServer extends SimpleLanguageServer {
public class ManifestYamlLanguageServer extends SimpleLanguageServer {
private Yaml yaml = new Yaml();
public YamlLanguageServer() {
public ManifestYamlLanguageServer() {
SimpleTextDocumentService documents = getTextDocumentService();
// SimpleWorkspaceService workspace = getWorkspaceService();
documents.onDidChangeContent(params -> {

View File

@@ -8,7 +8,7 @@
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.eclipse.cloudfoundry.manifest.editor;
package org.springframework.ide.vscode.cloudfoundry.manifest.editor;
import java.util.Collection;
import java.util.Set;

View File

@@ -8,7 +8,7 @@
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.eclipse.cloudfoundry.manifest.editor;
package org.springframework.ide.vscode.cloudfoundry.manifest.editor;
import java.util.Set;

View File

@@ -13,6 +13,7 @@ package org.springframework.ide.vscode.yaml;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.ide.vscode.cloudfoundry.manifest.editor.ManifestYamlLanguageServer;
import org.springframework.ide.vscode.testharness.Editor;
import org.springframework.ide.vscode.testharness.LanguageServerHarness;
@@ -21,7 +22,7 @@ public class ManifestYamlEditorTest {
LanguageServerHarness harness;
@Before public void setup() throws Exception {
harness = new LanguageServerHarness(YamlLanguageServer::new);
harness = new LanguageServerHarness(ManifestYamlLanguageServer::new);
harness.intialize(null);
}
@@ -37,7 +38,7 @@ public class ManifestYamlEditorTest {
}
@Test public void reconcileRunsOnDocumentOpenAndChange() throws Exception {
LanguageServerHarness harness = new LanguageServerHarness(YamlLanguageServer::new);
LanguageServerHarness harness = new LanguageServerHarness(ManifestYamlLanguageServer::new);
harness.intialize(null);
Editor editor = harness.newEditor(

View File

@@ -8,24 +8,24 @@ import java.nio.file.Paths;
import java.util.List;
import org.junit.Test;
import org.springframework.ide.vscode.cloudfoundry.manifest.editor.ManifestYamlLanguageServer;
import org.springframework.ide.vscode.testharness.LanguageServerHarness;
import org.springframework.ide.vscode.testharness.TextDocumentInfo;
import org.springframework.ide.vscode.yaml.YamlLanguageServer;
import io.typefox.lsapi.CompletionItem;
import io.typefox.lsapi.CompletionList;
import io.typefox.lsapi.InitializeResult;
import io.typefox.lsapi.ServerCapabilities;
public class YamlLanguageServerTest {
public class ManifestYamlLanguageServerTest {
public static File getTestResource(String name) throws URISyntaxException {
return Paths.get(YamlLanguageServerTest.class.getResource(name).toURI()).toFile();
return Paths.get(ManifestYamlLanguageServerTest.class.getResource(name).toURI()).toFile();
}
@Test
public void createAndInitializeServerWithWorkspace() throws Exception {
LanguageServerHarness harness = new LanguageServerHarness(YamlLanguageServer::new);
LanguageServerHarness harness = new LanguageServerHarness(ManifestYamlLanguageServer::new);
File workspaceRoot = getTestResource("/workspace/");
assertExpectedInitResult(harness.intialize(workspaceRoot));
}
@@ -33,13 +33,13 @@ public class YamlLanguageServerTest {
@Test
public void createAndInitializeServerWithoutWorkspace() throws Exception {
File workspaceRoot = null;
LanguageServerHarness harness = new LanguageServerHarness(YamlLanguageServer::new);
LanguageServerHarness harness = new LanguageServerHarness(ManifestYamlLanguageServer::new);
assertExpectedInitResult(harness.intialize(workspaceRoot));
}
@Test public void completions() throws Exception {
LanguageServerHarness harness = new LanguageServerHarness(YamlLanguageServer::new);
LanguageServerHarness harness = new LanguageServerHarness(ManifestYamlLanguageServer::new);
File workspaceRoot = getTestResource("/workspace/");
assertExpectedInitResult(harness.intialize(workspaceRoot));

View File

@@ -19,7 +19,7 @@ import java.util.List;
import java.util.Map;
import org.junit.Test;
import org.springframework.ide.eclipse.cloudfoundry.manifest.editor.ManifestYmlSchema;
import org.springframework.ide.vscode.cloudfoundry.manifest.editor.ManifestYmlSchema;
import org.springframework.ide.vscode.util.StringUtil;
import org.springframework.ide.vscode.yaml.schema.YTypeFactory.YBeanType;
import org.springframework.ide.vscode.yaml.schema.YTypeFactory.YSeqType;