forked from eclipse-platform/eclipse.platform.text
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #87 Signed-off-by: azerr <[email protected]>
- Loading branch information
1 parent
81e0abc
commit 433f4fe
Showing
25 changed files
with
1,999 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry exported="true" kind="lib" path="lib/ec4j-core-0.3.0.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/ec4j-ide-support-0.3.0.jar"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/bin | ||
/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.eclipse.text.editorconfig</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
</natures> | ||
</projectDescription> |
317 changes: 317 additions & 0 deletions
317
org.eclipse.text.editorconfig/.settings/org.eclipse.jdt.core.prefs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: %pluginName | ||
Bundle-Vendor: %providerName | ||
Bundle-Localization: plugin | ||
Bundle-SymbolicName: org.eclipse.editorconfig;singleton:=true | ||
Bundle-Version: 0.1.0.qualifier | ||
Require-Bundle: org.eclipse.jface.text, | ||
org.eclipse.core.runtime, | ||
org.eclipse.ui, | ||
org.eclipse.core.resources, | ||
org.eclipse.core.filesystem, | ||
org.eclipse.ui.ide;bundle-version="3.12.0", | ||
org.eclipse.ui.editors | ||
Bundle-RequiredExecutionEnvironment: JavaSE-11 | ||
Bundle-Activator: org.eclipse.text.editorconfig.EditorConfigPlugin | ||
Bundle-ActivationPolicy: lazy | ||
Bundle-ClassPath: lib/ec4j-core-0.3.0.jar, | ||
lib/ec4j-ide-support-0.3.0.jar, | ||
. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
source.. = src/main/java/,\ | ||
src/main/resources/,\ | ||
src/test/resources | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
plugin.properties,\ | ||
plugin.xml,\ | ||
lib/ec4j-core-0.3.0.jar,\ | ||
lib/ec4j-ide-support-0.3.0.jar | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
############################################################################### | ||
# Copyright (c) 2022 Angelo Zerr and others. | ||
# | ||
# This program and the accompanying materials | ||
# are made available under the terms of the Eclipse Public License 2.0 | ||
# which accompanies this distribution, and is available at | ||
# https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Angelo Zerr <[email protected]> - Initial API and implementation | ||
############################################################################### | ||
pluginName=Support for editorconfig in Eclipse text editors | ||
providerName= Eclipse.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?eclipse version="3.4"?> | ||
<!-- | ||
############################################################################### | ||
# Copyright (c) 2022 Angelo Zerr and others. | ||
# | ||
# This program and the accompanying materials | ||
# are made available under the terms of the Eclipse Public License 2.0 | ||
# which accompanies this distribution, and is available at | ||
# https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Angelo Zerr <[email protected]> - Initial API and implementation | ||
############################################################################### | ||
--> | ||
<plugin> | ||
|
||
<!-- EditorConfig --> | ||
|
||
<extension | ||
point="org.eclipse.core.contenttype.contentTypes"> | ||
<content-type | ||
base-type="org.eclipse.core.runtime.text" | ||
id="org.eclipse.text.editorconfig" | ||
file-names=".editorconfig" | ||
name="EditorConfig" | ||
priority="normal"/> | ||
</extension> | ||
|
||
<extension | ||
point="org.eclipse.ui.editors"> | ||
<editorContentTypeBinding | ||
contentTypeId="org.eclipse.text.editorconfig" | ||
editorId="org.eclipse.ui.genericeditor.GenericEditor"> | ||
</editorContentTypeBinding> | ||
</extension> | ||
|
||
<extension | ||
point="org.eclipse.ui.startup"> | ||
<startup class="org.eclipse.text.editorconfig.internal.EditorConfigStartup" /> | ||
</extension> | ||
|
||
<extension | ||
point="org.eclipse.core.runtime.adapters"> | ||
<factory | ||
adaptableType="org.eclipse.ui.texteditor.ITextEditor" | ||
class="org.eclipse.text.editorconfig.internal.EditorConfigPreferenceStoreAdapter"> | ||
<adapter | ||
type="org.eclipse.core.runtime.preferences.IEclipsePreferences"> | ||
</adapter> | ||
</factory> | ||
</extension> | ||
|
||
</plugin> |
80 changes: 80 additions & 0 deletions
80
org.eclipse.text.editorconfig/src/org/eclipse/text/editorconfig/EditorConfigPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/** | ||
* Copyright (c) 2017 Angelo ZERR. | ||
* 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: | ||
* Angelo Zerr <[email protected]> - initial API and implementation | ||
*/ | ||
package org.eclipse.text.editorconfig; | ||
|
||
import org.eclipse.core.runtime.IStatus; | ||
import org.eclipse.core.runtime.Status; | ||
import org.eclipse.ui.plugin.AbstractUIPlugin; | ||
import org.osgi.framework.BundleContext; | ||
|
||
/** | ||
* The activator class controls the plug-in life cycle | ||
*/ | ||
public class EditorConfigPlugin extends AbstractUIPlugin { | ||
|
||
// The plug-in ID | ||
public static final String PLUGIN_ID = "org.eclipse.text.editorconfig"; //$NON-NLS-1$ | ||
|
||
// The shared instance | ||
private static EditorConfigPlugin plugin; | ||
|
||
/** | ||
* The constructor | ||
*/ | ||
public EditorConfigPlugin() { | ||
} | ||
|
||
@Override | ||
public void start(BundleContext context) throws Exception { | ||
super.start(context); | ||
plugin = this; | ||
IDEEditorConfigManager.getInstance().init(); | ||
} | ||
|
||
@Override | ||
public void stop(BundleContext context) throws Exception { | ||
IDEEditorConfigManager.getInstance().dispose(); | ||
plugin = null; | ||
super.stop(context); | ||
} | ||
|
||
/** | ||
* Returns the shared instance | ||
* | ||
* @return the shared instance | ||
*/ | ||
public static EditorConfigPlugin getDefault() { | ||
return plugin; | ||
} | ||
|
||
/** | ||
* Utility method to log errors. | ||
* | ||
* @param thr | ||
* The exception through which we noticed the error | ||
*/ | ||
public static void logError(final Throwable thr) { | ||
getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, 0, thr.getMessage(), thr)); | ||
} | ||
|
||
/** | ||
* Utility method to log errors. | ||
* | ||
* @param message | ||
* User comprehensible message | ||
* @param thr | ||
* The exception through which we noticed the error | ||
*/ | ||
public static void logError(final String message, final Throwable thr) { | ||
getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, 0, message, thr)); | ||
} | ||
|
||
} |
Oops, something went wrong.