Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move all classes of languageconfiguration plugin to internal package #417

Merged
merged 1 commit into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Require-Bundle: org.eclipse.jface.text,
org.eclipse.ui.editors,
org.eclipse.e4.ui.css.swt.theme,
org.eclipse.core.expressions
Bundle-Activator: org.eclipse.tm4e.languageconfiguration.internal.LanguageConfigurationPlugin
Bundle-Activator: org.eclipse.tm4e.languageconfiguration.LanguageConfigurationPlugin
Export-Package: org.eclipse.tm4e.languageconfiguration
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: org.eclipse.tm4e.languageconfiguration
22 changes: 11 additions & 11 deletions org.eclipse.tm4e.languageconfiguration/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Angelo Zerr <angelo.zerr@gmail.com> - Initial API and implementation
# Angelo Zerr <angelo.zerr@gmail.com> - Initial API and implementation
###############################################################################
-->
<plugin>

<extension-point id="languageConfigurations"
<extension-point id="languageConfigurations"
name="%LanguageConfigurations.extension.name"
schema="schema/languageConfigurations.exsd" />

<!-- Preference Pages -->
<extension
point="org.eclipse.ui.preferencePages">
point="org.eclipse.ui.preferencePages">
<page
name="%LanguageConfigurationPage.name"
name="%LanguageConfigurationPage.name"
class="org.eclipse.tm4e.languageconfiguration.internal.preferences.LanguageConfigurationPreferencePage"
id="org.eclipse.tm4e.languageconfiguration.preferences.LanguageConfigurationPreferencePage"
category="org.eclipse.tm4e.ui.preferences.TextMatePreferencePage">
</page>
</extension>

<!-- Generic Editor auto edit stragies for language configuration -->
<!-- Generic Editor auto edit stragies for language configuration -->
<extension
point="org.eclipse.ui.genericeditor.autoEditStrategies">
<autoEditStrategy
class="org.eclipse.tm4e.languageconfiguration.LanguageConfigurationAutoEditStrategy"
class="org.eclipse.tm4e.languageconfiguration.internal.LanguageConfigurationAutoEditStrategy"
contentType="org.eclipse.core.runtime.text">
</autoEditStrategy>
</extension>
Expand All @@ -42,7 +42,7 @@
<extension
point="org.eclipse.ui.genericeditor.characterPairMatchers">
<characterPairMatcher
class="org.eclipse.tm4e.languageconfiguration.LanguageConfigurationCharacterPairMatcher"
class="org.eclipse.tm4e.languageconfiguration.internal.LanguageConfigurationCharacterPairMatcher"
contentType="org.eclipse.core.runtime.text">
</characterPairMatcher>
</extension>
Expand Down Expand Up @@ -116,21 +116,21 @@
<extension
point="org.eclipse.ui.handlers">
<handler
class="org.eclipse.tm4e.languageconfiguration.ToggleLineCommentHandler"
class="org.eclipse.tm4e.languageconfiguration.internal.ToggleLineCommentHandler"
commandId="org.eclipse.tm4e.languageconfiguration.togglelinecommentcommand">
<enabledWhen>
<reference definitionId="org.eclipse.tm4e.languageconfiguration.hasLanguageConfiguration"/>
</enabledWhen>
</handler>
<handler
class="org.eclipse.tm4e.languageconfiguration.ToggleLineCommentHandler"
class="org.eclipse.tm4e.languageconfiguration.internal.ToggleLineCommentHandler"
commandId="org.eclipse.tm4e.languageconfiguration.addblockcommentcommand">
<enabledWhen>
<reference definitionId="org.eclipse.tm4e.languageconfiguration.hasLanguageConfiguration"/>
</enabledWhen>
</handler>
<handler
class="org.eclipse.tm4e.languageconfiguration.ToggleLineCommentHandler"
class="org.eclipse.tm4e.languageconfiguration.internal.ToggleLineCommentHandler"
commandId="org.eclipse.tm4e.languageconfiguration.removeblockcommentcommand">
<enabledWhen>
<reference definitionId="org.eclipse.tm4e.languageconfiguration.hasLanguageConfiguration"/>
Expand All @@ -140,7 +140,7 @@
<extension
point="org.eclipse.core.expressions.propertyTesters">
<propertyTester
class="org.eclipse.tm4e.languageconfiguration.HasLanguageConfigurationPropertyTester"
class="org.eclipse.tm4e.languageconfiguration.internal.HasLanguageConfigurationPropertyTester"
id="org.eclipse.tm4e.languageconfiguration.hasLanguageConfigurationPropertyTester"
namespace="org.eclipse.tm4e.languageconfiguration"
properties="hasLanguageConfiguration"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
/**
* Copyright (c) 2015-2017 Angelo ZERR.
* Copyright (c) 2015-2017 Angelo ZERR.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
*/
package org.eclipse.tm4e.languageconfiguration.internal;
package org.eclipse.tm4e.languageconfiguration;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

/**
* OSGi Activator for Language Configuration (VSCode
* language-configuration.json) Eclipse bundle.
*
* OSGi Activator for Language Configuration (VSCode language-configuration.json) Eclipse bundle.
*/
public final class LanguageConfigurationPlugin extends AbstractUIPlugin {

/** The plug-in ID */
public static final String PLUGIN_ID = "org.eclipse.tm4e.languageconfiguration"; //$NON-NLS-1$

/** The shared instance */
@Nullable
private static LanguageConfigurationPlugin INSTANCE = null;
private static volatile LanguageConfigurationPlugin plugin;

/**
* Returns the shared instance
*
* @return the shared instance
*/
@Nullable
static LanguageConfigurationPlugin getInstance() {
return INSTANCE;
public static LanguageConfigurationPlugin getDefault() {
return plugin;
}

public static void log(final IStatus status) {
final var plugin = LanguageConfigurationPlugin.INSTANCE;
final var plugin = LanguageConfigurationPlugin.plugin;
if (plugin != null) {
plugin.getLog().log(status);
}
Expand All @@ -43,12 +48,12 @@ public static void log(final IStatus status) {
@Override
public void start(@Nullable final BundleContext context) throws Exception {
super.start(context);
INSTANCE = this;
plugin = this;
}

@Override
public void stop(@Nullable final BundleContext context) throws Exception {
INSTANCE = null;
plugin = null;
super.stop(context);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfiguration;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfigurationDefinition;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfigurationRegistryManager;

public abstract class AbstractLanguageConfigurationRegistryManager implements ILanguageConfigurationRegistryManager {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
* Contributors:
* Lucas Bullen (Red Hat Inc.) - initial API and implementation
*/
package org.eclipse.tm4e.languageconfiguration;
package org.eclipse.tm4e.languageconfiguration.internal;

import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.runtime.Adapters;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tm4e.languageconfiguration.internal.LanguageConfigurationRegistryManager;
import org.eclipse.tm4e.ui.internal.utils.ContentTypeHelper;
import org.eclipse.tm4e.ui.internal.utils.ContentTypeInfo;
import org.eclipse.ui.texteditor.ITextEditor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Contributors:
* Lucas Bullen (Red Hat Inc.) - initial API and implementation
*/
package org.eclipse.tm4e.languageconfiguration;
package org.eclipse.tm4e.languageconfiguration.internal;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Contributors:
* Lucas Bullen (Red Hat Inc.) - initial API and implementation
*/
package org.eclipse.tm4e.languageconfiguration;
package org.eclipse.tm4e.languageconfiguration.internal;

import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jdt.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Contributors:
* Lucas Bullen (Red Hat Inc.) - initial API and implementation
*/
package org.eclipse.tm4e.languageconfiguration;
package org.eclipse.tm4e.languageconfiguration.internal;

import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jdt.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.List;

import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfiguration;
import org.eclipse.tm4e.languageconfiguration.internal.supports.StandardAutoClosingPairConditional;
import org.eclipse.tm4e.languageconfiguration.internal.supports.CharacterPair;
import org.eclipse.tm4e.languageconfiguration.internal.supports.CommentRule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
*/
package org.eclipse.tm4e.languageconfiguration;
package org.eclipse.tm4e.languageconfiguration.internal;

import java.util.Arrays;

Expand All @@ -23,7 +23,6 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.tm4e.core.model.TMToken;
import org.eclipse.tm4e.languageconfiguration.internal.LanguageConfigurationRegistryManager;
import org.eclipse.tm4e.languageconfiguration.internal.supports.StandardAutoClosingPairConditional;
import org.eclipse.tm4e.languageconfiguration.internal.supports.EnterAction;
import org.eclipse.tm4e.languageconfiguration.internal.utils.TabSpacesInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
*/
package org.eclipse.tm4e.languageconfiguration;
package org.eclipse.tm4e.languageconfiguration.internal;

import java.util.List;

Expand All @@ -21,7 +21,6 @@
import org.eclipse.jface.text.source.DefaultCharacterPairMatcher;
import org.eclipse.jface.text.source.ICharacterPairMatcher;
import org.eclipse.jface.text.source.ICharacterPairMatcherExtension;
import org.eclipse.tm4e.languageconfiguration.internal.LanguageConfigurationRegistryManager;
import org.eclipse.tm4e.languageconfiguration.internal.supports.CharacterPair;
import org.eclipse.tm4e.ui.internal.utils.ContentTypeHelper;
import org.eclipse.tm4e.ui.internal.utils.ContentTypeInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfiguration;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfigurationDefinition;
import org.eclipse.tm4e.languageconfiguration.LanguageConfigurationPlugin;
import org.eclipse.tm4e.languageconfiguration.internal.supports.CharacterPairSupport;
import org.eclipse.tm4e.languageconfiguration.internal.supports.CommentSupport;
import org.eclipse.tm4e.languageconfiguration.internal.supports.OnEnterSupport;
Expand Down Expand Up @@ -139,7 +138,7 @@ public ILanguageConfiguration getLanguageConfiguration() {
try (var in = getInputStream()) {
return LanguageConfiguration.load(new InputStreamReader(in, Charset.defaultCharset()));
} catch (final IOException e) {
final var plugin = LanguageConfigurationPlugin.getInstance();
final var plugin = LanguageConfigurationPlugin.getDefault();
if (plugin != null) {
plugin.getLog().log(
new Status(IStatus.ERROR, LanguageConfigurationPlugin.PLUGIN_ID, e.getMessage(), e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfigurationDefinition;
import org.eclipse.tm4e.languageconfiguration.LanguageConfigurationPlugin;
import org.eclipse.tm4e.languageconfiguration.internal.preferences.PreferenceConstants;
import org.eclipse.tm4e.languageconfiguration.internal.preferences.PreferenceHelper;
import org.eclipse.tm4e.languageconfiguration.internal.supports.StandardAutoClosingPairConditional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Contributors:
* Lucas Bullen (Red Hat Inc.) - initial API and implementation
*/
package org.eclipse.tm4e.languageconfiguration;
package org.eclipse.tm4e.languageconfiguration.internal;

import java.util.HashSet;
import java.util.Set;
Expand All @@ -30,7 +30,6 @@
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.tm4e.languageconfiguration.internal.LanguageConfigurationRegistryManager;
import org.eclipse.tm4e.languageconfiguration.internal.supports.CharacterPair;
import org.eclipse.tm4e.languageconfiguration.internal.supports.CommentSupport;
import org.eclipse.tm4e.languageconfiguration.internal.utils.TextUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
* Contributors:
* Lucas Bullen (Red Hat Inc.) - initial API and implementation
*/
package org.eclipse.tm4e.languageconfiguration;
package org.eclipse.tm4e.languageconfiguration.internal;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tm4e.languageconfiguration.internal.AbstractLanguageConfigurationRegistryManager;
import org.osgi.service.prefs.BackingStoreException;

public class WorkingCopyLanguageConfigurationRegistryManager extends AbstractLanguageConfigurationRegistryManager {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfigurationRegistryManager;
import org.eclipse.tm4e.languageconfiguration.internal.ILanguageConfigurationRegistryManager;

final class LanguageConfigurationContentProvider implements IStructuredContentProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfigurationDefinition;
import org.eclipse.tm4e.languageconfiguration.internal.ILanguageConfigurationDefinition;

final class LanguageConfigurationLabelProvider extends LabelProvider implements ITableLabelProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfigurationDefinition;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfigurationRegistryManager;
import org.eclipse.tm4e.languageconfiguration.WorkingCopyLanguageConfigurationRegistryManager;
import org.eclipse.tm4e.languageconfiguration.internal.ILanguageConfigurationDefinition;
import org.eclipse.tm4e.languageconfiguration.internal.ILanguageConfigurationRegistryManager;
import org.eclipse.tm4e.languageconfiguration.internal.LanguageConfigurationRegistryManager;
import org.eclipse.tm4e.languageconfiguration.internal.WorkingCopyLanguageConfigurationRegistryManager;
import org.eclipse.tm4e.languageconfiguration.internal.widgets.ColumnSelectionAdapter;
import org.eclipse.tm4e.languageconfiguration.internal.widgets.ColumnViewerComparator;
import org.eclipse.tm4e.languageconfiguration.internal.widgets.LanguageConfigurationPreferencesWidget;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfigurationDefinition;
import org.eclipse.tm4e.languageconfiguration.LanguageConfigurationPlugin;
import org.eclipse.tm4e.languageconfiguration.internal.ILanguageConfigurationDefinition;
import org.eclipse.tm4e.languageconfiguration.internal.LanguageConfigurationDefinition;
import org.eclipse.tm4e.languageconfiguration.internal.LanguageConfigurationPlugin;
import org.eclipse.tm4e.ui.internal.utils.ContentTypeHelper;

import com.google.gson.Gson;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfiguration;
import org.eclipse.tm4e.languageconfiguration.internal.ILanguageConfiguration;
import org.eclipse.tm4e.languageconfiguration.internal.supports.CharacterPair;
import org.eclipse.tm4e.languageconfiguration.internal.supports.CommentRule;
import org.eclipse.tm4e.languageconfiguration.internal.supports.FoldingRule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfigurationDefinition;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfigurationRegistryManager;
import org.eclipse.tm4e.languageconfiguration.internal.ILanguageConfigurationDefinition;
import org.eclipse.tm4e.languageconfiguration.internal.ILanguageConfigurationRegistryManager;

@NonNullByDefault({})
public final class LanguageConfigurationPreferencesWidget extends LanguageConfigurationInfoWidget {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfigurationDefinition;
import org.eclipse.tm4e.languageconfiguration.ILanguageConfigurationRegistryManager;
import org.eclipse.tm4e.languageconfiguration.internal.ILanguageConfigurationDefinition;
import org.eclipse.tm4e.languageconfiguration.internal.ILanguageConfigurationRegistryManager;
import org.eclipse.tm4e.languageconfiguration.internal.LanguageConfigurationRegistryManager;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;
Expand Down
Loading