Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2015-09-16 06:42:19 +0000
committerAlexander Kurtakov2015-09-16 06:43:22 +0000
commit872549aabdaa5c629ae8f419b92d44265137890a (patch)
treed8756be7f2125ab9703a75617b08ec703321a15c
downloadorg.eclipse.dltk.sh-872549aabdaa5c629ae8f419b92d44265137890a.tar.gz
org.eclipse.dltk.sh-872549aabdaa5c629ae8f419b92d44265137890a.tar.xz
org.eclipse.dltk.sh-872549aabdaa5c629ae8f419b92d44265137890a.zip
Bug 473983 - Contribution - ShellEd
Initial commit to the repo. Change-Id: I85ac3647853bd59dec0c1ba6eab86ff77bc777c3 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--desktopintegration/eclipse-shelled.metainfo.xml12
-rw-r--r--org.eclipse.dltk.sh.core.tests/.classpath7
-rw-r--r--org.eclipse.dltk.sh.core.tests/.project34
-rw-r--r--org.eclipse.dltk.sh.core.tests/.settings/org.eclipse.jdt.core.prefs96
-rw-r--r--org.eclipse.dltk.sh.core.tests/META-INF/MANIFEST.MF9
-rw-r--r--org.eclipse.dltk.sh.core.tests/build.properties4
-rw-r--r--org.eclipse.dltk.sh.core.tests/pom.xml45
-rw-r--r--org.eclipse.dltk.sh.core.tests/src/org/eclipse/dltk/sh/core/parser/tests/ShellScriptSourceParserTest.java25
-rw-r--r--org.eclipse.dltk.sh.core.tests/src/org/eclipse/dltk/sh/core/tests/AllTests.java20
-rw-r--r--org.eclipse.dltk.sh.core/.classpath7
-rw-r--r--org.eclipse.dltk.sh.core/.project34
-rw-r--r--org.eclipse.dltk.sh.core/.settings/org.eclipse.jdt.core.prefs101
-rw-r--r--org.eclipse.dltk.sh.core/.settings/org.eclipse.jdt.ui.prefs54
-rw-r--r--org.eclipse.dltk.sh.core/.settings/org.moreunit.prefs7
-rw-r--r--org.eclipse.dltk.sh.core/META-INF/MANIFEST.MF13
-rw-r--r--org.eclipse.dltk.sh.core/build.properties5
-rw-r--r--org.eclipse.dltk.sh.core/plugin.xml46
-rw-r--r--org.eclipse.dltk.sh.core/pom.xml27
-rw-r--r--org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/ShellScriptLanguageToolkit.java41
-rw-r--r--org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/ShelledContentDescriber.java25
-rw-r--r--org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/ShelledNature.java19
-rw-r--r--org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/FunctionInfo.java18
-rw-r--r--org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellModel.java54
-rw-r--r--org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellModuleDeclaration.java64
-rw-r--r--org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellScriptSourceParser.java236
-rw-r--r--org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellScriptSourceParserFactory.java23
-rw-r--r--org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShelledSourceElementParser.java49
-rw-r--r--org.eclipse.dltk.sh.doc/.project22
-rw-r--r--org.eclipse.dltk.sh.doc/META-INF/MANIFEST.MF9
-rw-r--r--org.eclipse.dltk.sh.doc/build.properties4
-rw-r--r--org.eclipse.dltk.sh.doc/plugin.xml13
-rw-r--r--org.eclipse.dltk.sh.doc/pom.xml27
-rw-r--r--org.eclipse.dltk.sh.doc/userguide/Add-Support-Screenshot.pngbin0 -> 81096 bytes
-rw-r--r--org.eclipse.dltk.sh.doc/userguide/Getting-Started.html104
-rw-r--r--org.eclipse.dltk.sh.doc/userguide/Interps-Empty-Screenshot.pngbin0 -> 52539 bytes
-rw-r--r--org.eclipse.dltk.sh.doc/userguide/Interps-Full-Screenshot.pngbin0 -> 62600 bytes
-rw-r--r--org.eclipse.dltk.sh.doc/userguide/Intro-Screenshot.pngbin0 -> 93785 bytes
-rw-r--r--org.eclipse.dltk.sh.doc/userguide/Introduction-toc.xml10
-rw-r--r--org.eclipse.dltk.sh.doc/userguide/Introduction.html50
-rw-r--r--org.eclipse.dltk.sh.doc/userguide/New-Project-Screenshot.pngbin0 -> 33727 bytes
-rw-r--r--org.eclipse.dltk.sh.doc/userguide/Project-Wizard-Screenshot.pngbin0 -> 58540 bytes
-rw-r--r--org.eclipse.dltk.sh.doc/userguide/Updating-This-Guide.html54
-rw-r--r--org.eclipse.dltk.sh.doc/userguide/images/home.gifbin0 -> 582 bytes
-rw-r--r--org.eclipse.dltk.sh.doc/userguide/images/next.gifbin0 -> 327 bytes
-rw-r--r--org.eclipse.dltk.sh.doc/userguide/images/prev.gifbin0 -> 327 bytes
-rw-r--r--org.eclipse.dltk.sh.feature/.project17
-rw-r--r--org.eclipse.dltk.sh.feature/build.properties2
-rw-r--r--org.eclipse.dltk.sh.feature/feature.properties12
-rw-r--r--org.eclipse.dltk.sh.feature/feature.xml54
-rw-r--r--org.eclipse.dltk.sh.feature/pom.xml24
-rw-r--r--org.eclipse.dltk.sh.site/category.xml14
-rw-r--r--org.eclipse.dltk.sh.site/pom.xml40
-rw-r--r--org.eclipse.dltk.sh.target/.project11
-rw-r--r--org.eclipse.dltk.sh.target/org.eclipse.dltk.sh.target.target19
-rw-r--r--org.eclipse.dltk.sh.target/pom.xml27
-rw-r--r--org.eclipse.dltk.sh.ui.tests/.classpath7
-rw-r--r--org.eclipse.dltk.sh.ui.tests/.project34
-rw-r--r--org.eclipse.dltk.sh.ui.tests/.settings/org.eclipse.jdt.core.prefs113
-rw-r--r--org.eclipse.dltk.sh.ui.tests/.settings/org.eclipse.jdt.ui.prefs54
-rw-r--r--org.eclipse.dltk.sh.ui.tests/META-INF/MANIFEST.MF9
-rw-r--r--org.eclipse.dltk.sh.ui.tests/build.properties4
-rw-r--r--org.eclipse.dltk.sh.ui.tests/pom.xml46
-rw-r--r--org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/tests/AllTests.java24
-rw-r--r--org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/AbstractScannerTester.java71
-rw-r--r--org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/AssignmentRuleTest.java61
-rw-r--r--org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/DollarBraceCountingRuleTest.java84
-rw-r--r--org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/DollarRuleTest.java95
-rw-r--r--org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/DoubleQuoteScannerTest.java111
-rw-r--r--org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/EvalScannerTest.java73
-rw-r--r--org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/MockScanner.java69
-rw-r--r--org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/TextSuite.java24
-rw-r--r--org.eclipse.dltk.sh.ui/.classpath7
-rw-r--r--org.eclipse.dltk.sh.ui/.project34
-rw-r--r--org.eclipse.dltk.sh.ui/.settings/org.eclipse.jdt.core.prefs124
-rw-r--r--org.eclipse.dltk.sh.ui/.settings/org.eclipse.jdt.ui.prefs110
-rw-r--r--org.eclipse.dltk.sh.ui/.settings/org.moreunit.prefs7
-rw-r--r--org.eclipse.dltk.sh.ui/META-INF/MANIFEST.MF24
-rw-r--r--org.eclipse.dltk.sh.ui/build.properties6
-rw-r--r--org.eclipse.dltk.sh.ui/icons/projectwizard.gifbin0 -> 590 bytes
-rw-r--r--org.eclipse.dltk.sh.ui/icons/script.gifbin0 -> 364 bytes
-rw-r--r--org.eclipse.dltk.sh.ui/icons/scriptwizard.gifbin0 -> 580 bytes
-rw-r--r--org.eclipse.dltk.sh.ui/icons/shellapp.gifbin0 -> 594 bytes
-rw-r--r--org.eclipse.dltk.sh.ui/plugin.xml317
-rw-r--r--org.eclipse.dltk.sh.ui/pom.xml27
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/Activator.java57
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/IShellColorConstants.java27
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/LaunchConfigurationDelegate.java23
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/LaunchShortcut.java29
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/MainPreferencePage.java48
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShellContentAssistPreference.java31
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShellTodoParserType.java24
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShelledUILanguageToolkit.java34
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShelledUIPreferenceInitializer.java72
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/AbstractProjectHandler.java54
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/AddNature.java40
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/NaturePropertyTester.java42
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/RemoveNature.java46
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/ShowManHandler.java48
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionEngine.java76
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProcessor.java28
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProposal.java43
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProposalCollector.java57
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProposalComputer.java33
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/editor/ShellDocumentSetupParticipant.java26
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/editor/ShellScriptEditor.java67
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/editor/ShellSourceViewerConfiguration.java224
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/AddShellScriptInterpreterDialog.java30
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellInterpreterPreferencePage.java24
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellMainLaunchConfigurationTab.java38
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInstall.java34
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInstallType.java69
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInterpreterLibraryBlock.java27
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInterpretersBlock.java35
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellTabGroup.java28
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/PreviewFile.txt7
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellColoringConfigurationBlock.java92
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellEditorPreferencesPage.java40
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellFoldingPreferencePage.java56
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellSyntaxColoringPreferencePage.java39
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellTodoTaskPreferencePage.java65
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/SimpleShellSourceViewerConfiguration.java93
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/search/ShelledMatchLocationParser.java27
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/search/ShelledSearchFactory.java22
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/search/ShelledSearchPage.java22
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/selection/ShellDocumentationProvider.java33
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/selection/ShelledSelectionEngine.java89
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/AssignmentDetector.java31
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/AssignmentRule.java61
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DocumentAndCommandScanner.java65
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DollarBraceCountingRule.java119
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DollarDetector.java27
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DollarRule.java94
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DoubleQuoteScanner.java69
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/EvalScanner.java62
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/IShellPartitions.java30
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/IndentType.java26
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ScriptAutoIndentStrategy.java340
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ShellCodeScanner.java118
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ShellPartitionScanner.java60
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ShellTextTools.java40
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/WhitespaceDetector.java21
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/FoldingBlockKind.java22
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCodeFoldingBlockProvider.java68
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCodeFoldingPreferenceBlock.java35
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCommentFoldingBlockProvider.java32
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCommentFoldingPreferenceBlock.java43
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/wizards/NewShellScriptFilePage.java22
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/wizards/NewShellScriptFileWizard.java18
-rw-r--r--org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/wizards/ShellScriptProjectWizard.java43
-rw-r--r--pom.xml157
150 files changed, 6725 insertions, 0 deletions
diff --git a/desktopintegration/eclipse-shelled.metainfo.xml b/desktopintegration/eclipse-shelled.metainfo.xml
new file mode 100644
index 0000000..25acdc2
--- /dev/null
+++ b/desktopintegration/eclipse-shelled.metainfo.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2014 Mat Booth <mat.booth@redhat.com> -->
+<component type="addon">
+ <id>eclipse-shelled</id>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>EPL-1.0</project_license>
+ <name>ShellEd</name>
+ <summary>A shell script editor plug-in for Eclipse</summary>
+ <extends>eclipse.desktop</extends>
+ <url type="homepage">http://eclipse.org/dltk</url>
+ <updatecontact>mat.booth@redhat.com</updatecontact>
+</component>
diff --git a/org.eclipse.dltk.sh.core.tests/.classpath b/org.eclipse.dltk.sh.core.tests/.classpath
new file mode 100644
index 0000000..eca7bdb
--- /dev/null
+++ b/org.eclipse.dltk.sh.core.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <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>
diff --git a/org.eclipse.dltk.sh.core.tests/.project b/org.eclipse.dltk.sh.core.tests/.project
new file mode 100644
index 0000000..4fe7541
--- /dev/null
+++ b/org.eclipse.dltk.sh.core.tests/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.dltk.sh.core.tests</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>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.dltk.sh.core.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.dltk.sh.core.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..3ac9614
--- /dev/null
+++ b/org.eclipse.dltk.sh.core.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,96 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/org.eclipse.dltk.sh.core.tests/META-INF/MANIFEST.MF b/org.eclipse.dltk.sh.core.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..6aacb4f
--- /dev/null
+++ b/org.eclipse.dltk.sh.core.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Tests
+Bundle-SymbolicName: org.eclipse.dltk.sh.core.tests
+Bundle-Version: 2.0.4.qualifier
+Require-Bundle: org.junit;bundle-version="4.10.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Fragment-Host: org.eclipse.dltk.sh.core
diff --git a/org.eclipse.dltk.sh.core.tests/build.properties b/org.eclipse.dltk.sh.core.tests/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/org.eclipse.dltk.sh.core.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/org.eclipse.dltk.sh.core.tests/pom.xml b/org.eclipse.dltk.sh.core.tests/pom.xml
new file mode 100644
index 0000000..dcf1b3e
--- /dev/null
+++ b/org.eclipse.dltk.sh.core.tests/pom.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, 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
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.dltk.sh</groupId>
+ <artifactId>parent</artifactId>
+ <version>2.0.4-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.dltk.sh.core.tests</artifactId>
+ <packaging>eclipse-test-plugin</packaging>
+
+ <name>ShellEd core test plugin</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <excludes>
+ <!-- test mojo matches TestProject be default and treats it as PojoTest -->
+ <exclude>**/Test*.class</exclude>
+ </excludes>
+ <testSuite>org.eclipse.dltk.sh.core.tests</testSuite>
+ <testClass>org.eclipse.dltk.sh.core.tests.AllTests</testClass>
+ <useUIHarness>true</useUIHarness>
+ <useUIThread>true</useUIThread>
+ <product>org.eclipse.platform.ide</product>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/org.eclipse.dltk.sh.core.tests/src/org/eclipse/dltk/sh/core/parser/tests/ShellScriptSourceParserTest.java b/org.eclipse.dltk.sh.core.tests/src/org/eclipse/dltk/sh/core/parser/tests/ShellScriptSourceParserTest.java
new file mode 100644
index 0000000..0354abb
--- /dev/null
+++ b/org.eclipse.dltk.sh.core.tests/src/org/eclipse/dltk/sh/core/parser/tests/ShellScriptSourceParserTest.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.core.parser.tests;
+
+import static org.junit.Assert.*;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class ShellScriptSourceParserTest {
+
+ @Test @Ignore
+ public void testParse() {
+ fail("Not yet implemented");
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.core.tests/src/org/eclipse/dltk/sh/core/tests/AllTests.java b/org.eclipse.dltk.sh.core.tests/src/org/eclipse/dltk/sh/core/tests/AllTests.java
new file mode 100644
index 0000000..eebcffd
--- /dev/null
+++ b/org.eclipse.dltk.sh.core.tests/src/org/eclipse/dltk/sh/core/tests/AllTests.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.core.tests;
+
+import org.eclipse.dltk.sh.core.parser.tests.ShellScriptSourceParserTest;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({ ShellScriptSourceParserTest.class })
+public class AllTests {
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.core/.classpath b/org.eclipse.dltk.sh.core/.classpath
new file mode 100644
index 0000000..b1b7be1
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <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="classes"/>
+</classpath>
diff --git a/org.eclipse.dltk.sh.core/.project b/org.eclipse.dltk.sh.core/.project
new file mode 100644
index 0000000..8672feb
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.dltk.sh.core</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>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.dltk.sh.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.dltk.sh.core/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..ead8b85
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,101 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/org.eclipse.dltk.sh.core/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.dltk.sh.core/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..1ac3402
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,54 @@
+#Tue Dec 15 22:12:26 EET 2009
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/org.eclipse.dltk.sh.core/.settings/org.moreunit.prefs b/org.eclipse.dltk.sh.core/.settings/org.moreunit.prefs
new file mode 100644
index 0000000..25b17c3
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/.settings/org.moreunit.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.moreunit.package_suffix=tests
+org.moreunit.preferences.version=2
+org.moreunit.test_methodType=testMethodTypeNoPrefix
+org.moreunit.test_type=junit4
+org.moreunit.unitsourcefolder=org.eclipse.dltk.sh.core\:src\:org.eclipse.dltk.sh.core.tests\:src
+org.moreunit.useprojectsettings=true
diff --git a/org.eclipse.dltk.sh.core/META-INF/MANIFEST.MF b/org.eclipse.dltk.sh.core/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..b34096d
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ShellEd Core Plug-in
+Bundle-SymbolicName: org.eclipse.dltk.sh.core;singleton:=true
+Bundle-Version: 2.0.4.qualifier
+Bundle-Vendor: SourceForge
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.dltk.core;bundle-version="[4.0.0,6.0.0)"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.dltk.sh.core,
+ org.eclipse.dltk.sh.core.parser
diff --git a/org.eclipse.dltk.sh.core/build.properties b/org.eclipse.dltk.sh.core/build.properties
new file mode 100644
index 0000000..5f7cd40
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = classes/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/org.eclipse.dltk.sh.core/plugin.xml b/org.eclipse.dltk.sh.core/plugin.xml
new file mode 100644
index 0000000..81189e7
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/plugin.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+<extension id="nature" point="org.eclipse.core.resources.natures">
+ <runtime>
+ <run class="org.eclipse.dltk.sh.core.ShelledNature"/>
+ </runtime>
+ </extension>
+ <extension point="org.eclipse.core.contenttype.contentTypes">
+ <content-type
+ base-type="org.eclipse.core.runtime.text"
+ describer="org.eclipse.dltk.sh.core.ShelledContentDescriber"
+ file-extensions="sh,ash,bsh,bash,csh,ksh,zsh"
+ id="org.eclipse.dltk.sh.content-type"
+ name="Shell script content type"
+ priority="high" >
+ </content-type>
+ </extension>
+ <extension point="org.eclipse.dltk.core.language">
+ <language
+ class="org.eclipse.dltk.sh.core.ShellScriptLanguageToolkit"
+ nature="org.eclipse.dltk.sh.core.nature"
+ priority="0">
+ </language>
+ </extension>
+ <extension
+ point="org.eclipse.dltk.core.sourceElementParsers">
+ <parser
+ class="org.eclipse.dltk.sh.core.parser.ShelledSourceElementParser"
+ nature="org.eclipse.dltk.sh.core.nature"
+ priority="0">
+ </parser>
+ </extension>
+ <extension point="org.eclipse.dltk.core.sourceParsers">
+ <parserContribution
+ natureId="org.eclipse.dltk.sh.core.nature">
+ <parser
+ class="org.eclipse.dltk.sh.core.parser.ShellScriptSourceParserFactory"
+ description="Shell Script Source parser"
+ id="org.eclipse.dltk.sh.core.sourceParser"
+ name="sourceParser.name"
+ priority="0" />
+ </parserContribution>
+</extension>
+
+</plugin>
diff --git a/org.eclipse.dltk.sh.core/pom.xml b/org.eclipse.dltk.sh.core/pom.xml
new file mode 100644
index 0000000..cdbf58e
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/pom.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, Inc. and others
+
+ 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:
+ Red Hat Incorporated - initial implementation
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.dltk.sh</groupId>
+ <artifactId>parent</artifactId>
+ <version>2.0.4-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.dltk.sh.core</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>ShellEd Core plugin</name>
+</project>
diff --git a/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/ShellScriptLanguageToolkit.java b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/ShellScriptLanguageToolkit.java
new file mode 100644
index 0000000..907b539
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/ShellScriptLanguageToolkit.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.core;
+
+import org.eclipse.dltk.core.AbstractLanguageToolkit;
+import org.eclipse.dltk.core.IDLTKLanguageToolkit;
+
+public class ShellScriptLanguageToolkit extends AbstractLanguageToolkit {
+ private static ShellScriptLanguageToolkit toolkit;
+
+ public static IDLTKLanguageToolkit getDefault() {
+ if (toolkit == null) {
+ toolkit = new ShellScriptLanguageToolkit();
+ }
+ return toolkit;
+ }
+
+ @Override
+ public String getLanguageName() {
+ return "Shell Script";
+ }
+
+ @Override
+ public String getNatureId() {
+ return ShelledNature.SHELLED_NATURE;
+ }
+
+ @Override
+ public String getLanguageContentType() {
+ return "org.eclipse.dltk.sh.content-type";
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/ShelledContentDescriber.java b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/ShelledContentDescriber.java
new file mode 100644
index 0000000..c89e380
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/ShelledContentDescriber.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.core;
+
+import java.util.regex.Pattern;
+
+import org.eclipse.dltk.core.ScriptContentDescriber;
+
+public class ShelledContentDescriber extends ScriptContentDescriber {
+
+ protected static Pattern[] header_patterns = { Pattern.compile("^#!.*sh.*", Pattern.MULTILINE) };
+
+ @Override
+ protected Pattern[] getHeaderPatterns() {
+ return header_patterns;
+ }
+}
diff --git a/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/ShelledNature.java b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/ShelledNature.java
new file mode 100644
index 0000000..e9ef986
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/ShelledNature.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.core;
+
+import org.eclipse.dltk.core.ScriptNature;
+
+public class ShelledNature extends ScriptNature {
+
+ public static final String SHELLED_NATURE = "org.eclipse.dltk.sh.core.nature";
+
+}
diff --git a/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/FunctionInfo.java b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/FunctionInfo.java
new file mode 100644
index 0000000..6762c88
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/FunctionInfo.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.core.parser;
+
+import org.eclipse.dltk.compiler.IElementRequestor.MethodInfo;
+
+public class FunctionInfo extends MethodInfo {
+ public int declarationEnd;
+
+}
diff --git a/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellModel.java b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellModel.java
new file mode 100644
index 0000000..1603c93
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellModel.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.core.parser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.dltk.ast.declarations.FieldDeclaration;
+import org.eclipse.dltk.ast.declarations.MethodDeclaration;
+
+public class ShellModel {
+
+ private List<MethodDeclaration> functions;
+ private List<FieldDeclaration> variables;
+ private List<MethodDeclaration> statements;
+
+ public ShellModel() {
+ functions = new ArrayList<>();
+ variables = new ArrayList<>();
+ statements = new ArrayList<>();
+ }
+
+ public void addFunction(MethodDeclaration funtion) {
+ functions.add(funtion);
+ }
+
+ public List<MethodDeclaration> getFunctions() {
+ return functions;
+ }
+
+ public void addVariable(FieldDeclaration variable) {
+ variables.add(variable);
+ }
+
+ public List<FieldDeclaration> getVariables() {
+ return variables;
+ }
+
+ public void addStatement(MethodDeclaration statement) {
+ statements.add(statement);
+ }
+
+ public List<MethodDeclaration> getStatements() {
+ return statements;
+ }
+}
diff --git a/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellModuleDeclaration.java b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellModuleDeclaration.java
new file mode 100644
index 0000000..5494ea4
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellModuleDeclaration.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.core.parser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.dltk.ast.declarations.FieldDeclaration;
+import org.eclipse.dltk.ast.declarations.MethodDeclaration;
+import org.eclipse.dltk.ast.declarations.ModuleDeclaration;
+import org.eclipse.dltk.compiler.IElementRequestor.FieldInfo;
+
+public class ShellModuleDeclaration extends ModuleDeclaration {
+
+ private List<FunctionInfo> functionsInfo;
+ private List<FieldInfo> variablesInfo;
+
+ public ShellModuleDeclaration(int sourceLength) {
+ super(sourceLength);
+ functionsInfo = new ArrayList<>();
+ variablesInfo = new ArrayList<>();
+ }
+
+ public void setFunctions(List<MethodDeclaration> functions) {
+ getFunctionList().addAll(functions);
+ for (MethodDeclaration method : functions) {
+ FunctionInfo mInfo = new FunctionInfo();
+ mInfo.name = method.getName();
+ mInfo.nameSourceStart = method.getNameStart();
+ mInfo.nameSourceEnd = method.getNameEnd();
+ mInfo.declarationStart = method.sourceStart();
+ mInfo.declarationEnd = method.sourceEnd();
+ functionsInfo.add(mInfo);
+ }
+ }
+
+ public void setVariables(List<FieldDeclaration> variables) {
+ getVariablesList().addAll(variables);
+ for (FieldDeclaration method : variables) {
+ FieldInfo vInfo = new FieldInfo();
+ vInfo.name = method.getName();
+ vInfo.nameSourceStart = method.getNameStart();
+ vInfo.nameSourceEnd = method.getNameEnd();
+ vInfo.declarationStart = method.sourceStart();
+ variablesInfo.add(vInfo);
+ }
+ }
+
+ public List<FunctionInfo> getFunctionsInfo() {
+ return functionsInfo;
+ }
+
+ public List<FieldInfo> getFieldsInfo() {
+ return variablesInfo;
+ }
+}
diff --git a/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellScriptSourceParser.java b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellScriptSourceParser.java
new file mode 100644
index 0000000..425674d
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellScriptSourceParser.java
@@ -0,0 +1,236 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.core.parser;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Stack;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.dltk.ast.declarations.Declaration;
+import org.eclipse.dltk.ast.declarations.FieldDeclaration;
+import org.eclipse.dltk.ast.declarations.MethodDeclaration;
+import org.eclipse.dltk.ast.declarations.ModuleDeclaration;
+import org.eclipse.dltk.ast.expressions.MethodCallExpression;
+import org.eclipse.dltk.ast.parser.AbstractSourceParser;
+import org.eclipse.dltk.ast.parser.IModuleDeclaration;
+import org.eclipse.dltk.ast.references.VariableReference;
+import org.eclipse.dltk.compiler.env.IModuleSource;
+import org.eclipse.dltk.compiler.problem.IProblemReporter;
+
+public class ShellScriptSourceParser extends AbstractSourceParser {
+
+ private static ShellModel parse(StringReader reader, ShellModuleDeclaration moduleDeclaration) {
+ ShellModel model = new ShellModel();
+
+ String line;
+ int lineStart = 0;
+ int commentLength = 0;
+ Set<String> functionNames = new HashSet<>();
+ Set<String> varNames = new HashSet<>();
+ MethodDeclaration mDeclaration = null;
+ Stack<Declaration> tmp = new Stack<>();
+ boolean isPrevLnContinued = false;
+
+ try (BufferedReader bReader = new BufferedReader(reader)) {
+ while ((line = bReader.readLine()) != null) {
+ if (line.trim().length() == 0 || line.trim().charAt(0) == '#') {
+ lineStart += line.length() + 1;
+ continue;
+ }
+ if (line.contains("#")) {
+ commentLength = line.substring(line.indexOf('#')).length();
+ line = line.substring(0, line.indexOf('#'));
+ }
+ if (line.contains("()")) {
+ int lBracket = line.indexOf('{') == -1 ? 0 : line.indexOf('{');
+ int fPlusEight = line.indexOf("function") == -1 ? 0 : line.indexOf("function") + 8;
+ mDeclaration = new MethodDeclaration(line.substring(fPlusEight, line.indexOf('(')).trim(),
+ lineStart, lineStart + line.length() - 1, lBracket + lineStart, lBracket + lineStart);
+ functionNames.add(line.substring(fPlusEight, line.indexOf('(')).trim());
+ tmp.push(mDeclaration);
+ model.addFunction(mDeclaration);
+ } else if (line.contains("function ")) {
+ int fPlusEight = line.indexOf("function") + 8;
+ int lBracket = line.indexOf('{') == -1 ? line.length() : line.indexOf('{') - 1;
+ if (fPlusEight >= line.length())
+ continue;
+ if (fPlusEight > lBracket)
+ continue;
+ mDeclaration = new MethodDeclaration(line.substring(fPlusEight, lBracket).trim(), lineStart,
+ lineStart + line.length() - 1, lBracket + lineStart, lBracket + lineStart);
+ functionNames.add(line.substring(fPlusEight, lBracket).trim());
+ tmp.push(mDeclaration);
+ model.addFunction(mDeclaration);
+ } else if (line.trim().equals("}")) {
+ if (mDeclaration != null) {
+ if (!tmp.isEmpty()) {
+ mDeclaration = (MethodDeclaration) tmp.pop();
+ mDeclaration.setEnd(lineStart + line.length());
+ }
+ }
+ }
+ Pattern assignmentPattern = Pattern.compile("(^|\\W)\\w*=");
+ Matcher matcher = assignmentPattern.matcher(line);
+ if (matcher.find()) {
+ String varName = line.substring(matcher.start(), matcher.end() - 1);
+ if (isValidName(varName)) {
+ FieldDeclaration variable = new FieldDeclaration(varName, lineStart + matcher.start(),
+ lineStart + matcher.end(), lineStart + matcher.start(), lineStart + matcher.end());
+ varNames.add(varName);
+ model.addVariable(variable);
+ }
+ }
+
+ // start of if statement
+ if (line.contains("if ") && !line.contains("elif ")) {
+ mDeclaration = new MethodDeclaration(line.substring(0, line.length()).trim(),
+ lineStart + line.indexOf("if"), lineStart + line.length() - 1, lineStart,
+ lineStart + line.length());
+ model.addStatement(mDeclaration);
+ tmp.push(mDeclaration);
+
+ // end of if statement
+ } else if (line.trim().equals("fi")) {
+ if (!tmp.isEmpty()) {
+ mDeclaration = (MethodDeclaration) tmp.pop();
+ mDeclaration.setEnd(lineStart + line.indexOf("fi"));
+ }
+
+ // start of while statement
+ } else if (line.contains("while ")) {
+ mDeclaration = new MethodDeclaration(line.substring(0, line.length()).trim(),
+ lineStart + line.indexOf("while"), lineStart + line.length() - 1, lineStart,
+ lineStart + line.length());
+ model.addStatement(mDeclaration);
+ tmp.push(mDeclaration);
+
+ // start of until statement
+ } else if (line.contains("until ")) {
+ mDeclaration = new MethodDeclaration(line.substring(0, line.length()).trim(),
+ lineStart + line.indexOf("until"), lineStart + line.length() - 1, lineStart,
+ lineStart + line.length());
+ model.addStatement(mDeclaration);
+ tmp.push(mDeclaration);
+
+ // done statement encountered
+ } else if (line.contains("done ") || line.trim().equals("done")) {
+ if (!tmp.isEmpty()) {
+ mDeclaration = (MethodDeclaration) tmp.pop();
+ mDeclaration.setEnd(lineStart + line.indexOf("done"));
+ }
+
+ // start of for statement
+ } else if (line.contains("for ")) {
+ mDeclaration = new MethodDeclaration(line.substring(0, line.length()).trim(),
+ lineStart + line.indexOf("for"), lineStart + line.length() - 1, lineStart,
+ lineStart + line.length());
+ model.addStatement(mDeclaration);
+ tmp.push(mDeclaration);
+
+ // start of case statement
+ } else if (line.contains("case ")) {
+ mDeclaration = new MethodDeclaration(line.substring(0, line.length()).trim(),
+ lineStart + line.indexOf("case"), lineStart + line.length() - 1, lineStart,
+ lineStart + line.length());
+ model.addStatement(mDeclaration);
+ tmp.push(mDeclaration);
+
+ // end of case statement
+ } else if (line.trim().equals("esac")) {
+ if (!tmp.isEmpty()) {
+ mDeclaration = (MethodDeclaration) tmp.pop();
+ mDeclaration.setEnd(lineStart + line.indexOf("esac"));
+ }
+ }
+
+ // multi-line commands and literals
+ if (line.charAt(line.length() - 1) == '\\' && !isPrevLnContinued) {
+ isPrevLnContinued = true;
+ mDeclaration = new MethodDeclaration(line.substring(0, line.length()).trim(),
+ lineStart + line.indexOf("\\"), lineStart + line.length() - 1, lineStart,
+ lineStart + line.length());
+ tmp.push(mDeclaration);
+ model.addStatement(mDeclaration);
+ } else if (line.charAt(line.length() - 1) == '\\' && isPrevLnContinued) {
+ if (!tmp.isEmpty()) {
+ mDeclaration = (MethodDeclaration) tmp.pop();
+ mDeclaration.setEnd(lineStart + line.indexOf('\\'));
+ tmp.push(mDeclaration);
+ }
+ } else if (isPrevLnContinued) {
+ isPrevLnContinued = false;
+ if (!tmp.isEmpty()) {
+ mDeclaration = (MethodDeclaration) tmp.pop();
+ mDeclaration.setEnd(lineStart + line.length() - 2);
+ }
+ }
+
+ for (String funcName : functionNames) {
+ if (line.contains(funcName)) {
+ moduleDeclaration.addStatement(new MethodCallExpression(lineStart + line.indexOf(funcName),
+ lineStart + line.indexOf(funcName) + funcName.length(), null, funcName, null));
+ }
+ }
+ for (String varName : varNames) {
+ Pattern varRefPattern = Pattern.compile("(^|\\W)\\$\\b" + varName + "\\b");
+ Matcher varRefMatcher = varRefPattern.matcher(line);
+ while (varRefMatcher.find()) {
+ moduleDeclaration.addStatement(new VariableReference(lineStart + varRefMatcher.start(),
+ lineStart + varRefMatcher.end(), varName));
+ }
+ }
+
+ lineStart += line.length() + commentLength + 1;
+ commentLength = 0;
+ }
+ bReader.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return model;
+ }
+
+ private static boolean isValidName(String varName) {
+ if (varName.matches("\\w+")) {
+ return true;
+ }
+ return false;
+ }
+
+ private static void processNode(ShellModel parse, ModuleDeclaration moduleDeclaration) {
+ for (MethodDeclaration functionNode : parse.getFunctions()) {
+ moduleDeclaration.addStatement(functionNode);
+ }
+ for (FieldDeclaration variableNode : parse.getVariables()) {
+ moduleDeclaration.addStatement(variableNode);
+ }
+ for (MethodDeclaration statement : parse.getStatements()) {
+ moduleDeclaration.addStatement(statement);
+ }
+ }
+
+ @Override
+ public IModuleDeclaration parse(IModuleSource source, IProblemReporter arg1) {
+ ShellModuleDeclaration moduleDeclaration = new ShellModuleDeclaration(source.getSourceContents().length());
+
+ ShellModel shellModel = parse(new StringReader(source.getSourceContents()), moduleDeclaration);
+ moduleDeclaration.setFunctions(shellModel.getFunctions());
+ moduleDeclaration.setVariables(shellModel.getVariables());
+ processNode(shellModel, moduleDeclaration);
+ return moduleDeclaration;
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellScriptSourceParserFactory.java b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellScriptSourceParserFactory.java
new file mode 100644
index 0000000..af1699f
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShellScriptSourceParserFactory.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.core.parser;
+
+import org.eclipse.dltk.ast.parser.ISourceParser;
+import org.eclipse.dltk.ast.parser.ISourceParserFactory;
+
+public class ShellScriptSourceParserFactory implements ISourceParserFactory {
+
+ @Override
+ public ISourceParser createSourceParser() {
+ return new ShellScriptSourceParser();
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShelledSourceElementParser.java b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShelledSourceElementParser.java
new file mode 100644
index 0000000..4880f98
--- /dev/null
+++ b/org.eclipse.dltk.sh.core/src/org/eclipse/dltk/sh/core/parser/ShelledSourceElementParser.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.core.parser;
+
+import org.eclipse.dltk.compiler.IElementRequestor.FieldInfo;
+import org.eclipse.dltk.compiler.IElementRequestor.TypeInfo;
+import org.eclipse.dltk.compiler.ISourceElementRequestor;
+import org.eclipse.dltk.compiler.env.IModuleSource;
+import org.eclipse.dltk.core.AbstractSourceElementParser;
+import org.eclipse.dltk.sh.core.ShelledNature;
+
+public class ShelledSourceElementParser extends AbstractSourceElementParser {
+
+ @Override
+ protected String getNatureId() {
+ return ShelledNature.SHELLED_NATURE;
+ }
+
+ @Override
+ public void parseSourceModule(IModuleSource module) {
+ final ShellModuleDeclaration moduleDeclaration = (ShellModuleDeclaration) parse(module);
+
+ ISourceElementRequestor requestor = getRequestor();
+
+ requestor.enterModule();
+ TypeInfo tInfo = new TypeInfo();
+ tInfo.name = module.getModelElement().getElementName();
+ requestor.enterType(tInfo);
+ for (FunctionInfo method : moduleDeclaration.getFunctionsInfo()) {
+ requestor.enterMethod(method);
+ requestor.exitMethod(method.declarationEnd);
+ }
+ for (FieldInfo variable : moduleDeclaration.getFieldsInfo()) {
+ requestor.enterField(variable);
+ requestor.exitMethod(variable.nameSourceEnd);
+ }
+ requestor.exitType(module.getSourceContents().length());
+ requestor.exitModule(module.getSourceContents().length());
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.doc/.project b/org.eclipse.dltk.sh.doc/.project
new file mode 100644
index 0000000..1b35b53
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/.project
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.dltk.sh.doc</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <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.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.dltk.sh.doc/META-INF/MANIFEST.MF b/org.eclipse.dltk.sh.doc/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..a5db99d
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ShellEd Documentation Plug-in
+Bundle-SymbolicName: org.eclipse.dltk.sh.doc;singleton:=true
+Bundle-Version: 2.0.4.qualifier
+Bundle-Vendor: SourceForge
+Require-Bundle: org.eclipse.help
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.dltk.sh.doc/build.properties b/org.eclipse.dltk.sh.doc/build.properties
new file mode 100644
index 0000000..71758b5
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/build.properties
@@ -0,0 +1,4 @@
+bin.includes = plugin.xml,\
+ META-INF/,\
+ userguide/,\
+ *.xml
diff --git a/org.eclipse.dltk.sh.doc/plugin.xml b/org.eclipse.dltk.sh.doc/plugin.xml
new file mode 100644
index 0000000..0103ff0
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/plugin.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="userguide/Introduction-toc.xml"
+ primary="true">
+ </toc>
+ </extension>
+
+</plugin>
diff --git a/org.eclipse.dltk.sh.doc/pom.xml b/org.eclipse.dltk.sh.doc/pom.xml
new file mode 100644
index 0000000..35fda35
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/pom.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, Inc. and others
+
+ 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:
+ Red Hat Incorporated - initial implementation
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.dltk.sh</groupId>
+ <artifactId>parent</artifactId>
+ <version>2.0.4-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.dltk.sh.doc</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>ShellEd Doc plugin</name>
+</project>
diff --git a/org.eclipse.dltk.sh.doc/userguide/Add-Support-Screenshot.png b/org.eclipse.dltk.sh.doc/userguide/Add-Support-Screenshot.png
new file mode 100644
index 0000000..d1b4a96
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/userguide/Add-Support-Screenshot.png
Binary files differ
diff --git a/org.eclipse.dltk.sh.doc/userguide/Getting-Started.html b/org.eclipse.dltk.sh.doc/userguide/Getting-Started.html
new file mode 100644
index 0000000..e84bb97
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/userguide/Getting-Started.html
@@ -0,0 +1,104 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Shell Script Editor User Guide - Getting Started</title>
+ </head>
+ <body>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <th style="width: 100%" align="center" colspan="3">Getting Started</th>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Introduction.html" title="Introduction">
+ <img alt="Previous" border="0" src="images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right">
+ <a href="Updating-This-Guide.html" title="Updating This Guide">
+ <img alt="Next" border="0" src="images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Introduction</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Updating This Guide</td>
+ </tr>
+ </table><hr/>
+ <h1 id="GettingStarted">Getting Started</h1>
+ <h2 id="ConfiguringanInterpreter">Configuring an Interpreter</h2>
+ <p>To verify that Eclipse is set up correctly for Shell Script development you need to make sure that an interpreter is configured. Select the menu item
+ <b>Window</b> -&gt;
+ <b>Preferences</b> to open the workbench preferences. Then choose the
+ <b>Shell Script</b> -&gt;
+ <b>Interpreters</b> preference page to show the current interpreter configuration.
+ </p>
+ <p>
+ <img border="0" src="Interps-Empty-Screenshot.png"/>
+ </p>
+ <p>If there are no interpreters listed, you may add an interpreter manually by pressing the
+ <b>Add</b> button, or let ShellEd try to automatically discover interpreters by pressing the
+ <b>Search</b> button. Once you have added one or more interpreters, you may select which interpreter to use by default by checking the box next to the interpreter's name.
+ </p>
+ <p>
+ <img border="0" src="Interps-Full-Screenshot.png"/>
+ </p>
+ <h2 id="NewShellScriptProject">New Shell Script Project</h2>
+ <p>To create a new shell script project, select the menu item
+ <b>File</b> -&gt;
+ <b>New</b> -&gt;
+ <b>Project</b> and select
+ <b>Shell Script Project</b> from the list of available project types.
+ </p>
+ <p>
+ <img border="0" src="New-Project-Screenshot.png"/>
+ </p>
+ <p>On the next page, you will be asked to choose a name and location for the project and to choose an interpreter.</p>
+ <p>
+ <img border="0" src="Project-Wizard-Screenshot.png"/>
+ </p>
+ <p>If there are no interpreters configured in ShellEd, it will say that your default interpreter is "currently undefined." You will still be allowed to create the project, but you will not be able to run or debug your shell scripts. It is highly recommended that you configure at least one interpreter and you may do so at this point by clicking the
+ <b>Configure Interpreters</b> link, which will take you to the preferences page described in the
+ <a href="Getting-Started.html#ConfiguringanInterpreter">previous section</a>.
+ </p>
+ <p>After clicking the
+ <b>Finish</b> button, the newly created shell script project will be visible in the
+ <b>Project Explorer</b> type views.
+ </p>
+ <h2 id="ExistingProjects">Existing Projects</h2>
+ <p>You probably have shell scripts in other projects that you want to run and debug. In this case, you can add shell script support to existing, non-shell script projects by right-clicking them and choosing the
+ <b>ShellEd</b> -&gt;
+ <b>Add Shell Script Support</b> menu item.
+ </p>
+ <p>
+ <img border="0" src="Add-Support-Screenshot.png"/>
+ </p><hr/>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Introduction.html" title="Introduction">
+ <img alt="Previous" border="0" src="images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center">
+ <a href="Introduction.html" title="Shell Script Editor User Guide">
+ <img alt="Shell Script Editor User Guide" border="0" src="images/home.gif"/>
+ </a>
+ </td>
+ <td style="width: 20%" align="right">
+ <a href="Updating-This-Guide.html" title="Updating This Guide">
+ <img alt="Next" border="0" src="images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Introduction</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Updating This Guide</td>
+ </tr>
+ </table>
+ </body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.doc/userguide/Interps-Empty-Screenshot.png b/org.eclipse.dltk.sh.doc/userguide/Interps-Empty-Screenshot.png
new file mode 100644
index 0000000..7bb22e8
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/userguide/Interps-Empty-Screenshot.png
Binary files differ
diff --git a/org.eclipse.dltk.sh.doc/userguide/Interps-Full-Screenshot.png b/org.eclipse.dltk.sh.doc/userguide/Interps-Full-Screenshot.png
new file mode 100644
index 0000000..7da0835
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/userguide/Interps-Full-Screenshot.png
Binary files differ
diff --git a/org.eclipse.dltk.sh.doc/userguide/Intro-Screenshot.png b/org.eclipse.dltk.sh.doc/userguide/Intro-Screenshot.png
new file mode 100644
index 0000000..b6fdd50
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/userguide/Intro-Screenshot.png
Binary files differ
diff --git a/org.eclipse.dltk.sh.doc/userguide/Introduction-toc.xml b/org.eclipse.dltk.sh.doc/userguide/Introduction-toc.xml
new file mode 100644
index 0000000..16c6bbb
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/userguide/Introduction-toc.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<toc topic="userguide/Introduction.html" label="Shell Script Editor User Guide">
+ <topic href="userguide/Introduction.html" label="Introduction"></topic>
+ <topic href="userguide/Getting-Started.html" label="Getting Started">
+ <topic href="userguide/Getting-Started.html#ConfiguringanInterpreter" label="Configuring an Interpreter"></topic>
+ <topic href="userguide/Getting-Started.html#NewShellScriptProject" label="New Shell Script Project"></topic>
+ <topic href="userguide/Getting-Started.html#ExistingProjects" label="Existing Projects"></topic>
+ </topic>
+ <topic href="userguide/Updating-This-Guide.html" label="Updating This Guide"></topic>
+</toc> \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.doc/userguide/Introduction.html b/org.eclipse.dltk.sh.doc/userguide/Introduction.html
new file mode 100644
index 0000000..94193f5
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/userguide/Introduction.html
@@ -0,0 +1,50 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Shell Script Editor User Guide</title>
+ </head>
+ <body>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <th style="width: 100%" align="center" colspan="3">Shell Script Editor User Guide</th>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left"></td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right">
+ <a href="Getting-Started.html" title="Getting Started">
+ <img alt="Next" border="0" src="images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top"></td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Getting Started</td>
+ </tr>
+ </table><hr/>
+ <h1 id="Introduction">Introduction</h1>
+ <p>ShellEd is a superb shell script editor for Eclipse. The great benefits of this plug-in are the integration of man page information for content assist/hover help and the ability to run your project's shell scripts without having to leave Eclipse to start up a terminal.</p>
+ <p>It also comes with all the features you'd expect from a full-featured Eclipse code editor such as syntax highlighting, code-folding and outline view.</p>
+ <p>
+ <img border="0" src="Intro-Screenshot.png"/>
+ </p><hr/>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <td style="width: 20%" align="left"></td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right">
+ <a href="Getting-Started.html" title="Getting Started">
+ <img alt="Next" border="0" src="images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top"></td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Getting Started</td>
+ </tr>
+ </table>
+ </body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.doc/userguide/New-Project-Screenshot.png b/org.eclipse.dltk.sh.doc/userguide/New-Project-Screenshot.png
new file mode 100644
index 0000000..906e757
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/userguide/New-Project-Screenshot.png
Binary files differ
diff --git a/org.eclipse.dltk.sh.doc/userguide/Project-Wizard-Screenshot.png b/org.eclipse.dltk.sh.doc/userguide/Project-Wizard-Screenshot.png
new file mode 100644
index 0000000..22d442a
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/userguide/Project-Wizard-Screenshot.png
Binary files differ
diff --git a/org.eclipse.dltk.sh.doc/userguide/Updating-This-Guide.html b/org.eclipse.dltk.sh.doc/userguide/Updating-This-Guide.html
new file mode 100644
index 0000000..7986be8
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/userguide/Updating-This-Guide.html
@@ -0,0 +1,54 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Shell Script Editor User Guide - Updating This Guide</title>
+ </head>
+ <body>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <th style="width: 100%" align="center" colspan="3">Updating This Guide</th>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Getting-Started.html" title="Getting Started">
+ <img alt="Previous" border="0" src="images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right"></td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Getting Started</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top"></td>
+ </tr>
+ </table><hr/>
+ <h1 id="UpdatingThisGuide">Updating This Guide</h1>
+ <p>This user's guide is maintained in a collaborative wiki. We would welcome any corrections or additions to this document, so if you wish to make any changes for inclusion in the next release of ShellEd, please visit the following URL:</p>
+ <p>
+ TODO: CREATE in Eclipse WIKI.
+ </p>
+ <p>Note that you'll need to sign in with your SourceForge account before editing the wiki.</p><hr/>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Getting-Started.html" title="Getting Started">
+ <img alt="Previous" border="0" src="images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center">
+ <a href="Introduction.html" title="Shell Script Editor User Guide">
+ <img alt="Shell Script Editor User Guide" border="0" src="images/home.gif"/>
+ </a>
+ </td>
+ <td style="width: 20%" align="right"></td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Getting Started</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top"></td>
+ </tr>
+ </table>
+ </body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.doc/userguide/images/home.gif b/org.eclipse.dltk.sh.doc/userguide/images/home.gif
new file mode 100644
index 0000000..4472e8c
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/userguide/images/home.gif
Binary files differ
diff --git a/org.eclipse.dltk.sh.doc/userguide/images/next.gif b/org.eclipse.dltk.sh.doc/userguide/images/next.gif
new file mode 100644
index 0000000..e2f8c3e
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/userguide/images/next.gif
Binary files differ
diff --git a/org.eclipse.dltk.sh.doc/userguide/images/prev.gif b/org.eclipse.dltk.sh.doc/userguide/images/prev.gif
new file mode 100644
index 0000000..4fb4150
--- /dev/null
+++ b/org.eclipse.dltk.sh.doc/userguide/images/prev.gif
Binary files differ
diff --git a/org.eclipse.dltk.sh.feature/.project b/org.eclipse.dltk.sh.feature/.project
new file mode 100644
index 0000000..e206f16
--- /dev/null
+++ b/org.eclipse.dltk.sh.feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.dltk.sh.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.dltk.sh.feature/build.properties b/org.eclipse.dltk.sh.feature/build.properties
new file mode 100644
index 0000000..b3a611b
--- /dev/null
+++ b/org.eclipse.dltk.sh.feature/build.properties
@@ -0,0 +1,2 @@
+bin.includes = feature.xml,\
+ feature.properties
diff --git a/org.eclipse.dltk.sh.feature/feature.properties b/org.eclipse.dltk.sh.feature/feature.properties
new file mode 100644
index 0000000..bda44c7
--- /dev/null
+++ b/org.eclipse.dltk.sh.feature/feature.properties
@@ -0,0 +1,12 @@
+# "description" property - description of the feature
+description=Shell Script Editor for Eclipse
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2014 Red Hat Inc and others.\n\
+\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http://www.eclipse.org/legal/epl-v10.html\n
+################ end of copyright property ####################################
diff --git a/org.eclipse.dltk.sh.feature/feature.xml b/org.eclipse.dltk.sh.feature/feature.xml
new file mode 100644
index 0000000..5e84749
--- /dev/null
+++ b/org.eclipse.dltk.sh.feature/feature.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.dltk.sh.feature"
+ label="ShellEd"
+ version="2.0.4.qualifier"
+ provider-name="ShellEd Project"
+ license-feature="org.eclipse.license"
+ license-feature-version="0.0.0">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <url>
+ <discovery label="Linux Tools" url="http://download.eclipse.org/linuxtools/update"/>
+ </url>
+
+ <plugin
+ id="org.eclipse.dltk.sh.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.dltk.sh.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.dltk.sh.doc"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.man.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/org.eclipse.dltk.sh.feature/pom.xml b/org.eclipse.dltk.sh.feature/pom.xml
new file mode 100644
index 0000000..bf5b3f5
--- /dev/null
+++ b/org.eclipse.dltk.sh.feature/pom.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, 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
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.dltk.sh</groupId>
+ <artifactId>parent</artifactId>
+ <version>2.0.4-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.dltk.sh.feature</artifactId>
+ <packaging>eclipse-feature</packaging>
+
+ <name>ShellEd Feature</name>
+
+</project>
diff --git a/org.eclipse.dltk.sh.site/category.xml b/org.eclipse.dltk.sh.site/category.xml
new file mode 100644
index 0000000..ba33e4c
--- /dev/null
+++ b/org.eclipse.dltk.sh.site/category.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<site>
+ <description>
+ ShellEd p2 repo.
+ </description>
+ <feature url="features/org.eclipse.dltk.sh.feature_0.0.0.qualifier.jar" id="org.eclipse.dltk.sh.feature" version="0.0.0">
+ <category name="Shell Script"/>
+ </feature>
+ <category-def name="Shell Script" label="Shell Script">
+ <description>
+ Shell Script
+ </description>
+ </category-def>
+</site>
diff --git a/org.eclipse.dltk.sh.site/pom.xml b/org.eclipse.dltk.sh.site/pom.xml
new file mode 100644
index 0000000..e183c3b
--- /dev/null
+++ b/org.eclipse.dltk.sh.site/pom.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, Inc. and others
+
+ 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:
+ Red Hat Incorporated - initial implementation
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.dltk.sh</groupId>
+ <artifactId>parent</artifactId>
+ <version>2.0.4-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.dltk.sh.site</artifactId>
+ <packaging>eclipse-repository</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-publisher-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <publishArtifacts>true</publishArtifacts>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <name>ShellEd p2 Repository </name>
+</project>
diff --git a/org.eclipse.dltk.sh.target/.project b/org.eclipse.dltk.sh.target/.project
new file mode 100644
index 0000000..d8a2a79
--- /dev/null
+++ b/org.eclipse.dltk.sh.target/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.dltk.sh.target</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.dltk.sh.target/org.eclipse.dltk.sh.target.target b/org.eclipse.dltk.sh.target/org.eclipse.dltk.sh.target.target
new file mode 100644
index 0000000..c89009c
--- /dev/null
+++ b/org.eclipse.dltk.sh.target/org.eclipse.dltk.sh.target.target
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.8"?><target name="shelled" sequenceNumber="2">
+<locations>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.dltk.core.feature.group" version="0.0.0"/>
+<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
+<repository location="http://download.eclipse.org/releases/mars/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.linuxtools.man.feature.group" version="0.0.0"/>
+<repository location="http://download.eclipse.org/linuxtools/update"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.license.feature.group" version="0.0.0"/>
+<repository location="http://download.eclipse.org/cbi/updates/license"/>
+</location>
+</locations>
+<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+</target>
diff --git a/org.eclipse.dltk.sh.target/pom.xml b/org.eclipse.dltk.sh.target/pom.xml
new file mode 100644
index 0000000..f2a03ee
--- /dev/null
+++ b/org.eclipse.dltk.sh.target/pom.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, Inc. and others
+
+ 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:
+ Red Hat Incorporated - initial implementation
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.dltk.sh</groupId>
+ <artifactId>parent</artifactId>
+ <version>2.0.4-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.dltk.sh.target</artifactId>
+ <packaging>eclipse-target-definition</packaging>
+
+ <name>ShellEd target definition</name>
+</project>
diff --git a/org.eclipse.dltk.sh.ui.tests/.classpath b/org.eclipse.dltk.sh.ui.tests/.classpath
new file mode 100644
index 0000000..eca7bdb
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <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>
diff --git a/org.eclipse.dltk.sh.ui.tests/.project b/org.eclipse.dltk.sh.ui.tests/.project
new file mode 100644
index 0000000..06c0601
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.dltk.sh.ui.tests</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>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.dltk.sh.ui.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.dltk.sh.ui.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..091b39b
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,113 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/org.eclipse.dltk.sh.ui.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.dltk.sh.ui.tests/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..1bca2f0
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,54 @@
+#Fri Dec 11 14:15:17 EET 2009
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/org.eclipse.dltk.sh.ui.tests/META-INF/MANIFEST.MF b/org.eclipse.dltk.sh.ui.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..3c0f731
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Tests for the ShellEd UI plugin
+Bundle-SymbolicName: org.eclipse.dltk.sh.ui.tests
+Bundle-Version: 2.0.4.qualifier
+Require-Bundle: org.junit;bundle-version="4.10.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Fragment-Host: org.eclipse.dltk.sh.ui
diff --git a/org.eclipse.dltk.sh.ui.tests/build.properties b/org.eclipse.dltk.sh.ui.tests/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/org.eclipse.dltk.sh.ui.tests/pom.xml b/org.eclipse.dltk.sh.ui.tests/pom.xml
new file mode 100644
index 0000000..93f52fa
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/pom.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, 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
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.dltk.sh</groupId>
+ <artifactId>parent</artifactId>
+ <version>2.0.4-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.dltk.sh.ui.tests</artifactId>
+ <version>2.0.4-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+
+ <name>ShellEd UI test plugin</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <excludes>
+ <!-- test mojo matches TestProject be default and treats it as PojoTest -->
+ <exclude>**/Test*.class</exclude>
+ </excludes>
+ <testSuite>org.eclipse.dltk.sh.ui.tests</testSuite>
+ <testClass>org.eclipse.dltk.sh.ui.tests.AllTests</testClass>
+ <useUIHarness>true</useUIHarness>
+ <useUIThread>true</useUIThread>
+ <product>org.eclipse.platform.ide</product>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/tests/AllTests.java b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/tests/AllTests.java
new file mode 100644
index 0000000..e05d387
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/tests/AllTests.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.tests;
+
+import org.eclipse.dltk.sh.ui.text.tests.TextSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * All tests wrapper.
+ *
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({ TextSuite.class })
+public class AllTests {
+}
diff --git a/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/AbstractScannerTester.java b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/AbstractScannerTester.java
new file mode 100644
index 0000000..14a2818
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/AbstractScannerTester.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Mat Booth and others.
+ * 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
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text.tests;
+
+import org.eclipse.dltk.internal.ui.text.DLTKColorManager;
+import org.eclipse.dltk.ui.text.IColorManager;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+import org.junit.Before;
+
+/**
+ * Common base class for rules-based scanner tests.
+ */
+@SuppressWarnings("restriction")
+public abstract class AbstractScannerTester {
+
+ protected IColorManager cm = new DLTKColorManager();
+ protected RuleBasedScanner scanner;
+
+ /**
+ * Reset the scanner before every test.
+ */
+ @Before
+ public void setup() {
+ scanner = getScanner();
+ scanner.setRange(new Document(getText()), 0, getText().length());
+ }
+
+ /**
+ * To be implemented by the test.
+ *
+ * @return an instance of the scanner under test
+ */
+ protected abstract RuleBasedScanner getScanner();
+
+ /**
+ * To be implemented by the test.
+ *
+ * @return the text that will be used to test the scanner
+ */
+ protected abstract String getText();
+
+ /**
+ * Gets the nth token from the scanner's document.
+ *
+ * @param n
+ * 1 for the very next token, 2 for the token after that, etc
+ * @return the nth token
+ */
+ protected IToken getNthToken(int n) {
+ for (int i = 0; i < n - 1; i++) {
+ scanner.nextToken();
+ }
+ return scanner.nextToken();
+ }
+
+ /**
+ * Gets the very next token from the scanner's document.
+ *
+ * @return the next token
+ */
+ protected IToken getNextToken() {
+ return getNthToken(1);
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/AssignmentRuleTest.java b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/AssignmentRuleTest.java
new file mode 100644
index 0000000..8d2dff1
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/AssignmentRuleTest.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Mat Booth and others.
+ * 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:
+ * Mat Booth
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text.tests;
+
+import org.eclipse.dltk.sh.ui.text.AssignmentDetector;
+import org.eclipse.dltk.sh.ui.text.AssignmentRule;
+import org.eclipse.dltk.sh.ui.text.IShellPartitions;
+import org.eclipse.jface.text.rules.Token;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Tests the assignment rule that detects variable assignments.
+ */
+public class AssignmentRuleTest {
+
+ // Mock objects
+ private MockScanner fScanner;
+
+ // Objects under test
+ private static AssignmentRule fRule = new AssignmentRule(new AssignmentDetector(),
+ Token.UNDEFINED, new Token(IShellPartitions.PARAM_CONTENT_TYPE));
+
+ /**
+ * Match simple variable assignments.
+ */
+ @Test
+ public void testAssignmentMatch() {
+ fScanner = new MockScanner("VAR=assignment");
+ Assert.assertFalse(fRule.evaluate(fScanner).isUndefined());
+ Assert.assertEquals("VAR", fScanner.getBuffer().substring(0, fScanner.getOffset()));
+ }
+
+ /**
+ * Match assignments to shell array variable indexes.
+ */
+ @Test
+ public void testArrayIndexAssignmentMatch() {
+ fScanner = new MockScanner("VAR[2]=assignment");
+ Assert.assertFalse(fRule.evaluate(fScanner).isUndefined());
+ Assert.assertEquals("VAR[2]", fScanner.getBuffer().substring(0, fScanner.getOffset()));
+ }
+
+ /**
+ * The equals MUST immediately follow the var-name, otherwise don't match.
+ */
+ @Test
+ public void testNonAssignmentMatch() {
+ fScanner = new MockScanner("VAR = assignment");
+ Assert.assertTrue(fRule.evaluate(fScanner).isUndefined());
+ Assert.assertEquals("", fScanner.getBuffer().substring(0, fScanner.getOffset()));
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/DollarBraceCountingRuleTest.java b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/DollarBraceCountingRuleTest.java
new file mode 100644
index 0000000..e6d73f3
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/DollarBraceCountingRuleTest.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Mat Booth and others.
+ * 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
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text.tests;
+
+import org.eclipse.dltk.sh.ui.text.DollarBraceCountingRule;
+import org.eclipse.dltk.sh.ui.text.IShellPartitions;
+import org.eclipse.jface.text.rules.Token;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Tests the dollar-prefixed brace-counting single-line rule. Basically we're
+ * testing to make sure syntax highlighting is correct for ${} and $() blocks.
+ */
+public class DollarBraceCountingRuleTest {
+
+ // Mock objects
+ private MockScanner fScanner;
+
+ // Objects under test
+ private static DollarBraceCountingRule fRule = new DollarBraceCountingRule(
+ '{', '}', new Token(IShellPartitions.PARAM_CONTENT_TYPE), '\\');
+
+ /**
+ * Highlight a simple pair of dollar-prefixed braces.
+ */
+ @Test
+ public void testSimpleMatch() {
+ fScanner = new MockScanner("${basic}test}");
+ Assert.assertFalse(fRule.evaluate(fScanner).isUndefined());
+ Assert.assertEquals("${basic}", fScanner.getBuffer().substring(0,
+ fScanner.getOffset()));
+ }
+
+ /**
+ * Highlight a pair of braces enclosing escaped braces.
+ */
+ @Test
+ public void testEscapedBraceMatch() {
+ fScanner = new MockScanner("${basic\\}\\}}test}");
+ Assert.assertFalse(fRule.evaluate(fScanner).isUndefined());
+ Assert.assertEquals("${basic\\}\\}}", fScanner.getBuffer().substring(0,
+ fScanner.getOffset()));
+ }
+
+ /**
+ * Highlight the correct amount of nested braces.
+ */
+ @Test
+ public void testNestedBraceMatch() {
+ fScanner = new MockScanner("${a{b{cd}e}f}g}");
+ Assert.assertFalse(fRule.evaluate(fScanner).isUndefined());
+ Assert.assertEquals("${a{b{cd}e}f}", fScanner.getBuffer().substring(0,
+ fScanner.getOffset()));
+ }
+
+ /**
+ * Highlight everything up to the end of the line, if that occurs before the
+ * final closing brace.
+ */
+ @Test
+ public void testEndOfLineMatch() {
+ fScanner = new MockScanner("${a{b}c\nd}");
+ Assert.assertFalse(fRule.evaluate(fScanner).isUndefined());
+ Assert.assertEquals("${a{b}c\n", fScanner.getBuffer().substring(0,
+ fScanner.getOffset()));
+ }
+
+ /**
+ * Do not highlight if EOF interrupts the pattern.
+ */
+ @Test
+ public void testEndOfFileMatch() {
+ fScanner = new MockScanner("${end of file is here:");
+ Assert.assertTrue(fRule.evaluate(fScanner).isUndefined());
+ Assert.assertEquals("", fScanner.getBuffer().substring(0,
+ fScanner.getOffset()));
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/DollarRuleTest.java b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/DollarRuleTest.java
new file mode 100644
index 0000000..bab52c4
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/DollarRuleTest.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text.tests;
+
+import org.eclipse.dltk.sh.ui.text.DollarDetector;
+import org.eclipse.dltk.sh.ui.text.DollarRule;
+import org.eclipse.dltk.sh.ui.text.IShellPartitions;
+import org.eclipse.jface.text.rules.Token;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Tests the dollar rule that detects $var style parameter expansions.
+ */
+public class DollarRuleTest {
+
+ // Mock objects
+ private MockScanner fScanner;
+
+ // Objects under test
+ private static DollarRule fRule = new DollarRule(new DollarDetector(), Token.UNDEFINED,
+ new Token(IShellPartitions.PARAM_CONTENT_TYPE));
+
+ /**
+ * Don't match ${} syntax because that is taken care of in another rule.
+ */
+ @Test
+ public void testDollarBraceMatch() {
+ fScanner = new MockScanner("${braces}");
+ Assert.assertTrue(fRule.evaluate(fScanner).isUndefined());
+ Assert.assertEquals("", fScanner.getBuffer().substring(0, fScanner.getOffset()));
+ }
+
+ /**
+ * Match simple alpha-numeric vars that may contain underscores. Don't match
+ * [ or ] because array index references must be inside braces.
+ */
+ @Test
+ public void testDollarMatch() {
+ fScanner = new MockScanner("$alpha_01[5] numeric vars");
+ Assert.assertFalse(fRule.evaluate(fScanner).isUndefined());
+ Assert.assertEquals("$alpha_01", fScanner.getBuffer().substring(0, fScanner.getOffset()));
+ }
+
+ /**
+ * If the variable starts with a digit, then it's a reference to a
+ * positional parameter and only that one digit may be highlighted
+ * (characters after the digit are ignored and parameters 10+ must be
+ * referenced using the brace syntax.) Special parameters are detected
+ * similarly.
+ */
+ @Test
+ public void testPositionalSpecialMatch() {
+ // List of valid special or positional parameters
+ char specials[] = new char[] { '*', '@', '#', '?', '-', '$', '!', '_', '0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', };
+ for (int i = '!'; i <= '~'; i++) {
+ String s = "$" + Character.toString((char) i);
+ fScanner = new MockScanner(s + "some more text");
+
+ // Make sure that special/positional parameters are matched
+ // correctly
+ boolean isSpecial = false;
+ for (int j = 0; j < specials.length; j++) {
+ if ((char) i == specials[j]) {
+ Assert.assertFalse("Testing Special " + s, fRule.evaluate(fScanner).isUndefined());
+ Assert.assertEquals(s, fScanner.getBuffer().substring(0, fScanner.getOffset()));
+ isSpecial = true;
+ break;
+ }
+ }
+
+ if (!isSpecial) {
+ if (Character.isLetter((char) i)) {
+ // Make sure that valid characters that are not specials are
+ // matched normally
+ Assert.assertFalse("Testing Not Special " + s, fRule.evaluate(fScanner).isUndefined());
+ Assert.assertEquals(s + "some", fScanner.getBuffer().substring(0, fScanner.getOffset()));
+ } else {
+ // Make sure that invalid characters are not matched at all
+ Assert.assertTrue("Testing Not Special " + s, fRule.evaluate(fScanner).isUndefined());
+ Assert.assertEquals("", fScanner.getBuffer().substring(0, fScanner.getOffset()));
+ }
+ }
+ }
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/DoubleQuoteScannerTest.java b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/DoubleQuoteScannerTest.java
new file mode 100644
index 0000000..3ab6f03
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/DoubleQuoteScannerTest.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Mat Booth and others.
+ * 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
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text.tests;
+
+import static org.junit.Assert.assertEquals;
+
+import org.eclipse.dltk.sh.ui.Activator;
+import org.eclipse.dltk.sh.ui.IShellColorConstants;
+import org.eclipse.dltk.sh.ui.text.DoubleQuoteScanner;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+import org.junit.Test;
+
+/**
+ * Test the scanner for double quote partitions.
+ */
+public class DoubleQuoteScannerTest extends AbstractScannerTester {
+
+ @Override
+ protected RuleBasedScanner getScanner() {
+ return new DoubleQuoteScanner(cm, Activator.getDefault().getPreferenceStore());
+ }
+
+ @Override
+ protected String getText() {
+ return "x${var}x$var`eval`x$(eval)";
+ }
+
+ /**
+ * Tests that we correctly highlight $dollar style parameter expansions
+ * within interpolated strings.
+ */
+ @Test
+ public void testDollar() {
+ IToken token = getNthToken(4);
+ assertEquals(4, scanner.getTokenLength());
+ assertEquals(8, scanner.getTokenOffset());
+ TextAttribute ta = (TextAttribute) token.getData();
+ assertEquals(ta.getForeground(), cm.getColor(IShellColorConstants.SHELL_VARIABLE));
+ }
+
+ /**
+ * Tests that we correctly highlight ${dollar-brace} style parameter
+ * expansions within interpolated strings.
+ */
+ @Test
+ public void testDollarBrace() {
+ IToken token = getNthToken(2);
+ assertEquals(6, scanner.getTokenLength());
+ assertEquals(1, scanner.getTokenOffset());
+ TextAttribute ta = (TextAttribute) token.getData();
+ assertEquals(ta.getForeground(), cm.getColor(IShellColorConstants.SHELL_VARIABLE));
+ }
+
+ /**
+ * Tests that we correctly highlight `back-tick` style command substitutions
+ * within interpolated strings.
+ */
+ @Test
+ public void testEval() {
+ IToken token = getNthToken(5);
+ assertEquals(6, scanner.getTokenLength());
+ assertEquals(12, scanner.getTokenOffset());
+ TextAttribute ta = (TextAttribute) token.getData();
+ assertEquals(ta.getForeground(), cm.getColor(IShellColorConstants.SHELL_EVAL));
+ }
+
+ /**
+ * Tests that we correctly highlight $(dollar-brace) style command
+ * substitutions within interpolated strings.
+ */
+ @Test
+ public void testDollarEval() {
+ IToken token = getNthToken(7);
+ assertEquals(7, scanner.getTokenLength());
+ assertEquals(19, scanner.getTokenOffset());
+ TextAttribute ta = (TextAttribute) token.getData();
+ assertEquals(ta.getForeground(), cm.getColor(IShellColorConstants.SHELL_EVAL));
+ }
+
+ /**
+ * Everything else should have the default highlighting for this partition
+ * type.
+ */
+ @Test
+ public void testDefault() {
+ IToken token = getNthToken(1);
+ assertEquals(1, scanner.getTokenLength());
+ assertEquals(0, scanner.getTokenOffset());
+ TextAttribute ta = (TextAttribute) token.getData();
+ assertEquals(ta.getForeground(), cm.getColor(IShellColorConstants.SHELL_DOUBLE_QUOTE));
+
+ token = getNthToken(2);
+ assertEquals(1, scanner.getTokenLength());
+ assertEquals(7, scanner.getTokenOffset());
+ ta = (TextAttribute) token.getData();
+ assertEquals(ta.getForeground(), cm.getColor(IShellColorConstants.SHELL_DOUBLE_QUOTE));
+
+ token = getNthToken(3);
+ assertEquals(1, scanner.getTokenLength());
+ assertEquals(18, scanner.getTokenOffset());
+ ta = (TextAttribute) token.getData();
+ assertEquals(ta.getForeground(), cm.getColor(IShellColorConstants.SHELL_DOUBLE_QUOTE));
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/EvalScannerTest.java b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/EvalScannerTest.java
new file mode 100644
index 0000000..f7ba2e4
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/EvalScannerTest.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Mat Booth and others.
+ * 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
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text.tests;
+
+import static org.junit.Assert.assertEquals;
+
+import org.eclipse.dltk.sh.ui.Activator;
+import org.eclipse.dltk.sh.ui.IShellColorConstants;
+import org.eclipse.dltk.sh.ui.text.EvalScanner;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+import org.junit.Test;
+
+/**
+ * Test the scanner for command substitution partitions.
+ */
+public class EvalScannerTest extends AbstractScannerTester {
+
+ @Override
+ protected RuleBasedScanner getScanner() {
+ return new EvalScanner(cm, Activator.getDefault().getPreferenceStore());
+ }
+
+ @Override
+ protected String getText() {
+ return "$vars in command ${substitutions}";
+ }
+
+ /**
+ * Tests that we correctly highlight $dollar style parameter expansions
+ * within command substitutions.
+ */
+ @Test
+ public void testDollar() {
+ IToken token = getNextToken();
+ assertEquals(5, scanner.getTokenLength());
+ assertEquals(0, scanner.getTokenOffset());
+ TextAttribute ta = (TextAttribute) token.getData();
+ assertEquals(ta.getForeground(), cm.getColor(IShellColorConstants.SHELL_VARIABLE));
+ }
+
+ /**
+ * Tests that we correctly highlight ${dollar-brace} style parameter
+ * expansions within command substitutions.
+ */
+ @Test
+ public void testDollarBrace() {
+ IToken token = getNthToken(14);
+ assertEquals(16, scanner.getTokenLength());
+ assertEquals(17, scanner.getTokenOffset());
+ TextAttribute ta = (TextAttribute) token.getData();
+ assertEquals(ta.getForeground(), cm.getColor(IShellColorConstants.SHELL_VARIABLE));
+ }
+
+ /**
+ * Everything else should have the default highlighting for this partition
+ * type.
+ */
+ @Test
+ public void testDefault() {
+ IToken token = getNthToken(3);
+ assertEquals(1, scanner.getTokenLength());
+ assertEquals(6, scanner.getTokenOffset());
+ TextAttribute ta = (TextAttribute) token.getData();
+ assertEquals(ta.getForeground(), cm.getColor(IShellColorConstants.SHELL_EVAL));
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/MockScanner.java b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/MockScanner.java
new file mode 100644
index 0000000..e9d0d03
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/MockScanner.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Mat Booth and others.
+ * 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
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text.tests;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+
+/**
+ * Simple concrete character scanner that we can use to test IPredicateRule and
+ * IRule implementations. As far as the rule being tested is concerned, this
+ * scanner is feeding it chunks of a real document.
+ */
+public class MockScanner implements ICharacterScanner {
+
+ private int fOffset = 0;
+ private String fBuffer;
+
+ /**
+ * Dummy scanner on given buffer.
+ *
+ * @param buffer
+ * The buffer.
+ */
+ public MockScanner(String buffer) {
+ fBuffer = buffer;
+ }
+
+ /**
+ * @return The offset.
+ */
+ public int getOffset() {
+ return fOffset;
+ }
+
+ /**
+ * @return The buffer.
+ */
+ public String getBuffer() {
+ return fBuffer;
+ }
+
+ @Override
+ public int getColumn() {
+ return 0;
+ }
+
+ @Override
+ public char[][] getLegalLineDelimiters() {
+ return new char[][] { { '\r' }, { '\n' }, { '\r', '\n' }, };
+ }
+
+ @Override
+ public int read() {
+
+ if (fOffset < fBuffer.length()) {
+ return fBuffer.charAt(fOffset++);
+ }
+ return EOF;
+ }
+
+ @Override
+ public void unread() {
+ --fOffset;
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/TextSuite.java b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/TextSuite.java
new file mode 100644
index 0000000..8a80805
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui.tests/src/org/eclipse/dltk/sh/ui/text/tests/TextSuite.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2009-2011 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text.tests;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * Test suite for all org.eclipse.dltk.sh.ui.text tests.
+ *
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({ AssignmentRuleTest.class, DollarBraceCountingRuleTest.class, DollarRuleTest.class,
+ DoubleQuoteScannerTest.class, EvalScannerTest.class })
+public class TextSuite {
+}
diff --git a/org.eclipse.dltk.sh.ui/.classpath b/org.eclipse.dltk.sh.ui/.classpath
new file mode 100644
index 0000000..b1b7be1
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <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="classes"/>
+</classpath>
diff --git a/org.eclipse.dltk.sh.ui/.project b/org.eclipse.dltk.sh.ui/.project
new file mode 100644
index 0000000..d535f04
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.dltk.sh.ui</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>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.dltk.sh.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.dltk.sh.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..24ec815
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,124 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/org.eclipse.dltk.sh.ui/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.dltk.sh.ui/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..600407c
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,110 @@
+#Tue Nov 03 18:16:36 EET 2009
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=org.eclipse.jdt.ui.default.eclipse_clean_up_profile
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.overrideannotation=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=true
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=true
+sp_cleanup.correct_indentation=true
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=false
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=true
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=true
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/org.eclipse.dltk.sh.ui/.settings/org.moreunit.prefs b/org.eclipse.dltk.sh.ui/.settings/org.moreunit.prefs
new file mode 100644
index 0000000..55b7c55
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/.settings/org.moreunit.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.moreunit.package_suffix=tests
+org.moreunit.preferences.version=2
+org.moreunit.test_methodType=testMethodTypeNoPrefix
+org.moreunit.test_type=junit4
+org.moreunit.unitsourcefolder=org.eclipse.dltk.sh.ui\:src\:org.eclipse.dltk.sh.ui.tests\:src
+org.moreunit.useprojectsettings=true
diff --git a/org.eclipse.dltk.sh.ui/META-INF/MANIFEST.MF b/org.eclipse.dltk.sh.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..eea63b7
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ShellEd UI Plug-in
+Bundle-SymbolicName: org.eclipse.dltk.sh.ui;singleton:=true
+Bundle-Version: 2.0.4.qualifier
+Bundle-Activator: org.eclipse.dltk.sh.ui.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.dltk.ui;bundle-version="[4.0.0,6.0.0)",
+ org.eclipse.dltk.sh.core,
+ org.eclipse.dltk.core;bundle-version="[4.0.0,6.0.0)",
+ org.eclipse.dltk.launching;bundle-version="[4.0.0,6.0.0)",
+ org.eclipse.dltk.debug.ui;bundle-version="[4.0.0,6.0.0)",
+ org.eclipse.ui.editors,
+ org.eclipse.jface.text,
+ org.eclipse.debug.ui,
+ org.eclipse.search,
+ org.eclipse.linuxtools.man.core,
+ org.eclipse.core.expressions
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Export-Package: org.eclipse.dltk.sh.ui,
+ org.eclipse.dltk.sh.ui.text
+Bundle-Vendor: SourceForge
diff --git a/org.eclipse.dltk.sh.ui/build.properties b/org.eclipse.dltk.sh.ui/build.properties
new file mode 100644
index 0000000..768e62b
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = classes/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ icons/
diff --git a/org.eclipse.dltk.sh.ui/icons/projectwizard.gif b/org.eclipse.dltk.sh.ui/icons/projectwizard.gif
new file mode 100644
index 0000000..b1dda25
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/icons/projectwizard.gif
Binary files differ
diff --git a/org.eclipse.dltk.sh.ui/icons/script.gif b/org.eclipse.dltk.sh.ui/icons/script.gif
new file mode 100644
index 0000000..feb19f5
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/icons/script.gif
Binary files differ
diff --git a/org.eclipse.dltk.sh.ui/icons/scriptwizard.gif b/org.eclipse.dltk.sh.ui/icons/scriptwizard.gif
new file mode 100644
index 0000000..7a93fcf
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/icons/scriptwizard.gif
Binary files differ
diff --git a/org.eclipse.dltk.sh.ui/icons/shellapp.gif b/org.eclipse.dltk.sh.ui/icons/shellapp.gif
new file mode 100644
index 0000000..fa5b848
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/icons/shellapp.gif
Binary files differ
diff --git a/org.eclipse.dltk.sh.ui/plugin.xml b/org.eclipse.dltk.sh.ui/plugin.xml
new file mode 100644
index 0000000..787b8e1
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/plugin.xml
@@ -0,0 +1,317 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension point="org.eclipse.dltk.ui.language">
+ <language class="org.eclipse.dltk.sh.ui.ShelledUILanguageToolkit"
+ nature="org.eclipse.dltk.sh.core.nature" priority="0">
+ </language>
+ </extension>
+ <extension point="org.eclipse.ui.newWizards">
+ <category id="org.eclipse.dltk.sh.category" name="Shell Script">
+ </category>
+ <wizard
+ category="org.eclipse.dltk.sh.category"
+ class="org.eclipse.dltk.sh.ui.wizards.ShellScriptProjectWizard"
+ icon="icons/projectwizard.gif"
+ id="org.eclipse.dltk.sh.projectwizard"
+ name="Shell Script Project"
+ project="true">
+ <description>
+ Create a new Shell Script project.
+ </description>
+ </wizard>
+ <wizard
+ category="org.eclipse.dltk.sh.category"
+ class="org.eclipse.dltk.sh.ui.wizards.NewShellScriptFileWizard"
+ icon="icons/scriptwizard.gif"
+ id="org.eclipse.dltk.sh.scriptfilewizard"
+ name="Shell Script"
+ project="false">
+ <description>
+ Create a new Shell Script.
+ </description>
+ </wizard>
+ </extension>
+ <extension point="org.eclipse.dltk.launching.interpreterInstallTypes">
+ <interpreterInstallType
+ class="org.eclipse.dltk.sh.ui.interpreter.ShellScriptInstallType"
+ id="org.eclipse.dltk.sh.ui.interpreter.ShellScriptInstallType">
+ </interpreterInstallType>
+ </extension>
+ <extension
+ point="org.eclipse.dltk.launching.interpreterInstalls">
+ <interpreterInstall
+ home="/bin/sh"
+ id="org.eclipse.dltk.sh.ui.interpreter.default"
+ interpreterInstallType="org.eclipse.dltk.sh.ui.interpreter.ShellScriptInstallType"
+ name="/bin/sh">
+ </interpreterInstall>
+ </extension>
+ <extension point="org.eclipse.ui.preferencePages">
+ <page id="org.eclipse.dltk.sh.ui.preferences"
+ name="Shell Script"
+ class="org.eclipse.dltk.sh.ui.MainPreferencePage">
+ </page>
+
+ <page
+ class="org.eclipse.dltk.sh.ui.interpreter.ShellInterpreterPreferencePage"
+ category="org.eclipse.dltk.sh.ui.preferences" id="org.eclipse.dltk.sh.ui.preferences.interpreters" name="Interpreters" />
+ <page
+ category="org.eclipse.dltk.sh.ui.preferences"
+ class="org.eclipse.dltk.sh.ui.preferences.ShellTodoTaskPreferencePage"
+ id="org.eclipse.dltk.sh.ui.preferences.TodoTasks"
+ name="Task Tags"/>
+ <page
+ category="org.eclipse.dltk.sh.ui.preferences.editor"
+ class="org.eclipse.dltk.sh.ui.preferences.ShellSyntaxColoringPreferencePage"
+ id="org.eclipse.dltk.sh.ui.syntaxcoloring"
+ name="Syntax coloring"/>
+ <page
+ category="org.eclipse.dltk.sh.ui.preferences"
+ class="org.eclipse.dltk.sh.ui.preferences.ShellEditorPreferencesPage"
+ id="org.eclipse.dltk.sh.ui.preferences.editor"
+ name="Editor"/>
+ <page
+ category="org.eclipse.dltk.sh.ui.preferences.editor"
+ class="org.eclipse.dltk.sh.ui.preferences.ShellFoldingPreferencePage"
+ id="org.eclipse.dltk.sh.ui.preferences.folding"
+ name="Folding"/>
+ </extension>
+ <extension point="org.eclipse.ui.editors">
+ <editor
+ class="org.eclipse.dltk.sh.ui.editor.ShellScriptEditor"
+ contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
+ default="false"
+ icon="icons/script.gif"
+ id="org.eclipse.dltk.sh.ui.editor"
+ name="Shell Script Editor">
+ <contentTypeBinding contentTypeId="org.eclipse.dltk.sh.content-type" />
+ </editor>
+ </extension>
+ <extension point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.eclipse.dltk.sh.ui.ShelledUIPreferenceInitializer" />
+ </extension>
+ <extension point="org.eclipse.debug.core.launchConfigurationTypes">
+ <launchConfigurationType
+ id="org.eclipse.dltk.sh.ui.launchConfigurationType1" name="Shell Script"
+ delegate="org.eclipse.dltk.sh.ui.LaunchConfigurationDelegate"
+ modes="run">
+ </launchConfigurationType>
+ </extension>
+ <extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
+ <launchConfigurationTypeImage icon="icons/shellapp.gif"
+ configTypeID="org.eclipse.dltk.sh.ui.launchConfigurationType1"
+ id="org.eclipse.dltk.sh.ui.launchConfigurationTypeImage.program">
+ </launchConfigurationTypeImage>
+ </extension>
+
+ <extension point="org.eclipse.debug.ui.launchShortcuts">
+ <shortcut class="org.eclipse.dltk.sh.ui.LaunchShortcut"
+ id="org.eclipse.dltk.sh.ui.shortcut" label="Shell script" modes="run"
+ icon="icons/shellapp.gif">
+ <contextualLaunch>
+ <enablement>
+ <with variable="selection">
+ <count value="1" />
+ <iterate>
+ <or>
+ <test args="org.eclipse.dltk.sh.core.nature" property="org.eclipse.dltk.launching.hasProjectNature">
+ </test>
+ </or>
+ </iterate>
+ </with>
+ </enablement>
+ <contextLabel label="Run shell script" mode="run">
+ </contextLabel>
+ </contextualLaunch>
+
+ </shortcut>
+ </extension>
+ <extension point="org.eclipse.debug.ui.launchConfigurationTabGroups">
+ <launchConfigurationTabGroup
+ class="org.eclipse.dltk.sh.ui.interpreter.ShellTabGroup" id="org.eclipse.dltk.sh.ui.interpreter.ShellTabGroup"
+ type="org.eclipse.dltk.sh.ui.launchConfigurationType1">
+ </launchConfigurationTabGroup>
+ </extension>
+ <extension point="org.eclipse.dltk.core.completionEngine">
+ <completionEngine
+ class="org.eclipse.dltk.sh.ui.completion.ShellCompletionEngine"
+ nature="org.eclipse.dltk.sh.core.nature" priority="0">
+ </completionEngine>
+ </extension>
+ <extension point="org.eclipse.dltk.ui.scriptCompletionProposalComputer"
+ id="ShellTypeCompletionProposalComputer">
+ <scriptCompletionProposalComputer
+ class="org.eclipse.dltk.sh.ui.completion.ShellCompletionProposalComputer"
+ categoryId="org.eclipse.dltk.ui.scriptTypeProposalCategory"
+ toolkitId="org.eclipse.dltk.sh.core.nature">
+ <partition type="__dftl_partition_content_type" />
+ </scriptCompletionProposalComputer>
+ </extension>
+ <extension point="org.eclipse.search.searchPages">
+ <page canSearchEnclosingProjects="true"
+ class="org.eclipse.dltk.sh.ui.search.ShelledSearchPage" enabled="true"
+ id="org.eclipse.dltk.sh.ShelledSearchPage" label="Shell Script Search"
+ showScopeSection="true" sizeHint="460,160">
+ </page>
+ </extension>
+ <extension point="org.eclipse.dltk.core.search">
+ <searchFactory
+ class="org.eclipse.dltk.sh.ui.search.ShelledSearchFactory"
+ nature="org.eclipse.dltk.sh.core.nature" priority="0">
+ </searchFactory>
+ </extension>
+ <extension point="org.eclipse.dltk.core.selectionEngine">
+ <selectionEngine
+ class="org.eclipse.dltk.sh.ui.selection.ShelledSelectionEngine"
+ nature="org.eclipse.dltk.sh.core.nature"
+ priority="0">
+ </selectionEngine>
+</extension>
+<extension
+ point="org.eclipse.dltk.core.buildParticipant">
+ <buildParticipant
+ class="org.eclipse.dltk.core.builder.ParserBuildParticipantFactory"
+ id="org.eclipse.dltk.sh.buildParticipant.parser"
+ name="Shell build"
+ nature="org.eclipse.dltk.sh.core.nature">
+ </buildParticipant>
+ <buildParticipant
+ class="org.eclipse.dltk.sh.ui.ShellTodoParserType"
+ id="org.eclipse.dltk.sh.todo"
+ name="Shelled"
+ nature="org.eclipse.dltk.sh.core.nature">
+ <requires
+ id="org.eclipse.dltk.sh.buildParticipant.parser">
+ </requires>
+ </buildParticipant>
+
+</extension>
+<extension point="org.eclipse.dltk.ui.scriptDocumentationProviders">
+ <provider
+ class="org.eclipse.dltk.sh.ui.selection.ShellDocumentationProvider"
+ id="org.eclipse.dltk.sh.ShellDocumentationProvider"
+ nature="org.eclipse.dltk.sh.core.nature"/>
+</extension>
+ <extension point="org.eclipse.ui.commands">
+ <command name="Run shell" description="run shell script"
+ categoryId="org.eclipse.debug.ui.category.run" id="org.eclipse.dltk.sh.ui.shortcut">
+ </command>
+ <command
+ defaultHandler="org.eclipse.dltk.sh.ui.commands.ShowManHandler"
+ description="Show man page view"
+ id="org.eclipse.dltk.sh.ui.showman"
+ name="Show man page">
+ </command>
+ <command
+ defaultHandler="org.eclipse.dltk.sh.ui.commands.AddNature"
+ description="Adds the Shell Script nature to these projects"
+ id="org.eclipse.dltk.sh.ui.addnature"
+ name="Add Shell Script Support">
+ </command>
+ <command
+ defaultHandler="org.eclipse.dltk.sh.ui.commands.RemoveNature"
+ description="Removes the Shell Script nature from these projects"
+ id="org.eclipse.dltk.sh.ui.removenature"
+ name="Remove Shell Script Support">
+ </command>
+ </extension>
+<extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.eclipse.dltk.sh.ui.showman"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="Alt+M">
+ </key>
+</extension>
+<extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="popup:org.eclipse.ui.popup.any?after=additions">
+ <menu
+ label="ShellEd">
+ <command
+ commandId="org.eclipse.dltk.sh.ui.addnature"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="selection">
+ <iterate
+ ifEmpty="false"
+ operator="or">
+ <not>
+ <test
+ property="org.eclipse.dltk.sh.ui.naturetester.hasShellEdNature">
+ </test>
+ </not>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.dltk.sh.ui.removenature"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="selection">
+ <iterate
+ ifEmpty="false"
+ operator="or">
+ <test
+ property="org.eclipse.dltk.sh.ui.naturetester.hasShellEdNature">
+ </test>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="selection">
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <or>
+ <adapt
+ type="org.eclipse.core.resources.IProject">
+ </adapt>
+ <adapt
+ type="org.eclipse.dltk.core.IScriptProject">
+ </adapt>
+ </or>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </menu>
+ </menuContribution>
+</extension>
+<extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.dltk.sh.ui.commands.NaturePropertyTester"
+ id="org.eclipse.dltk.sh.ui.naturetester"
+ namespace="org.eclipse.dltk.sh.ui.naturetester"
+ properties="hasShellEdNature"
+ type="org.eclipse.core.runtime.IAdaptable">
+ </propertyTester>
+</extension>
+
+<extension point="org.eclipse.dltk.ui.folding">
+ <structureProvider
+ nature="org.eclipse.dltk.sh.core.nature"
+ class="org.eclipse.dltk.ui.text.folding.DelegatingFoldingStructureProvider">
+ </structureProvider>
+ <blockProvider
+ nature="org.eclipse.dltk.sh.core.nature"
+ class="org.eclipse.dltk.sh.ui.text.folding.ShellCommentFoldingBlockProvider">
+ </blockProvider>
+ <blockProvider
+ nature="org.eclipse.dltk.sh.core.nature"
+ class="org.eclipse.dltk.sh.ui.text.folding.ShellCodeFoldingBlockProvider">
+ </blockProvider>
+</extension>
+</plugin>
diff --git a/org.eclipse.dltk.sh.ui/pom.xml b/org.eclipse.dltk.sh.ui/pom.xml
new file mode 100644
index 0000000..f1b328b
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/pom.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, Inc. and others
+
+ 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:
+ Red Hat Incorporated - initial implementation
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.dltk.sh</groupId>
+ <artifactId>parent</artifactId>
+ <version>2.0.4-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.dltk.sh.ui</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>ShellEd UI plugin</name>
+</project>
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/Activator.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/Activator.java
new file mode 100644
index 0000000..ae3060f
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/Activator.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui;
+
+import org.eclipse.dltk.sh.ui.text.ShellTextTools;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The shared instance
+ private static Activator plugin;
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.dltk.sh.ui";
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ private ShellTextTools fShellTextTools;
+
+ public synchronized ShellTextTools getTextTools() {
+ if (fShellTextTools == null)
+ fShellTextTools = new ShellTextTools(true);
+ return fShellTextTools;
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/IShellColorConstants.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/IShellColorConstants.java
new file mode 100644
index 0000000..13bbd84
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/IShellColorConstants.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui;
+
+import org.eclipse.dltk.ui.text.DLTKColorConstants;
+
+public interface IShellColorConstants {
+ public static final String SHELL_COMMENT = DLTKColorConstants.DLTK_SINGLE_LINE_COMMENT;
+ public static final String SHELL_DEFAULT = DLTKColorConstants.DLTK_DEFAULT;
+ public static final String SHELL_DOUBLE_QUOTE = "SHELLED_interpolated_string";
+ public static final String SHELL_EVAL = DLTKColorConstants.DLTK_OPERATOR;
+ public static final String SHELL_FUNCTION = DLTKColorConstants.DLTK_FUNCTION_DEFINITION;
+ public static final String SHELL_HASHBANG = DLTKColorConstants.DLTK_MULTI_LINE_COMMENT;
+ public static final String SHELL_KEYWORD = DLTKColorConstants.DLTK_KEYWORD;
+ public static final String SHELL_SINGLE_QUOTE = DLTKColorConstants.DLTK_STRING;
+ public static final String SHELL_VARIABLE = DLTKColorConstants.DLTK_ARGUMENT;
+ public static final String SHELL_COMMAND = DLTKColorConstants.DLTK_BASE_CLASS;
+ public static final String SHELL_TODO_TAG = DLTKColorConstants.TASK_TAG;
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/LaunchConfigurationDelegate.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/LaunchConfigurationDelegate.java
new file mode 100644
index 0000000..1fd24d1
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/LaunchConfigurationDelegate.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui;
+
+import org.eclipse.dltk.launching.AbstractScriptLaunchConfigurationDelegate;
+import org.eclipse.dltk.sh.core.ShelledNature;
+
+public class LaunchConfigurationDelegate extends AbstractScriptLaunchConfigurationDelegate {
+
+ @Override
+ public String getLanguageId() {
+ return ShelledNature.SHELLED_NATURE;
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/LaunchShortcut.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/LaunchShortcut.java
new file mode 100644
index 0000000..8cb4874
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/LaunchShortcut.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui;
+
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.dltk.internal.debug.ui.launcher.AbstractScriptLaunchShortcut;
+import org.eclipse.dltk.sh.core.ShelledNature;
+
+public class LaunchShortcut extends AbstractScriptLaunchShortcut {
+
+ @Override
+ protected ILaunchConfigurationType getConfigurationType() {
+ return getLaunchManager().getLaunchConfigurationType("org.eclipse.dltk.sh.ui.launchConfigurationType1");
+ }
+
+ @Override
+ protected String getNatureId() {
+ return ShelledNature.SHELLED_NATURE;
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/MainPreferencePage.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/MainPreferencePage.java
new file mode 100644
index 0000000..95f2379
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/MainPreferencePage.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+public class MainPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ public MainPreferencePage() {
+ // TODO Auto-generated constructor stub
+ }
+
+ public MainPreferencePage(String title) {
+ super(title);
+ // TODO Auto-generated constructor stub
+ }
+
+ public MainPreferencePage(String title, ImageDescriptor image) {
+ super(title, image);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void init(IWorkbench workbench) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShellContentAssistPreference.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShellContentAssistPreference.java
new file mode 100644
index 0000000..add5502
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShellContentAssistPreference.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui;
+
+import org.eclipse.dltk.ui.text.ScriptTextTools;
+import org.eclipse.dltk.ui.text.completion.ContentAssistPreference;
+
+public class ShellContentAssistPreference extends ContentAssistPreference {
+ private static ShellContentAssistPreference instance;
+
+ public static ContentAssistPreference getDefault() {
+ if (instance == null) {
+ instance = new ShellContentAssistPreference();
+ }
+ return instance;
+ }
+
+ @Override
+ protected ScriptTextTools getTextTools() {
+ return Activator.getDefault().getTextTools();
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShellTodoParserType.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShellTodoParserType.java
new file mode 100644
index 0000000..a5a91dd
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShellTodoParserType.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui;
+
+import org.eclipse.dltk.compiler.task.ITodoTaskPreferences;
+import org.eclipse.dltk.compiler.task.TodoTaskPreferencesOnPreferenceLookupDelegate;
+import org.eclipse.dltk.core.IScriptProject;
+import org.eclipse.dltk.core.builder.AbstractTodoTaskBuildParticipantType;
+
+public class ShellTodoParserType extends AbstractTodoTaskBuildParticipantType {
+
+ @Override
+ protected ITodoTaskPreferences getPreferences(IScriptProject project) {
+ return new TodoTaskPreferencesOnPreferenceLookupDelegate(Activator.PLUGIN_ID, project);
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShelledUILanguageToolkit.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShelledUILanguageToolkit.java
new file mode 100644
index 0000000..0b28058
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShelledUILanguageToolkit.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui;
+
+import org.eclipse.dltk.core.IDLTKLanguageToolkit;
+import org.eclipse.dltk.sh.core.ShellScriptLanguageToolkit;
+import org.eclipse.dltk.sh.ui.interpreter.ShellInterpreterPreferencePage;
+import org.eclipse.dltk.ui.AbstractDLTKUILanguageToolkit;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+public class ShelledUILanguageToolkit extends AbstractDLTKUILanguageToolkit {
+ @Override
+ public IDLTKLanguageToolkit getCoreToolkit() {
+ return ShellScriptLanguageToolkit.getDefault();
+ }
+
+ @Override
+ public IPreferenceStore getPreferenceStore() {
+ return Activator.getDefault().getPreferenceStore();
+ }
+
+ @Override
+ public String getInterpreterPreferencePage() {
+ return ShellInterpreterPreferencePage.PAGE_ID;
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShelledUIPreferenceInitializer.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShelledUIPreferenceInitializer.java
new file mode 100644
index 0000000..7c5931c
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/ShelledUIPreferenceInitializer.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.dltk.compiler.task.TaskTagUtils;
+import org.eclipse.dltk.ui.CodeFormatterConstants;
+import org.eclipse.dltk.ui.PreferenceConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.ui.editors.text.EditorsUI;
+
+public class ShelledUIPreferenceInitializer extends AbstractPreferenceInitializer {
+
+ @Override
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+
+ EditorsUI.useAnnotationsPreferencePage(store);
+ EditorsUI.useQuickDiffPreferencePage(store);
+
+ // Initialize DLTK default values
+ PreferenceConstants.initializeDefaultValues(store);
+
+ // Initialize SHELL constants
+ PreferenceConverter.setDefault(store, IShellColorConstants.SHELL_COMMENT, new RGB(136, 0, 136));
+ PreferenceConverter.setDefault(store, IShellColorConstants.SHELL_HASHBANG, new RGB(136, 136, 136));
+ PreferenceConverter.setDefault(store, IShellColorConstants.SHELL_KEYWORD, new RGB(144, 4, 86));
+ PreferenceConverter.setDefault(store, IShellColorConstants.SHELL_SINGLE_QUOTE, new RGB(13, 109, 160));
+ PreferenceConverter.setDefault(store, IShellColorConstants.SHELL_DOUBLE_QUOTE, new RGB(13, 109, 24));
+ PreferenceConverter.setDefault(store, IShellColorConstants.SHELL_EVAL, new RGB(205, 30, 30));
+ PreferenceConverter.setDefault(store, IShellColorConstants.SHELL_FUNCTION, new RGB(255, 127, 63));
+ PreferenceConverter.setDefault(store, IShellColorConstants.SHELL_COMMAND, new RGB(255, 127, 63));
+ PreferenceConverter.setDefault(store, IShellColorConstants.SHELL_VARIABLE, new RGB(0, 0, 156));
+
+ PreferenceConverter.setDefault(store, IShellColorConstants.SHELL_TODO_TAG, new RGB(127, 159, 191));
+ store.setDefault(IShellColorConstants.SHELL_TODO_TAG + PreferenceConstants.EDITOR_BOLD_SUFFIX, true);
+
+ store.setDefault(IShellColorConstants.SHELL_COMMENT + PreferenceConstants.EDITOR_BOLD_SUFFIX, false);
+ store.setDefault(IShellColorConstants.SHELL_COMMENT + PreferenceConstants.EDITOR_ITALIC_SUFFIX, true);
+ store.setDefault(IShellColorConstants.SHELL_HASHBANG + PreferenceConstants.EDITOR_ITALIC_SUFFIX, true);
+
+ store.setDefault(IShellColorConstants.SHELL_KEYWORD + PreferenceConstants.EDITOR_BOLD_SUFFIX, true);
+ store.setDefault(IShellColorConstants.SHELL_KEYWORD + PreferenceConstants.EDITOR_ITALIC_SUFFIX, false);
+
+ store.setDefault(PreferenceConstants.EDITOR_TAB_WIDTH, 8);
+ store.setDefault(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE, true);
+
+ store.setDefault(CodeFormatterConstants.FORMATTER_TAB_CHAR, CodeFormatterConstants.TAB);
+ store.setDefault(CodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
+ store.setDefault(CodeFormatterConstants.FORMATTER_INDENTATION_SIZE, "4");
+
+ /* folding */
+ store.setDefault(PreferenceConstants.EDITOR_FOLDING_ENABLED, true);
+ store.setDefault(PreferenceConstants.EDITOR_FOLDING_LINES_LIMIT, 2);
+ store.setDefault(PreferenceConstants.EDITOR_COMMENTS_FOLDING_ENABLED, true);
+ store.setDefault(PreferenceConstants.EDITOR_DOCS_FOLDING_ENABLED, true);
+ store.setDefault(PreferenceConstants.EDITOR_FOLDING_INIT_COMMENTS, true);
+
+ TaskTagUtils.initializeDefaultValues(DefaultScope.INSTANCE.getNode(Activator.PLUGIN_ID));
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/AbstractProjectHandler.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/AbstractProjectHandler.java
new file mode 100644
index 0000000..03293cf
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/AbstractProjectHandler.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Mat Booth and others.
+ * 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
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.commands;
+
+import java.util.Iterator;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * An abstract command handler that iterates through the current selection
+ * looking for projects resources to save us from having this code in every
+ * handler that wants to manipulate projects.
+ */
+public abstract class AbstractProjectHandler extends AbstractHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+ Iterator<?> iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ Object element = iterator.next();
+ IProject project = null;
+ if (element instanceof IProject) {
+ project = (IProject) element;
+ } else if (element instanceof IAdaptable) {
+ project = ((IAdaptable) element).getAdapter(IProject.class);
+ }
+ if (project != null) {
+ fettleProject(project);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * To be implemented by sub-classes to perform actions on a project. This
+ * will be called once for every project resource that is currently
+ * selected.
+ *
+ * @param project
+ * a project resource for manipulation
+ */
+ protected abstract void fettleProject(IProject project);
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/AddNature.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/AddNature.java
new file mode 100644
index 0000000..65a9d64
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/AddNature.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Mat Booth and others.
+ * 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
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.commands;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.dltk.sh.core.ShelledNature;
+
+/**
+ * Implementation of the project handler that adds the ShellEd nature to a
+ * project.
+ */
+public class AddNature extends AbstractProjectHandler {
+
+ @Override
+ protected void fettleProject(IProject project) {
+ try {
+ // Get the project description
+ IProjectDescription description = project.getDescription();
+ String[] natures = description.getNatureIds();
+
+ // Add the nature to the list
+ String[] newNatures = new String[natures.length + 1];
+ System.arraycopy(natures, 0, newNatures, 0, natures.length);
+ newNatures[natures.length] = ShelledNature.SHELLED_NATURE;
+
+ // Set the project description
+ description.setNatureIds(newNatures);
+ project.setDescription(description, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/NaturePropertyTester.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/NaturePropertyTester.java
new file mode 100644
index 0000000..aa84c06
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/NaturePropertyTester.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Mat Booth and others.
+ * 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
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.commands;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.dltk.sh.core.ShelledNature;
+
+/**
+ * A property tester that returns true if the project containing any given
+ * resource is a ShellEd-natured project.
+ */
+public class NaturePropertyTester extends PropertyTester {
+
+ // Properties made available for test by this tester
+ private static final String HAS_SHELLED_NATURE = "hasShellEdNature"; //$NON-NLS-1$
+
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ IResource resource = ((IAdaptable) receiver).getAdapter(IResource.class);
+ if (resource == null) {
+ return false;
+ }
+ if (property.equals(HAS_SHELLED_NATURE)) {
+ try {
+ IProject proj = resource.getProject();
+ return proj.isAccessible() && proj.hasNature(ShelledNature.SHELLED_NATURE);
+ } catch (CoreException e) {
+ return false;
+ }
+ }
+ return false;
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/RemoveNature.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/RemoveNature.java
new file mode 100644
index 0000000..1927e4e
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/RemoveNature.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Mat Booth and others.
+ * 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
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.dltk.sh.core.ShelledNature;
+
+/**
+ * Implementation of the project handler that removes the ShellEd nature from a
+ * project.
+ */
+public class RemoveNature extends AbstractProjectHandler {
+
+ @Override
+ protected void fettleProject(IProject project) {
+ try {
+ // Get the project description
+ IProjectDescription description = project.getDescription();
+ String[] natures = description.getNatureIds();
+
+ // Filter the nature out of the list
+ List<String> newNatures = new ArrayList<>();
+ for (String nature : natures) {
+ if (!ShelledNature.SHELLED_NATURE.equals(nature)) {
+ newNatures.add(nature);
+ }
+ }
+
+ // Set the project description
+ description.setNatureIds(newNatures.toArray(new String[newNatures.size()]));
+ project.setDescription(description, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/ShowManHandler.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/ShowManHandler.java
new file mode 100644
index 0000000..09c84ad
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/commands/ShowManHandler.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.linuxtools.man.views.ManView;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * A command handler that opens the Man Page view and tries to show the man page
+ * for whatever text is currently highlighted.
+ */
+public class ShowManHandler extends AbstractHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) {
+ try {
+ ISelection selection = HandlerUtil.getActiveEditor(event).getEditorSite().getSelectionProvider()
+ .getSelection();
+ String manPage = "";
+ if ((selection != null) & (selection instanceof TextSelection)) {
+ TextSelection textSelection = (TextSelection) selection;
+ manPage = textSelection.getText();
+ }
+
+ if (!manPage.isEmpty()) {
+ ManView view = (ManView) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage()
+ .showView(ManView.ID);
+ view.setManPageName(manPage);
+ }
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionEngine.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionEngine.java
new file mode 100644
index 0000000..cbb948a
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionEngine.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.completion;
+
+import org.eclipse.dltk.codeassist.ScriptCompletionEngine;
+import org.eclipse.dltk.compiler.env.IModuleSource;
+import org.eclipse.dltk.core.CompletionProposal;
+import org.eclipse.dltk.core.DLTKCore;
+import org.eclipse.dltk.core.IModelElement;
+import org.eclipse.dltk.core.IModelElementVisitor;
+import org.eclipse.dltk.core.ModelException;
+import org.eclipse.dltk.sh.ui.text.ShellCodeScanner;
+
+public class ShellCompletionEngine extends ScriptCompletionEngine {
+
+ private int actualCompletionPosition;
+
+ @Override
+ public void complete(IModuleSource module, int position, int pos) {
+
+ this.actualCompletionPosition = position;
+ this.offset = pos;
+ String temp = module.getSourceContents().substring(0, position);
+ int lastSpace = temp.lastIndexOf(' ');
+ int lastNewline = temp.lastIndexOf('\n');
+ String complPrefix = temp.substring(lastSpace > lastNewline ? lastSpace : lastNewline).trim();
+ this.requestor.beginReporting();
+ for (String keyword : ShellCodeScanner.KEYWORDS) {
+ if (keyword.startsWith(complPrefix)) {
+ createProposal(keyword, null);
+ }
+ }
+ for (String command : ShellCodeScanner.getCommands()) {
+ if (command.startsWith(complPrefix)) {
+ createProposal(command, null);
+ }
+ }
+
+ // Completion for model elements.
+ try {
+ module.getModelElement().accept(new IModelElementVisitor() {
+ @Override
+ public boolean visit(IModelElement element) {
+ if (element.getElementType() > IModelElement.SOURCE_MODULE) {
+ createProposal(element.getElementName(), element);
+ }
+ return true;
+ }
+ });
+ } catch (ModelException e) {
+ if (DLTKCore.DEBUG) {
+ e.printStackTrace();
+ }
+ }
+ this.requestor.endReporting();
+ }
+
+ private void createProposal(String name, IModelElement element) {
+ CompletionProposal proposal = this.createProposal(CompletionProposal.KEYWORD, this.actualCompletionPosition);
+ proposal.setName(name);
+ proposal.setCompletion(name);
+ proposal.setReplaceRange(actualCompletionPosition - offset, actualCompletionPosition - offset);
+ proposal.setRelevance(20);
+ proposal.setModelElement(element);
+ this.requestor.accept(proposal);
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProcessor.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProcessor.java
new file mode 100644
index 0000000..d9ebae4
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProcessor.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.completion;
+
+import org.eclipse.dltk.sh.core.ShelledNature;
+import org.eclipse.dltk.ui.text.completion.ScriptCompletionProcessor;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.ui.IEditorPart;
+
+public class ShellCompletionProcessor extends ScriptCompletionProcessor {
+ public ShellCompletionProcessor(IEditorPart editor, ContentAssistant assistant, String partition) {
+ super(editor, assistant, partition);
+ }
+
+ @Override
+ protected String getNatureId() {
+ return ShelledNature.SHELLED_NATURE;
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProposal.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProposal.java
new file mode 100644
index 0000000..07212ec
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProposal.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.completion;
+
+import org.eclipse.dltk.sh.ui.Activator;
+import org.eclipse.dltk.ui.PreferenceConstants;
+import org.eclipse.dltk.ui.text.completion.ScriptCompletionProposal;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.graphics.Image;
+
+public class ShellCompletionProposal extends ScriptCompletionProposal {
+ public ShellCompletionProposal(String replacementString, int replacementOffset, int replacementLength, Image image,
+ String displayString, int relevance) {
+ super(replacementString, replacementOffset, replacementLength, image, displayString, relevance);
+ }
+
+ public ShellCompletionProposal(String replacementString, int replacementOffset, int replacementLength, Image image,
+ String displayString, int relevance, boolean isInDoc) {
+ super(replacementString, replacementOffset, replacementLength, image, displayString, relevance, isInDoc);
+ }
+
+ @Override
+ protected boolean isSmartTrigger(char trigger) {
+ if (trigger == '$') {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ protected boolean insertCompletion() {
+ IPreferenceStore preference = Activator.getDefault().getPreferenceStore();
+ return preference.getBoolean(PreferenceConstants.CODEASSIST_INSERT_COMPLETION);
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProposalCollector.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProposalCollector.java
new file mode 100644
index 0000000..0074c56
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProposalCollector.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.completion;
+
+import org.eclipse.dltk.core.IScriptProject;
+import org.eclipse.dltk.core.ISourceModule;
+import org.eclipse.dltk.ui.text.completion.ScriptCompletionProposal;
+import org.eclipse.dltk.ui.text.completion.ScriptCompletionProposalCollector;
+import org.eclipse.swt.graphics.Image;
+
+public class ShellCompletionProposalCollector extends ScriptCompletionProposalCollector {
+
+ public ShellCompletionProposalCollector(ISourceModule module) {
+ super(module);
+ }
+
+ @Override
+ protected ScriptCompletionProposal createOverrideCompletionProposal(IScriptProject scriptProject,
+ ISourceModule compilationUnit, String name, String[] paramTypes, int start, int length, String label,
+ String string) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected ScriptCompletionProposal createScriptCompletionProposal(String completion, int replaceStart, int length,
+ Image image, String displayString, int i) {
+ return new ShellCompletionProposal(completion, replaceStart, length, image, displayString, i);
+
+ }
+
+ @Override
+ protected ScriptCompletionProposal createScriptCompletionProposal(String completion, int replaceStart, int length,
+ Image image, String displayString, int i, boolean isInDoc) {
+ return new ShellCompletionProposal(completion, replaceStart, length, image, displayString, i);
+ }
+
+ @Override
+ protected char[] getVarTrigger() {
+ return new char[] { '$' };
+ }
+
+ @Override
+ protected String getNatureId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProposalComputer.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProposalComputer.java
new file mode 100644
index 0000000..41f6435
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/completion/ShellCompletionProposalComputer.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.completion;
+
+import org.eclipse.dltk.ui.text.completion.ScriptCompletionProposalCollector;
+import org.eclipse.dltk.ui.text.completion.ScriptCompletionProposalComputer;
+import org.eclipse.dltk.ui.text.completion.ScriptContentAssistInvocationContext;
+import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
+
+public class ShellCompletionProposalComputer extends ScriptCompletionProposalComputer {
+
+ public ShellCompletionProposalComputer() {
+
+ }
+
+ @Override
+ protected ScriptCompletionProposalCollector createCollector(ScriptContentAssistInvocationContext context) {
+ return new ShellCompletionProposalCollector(context.getSourceModule());
+ }
+
+ @Override
+ protected TemplateCompletionProcessor createTemplateProposalComputer(ScriptContentAssistInvocationContext context) {
+ return null;
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/editor/ShellDocumentSetupParticipant.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/editor/ShellDocumentSetupParticipant.java
new file mode 100644
index 0000000..beeb33b
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/editor/ShellDocumentSetupParticipant.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.editor;
+
+import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
+import org.eclipse.dltk.sh.ui.Activator;
+import org.eclipse.dltk.sh.ui.text.IShellPartitions;
+import org.eclipse.dltk.sh.ui.text.ShellTextTools;
+import org.eclipse.jface.text.IDocument;
+
+public class ShellDocumentSetupParticipant implements IDocumentSetupParticipant {
+
+ @Override
+ public void setup(IDocument document) {
+ ShellTextTools tools = Activator.getDefault().getTextTools();
+ tools.setupDocumentPartitioner(document, IShellPartitions.SHELL_PARTITIONING);
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/editor/ShellScriptEditor.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/editor/ShellScriptEditor.java
new file mode 100644
index 0000000..e4ce945
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/editor/ShellScriptEditor.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.editor;
+
+import org.eclipse.dltk.core.IDLTKLanguageToolkit;
+import org.eclipse.dltk.internal.ui.editor.ScriptEditor;
+import org.eclipse.dltk.sh.core.ShellScriptLanguageToolkit;
+import org.eclipse.dltk.sh.ui.Activator;
+import org.eclipse.dltk.sh.ui.text.IShellPartitions;
+import org.eclipse.dltk.ui.text.ScriptTextTools;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentExtension3;
+import org.eclipse.ui.IEditorInput;
+
+public class ShellScriptEditor extends ScriptEditor {
+
+ public static final String EDITOR_CONTEXT = "#ShellScriptEditorContext";
+
+ public static final String EDITOR_ID = "org.eclipse.dltk.sh.ui.editor";
+
+ @Override
+ protected void connectPartitioningToElement(IEditorInput input, IDocument document) {
+ if (document instanceof IDocumentExtension3) {
+ IDocumentExtension3 extension = (IDocumentExtension3) document;
+ if (extension.getDocumentPartitioner(IShellPartitions.SHELL_PARTITIONING) == null) {
+ ShellDocumentSetupParticipant participant = new ShellDocumentSetupParticipant();
+ participant.setup(document);
+ }
+ }
+ }
+
+ @Override
+ public String getEditorId() {
+ return EDITOR_ID;
+ }
+
+ @Override
+ public IDLTKLanguageToolkit getLanguageToolkit() {
+ return ShellScriptLanguageToolkit.getDefault();
+ }
+
+ @Override
+ public IPreferenceStore getScriptPreferenceStore() {
+ return Activator.getDefault().getPreferenceStore();
+ }
+
+ @Override
+ public ScriptTextTools getTextTools() {
+ return Activator.getDefault().getTextTools();
+ }
+
+ @Override
+ protected void initializeEditor() {
+ super.initializeEditor();
+ setEditorContextMenuId(EDITOR_CONTEXT);
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/editor/ShellSourceViewerConfiguration.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/editor/ShellSourceViewerConfiguration.java
new file mode 100644
index 0000000..bae23eb
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/editor/ShellSourceViewerConfiguration.java
@@ -0,0 +1,224 @@
+/*******************************************************************************
+ * Copyright (c) 2009-2010 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.editor;
+
+import java.util.ArrayList;
+
+import org.eclipse.dltk.sh.ui.Activator;
+import org.eclipse.dltk.sh.ui.IShellColorConstants;
+import org.eclipse.dltk.sh.ui.ShellContentAssistPreference;
+import org.eclipse.dltk.sh.ui.completion.ShellCompletionProcessor;
+import org.eclipse.dltk.sh.ui.text.DoubleQuoteScanner;
+import org.eclipse.dltk.sh.ui.text.EvalScanner;
+import org.eclipse.dltk.sh.ui.text.IShellPartitions;
+import org.eclipse.dltk.sh.ui.text.IndentType;
+import org.eclipse.dltk.sh.ui.text.ScriptAutoIndentStrategy;
+import org.eclipse.dltk.sh.ui.text.ShellCodeScanner;
+import org.eclipse.dltk.sh.ui.text.WhitespaceDetector;
+import org.eclipse.dltk.ui.text.AbstractScriptScanner;
+import org.eclipse.dltk.ui.text.IColorManager;
+import org.eclipse.dltk.ui.text.ScriptOutlineInformationControl;
+import org.eclipse.dltk.ui.text.ScriptPresentationReconciler;
+import org.eclipse.dltk.ui.text.ScriptSourceViewerConfiguration;
+import org.eclipse.dltk.ui.text.SingleTokenScriptScanner;
+import org.eclipse.dltk.ui.text.completion.ContentAssistPreference;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.presentation.IPresentationReconciler;
+import org.eclipse.jface.text.presentation.PresentationReconciler;
+import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.IWordDetector;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WhitespaceRule;
+import org.eclipse.jface.text.rules.WordRule;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+public class ShellSourceViewerConfiguration extends ScriptSourceViewerConfiguration {
+
+ private static IRule getKeywords(IToken keywordToken, final String[] words, IToken defaultToken) {
+ WordRule wordL = new WordRule(new IWordDetector() {
+
+ @Override
+ public boolean isWordPart(char c) {
+ return !Character.isWhitespace(c);
+ }
+
+ @Override
+ public boolean isWordStart(char c) {
+ return !Character.isWhitespace(c);
+ }
+ }, defaultToken);
+
+ for (String word : words)
+ wordL.addWord(word, keywordToken);
+ return wordL;
+ }
+
+ // Scanners for all the various content types provided by the partitioner
+ private AbstractScriptScanner fCodeScanner;
+ private AbstractScriptScanner fCommentScanner;
+ private AbstractScriptScanner fDoubleQuoteScanner;
+ private AbstractScriptScanner fParamScanner;
+ private AbstractScriptScanner fEvalScanner;
+ private AbstractScriptScanner fHashbangScanner;
+ private AbstractScriptScanner fFunctionScanner;
+ private AbstractScriptScanner fSingleQuoteScanner;
+
+ public ShellSourceViewerConfiguration(IColorManager colorManager, IPreferenceStore preferenceStore,
+ ITextEditor editor, String partitioning) {
+ super(colorManager, preferenceStore, editor, partitioning);
+ }
+
+ @Override
+ public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
+ ScriptAutoIndentStrategy strategy = new ScriptAutoIndentStrategy();
+
+ ArrayList<IRule> rules = new ArrayList<>();
+ rules.add(new WhitespaceRule(new WhitespaceDetector()));
+ rules.add(getKeywords(new Token(IndentType.INCREMENT), new String[] { "do", "case", "{", "then" },
+ Token.UNDEFINED));
+ rules.add(getKeywords(new Token(IndentType.DECREMENT), new String[] { "done", "esac", "}", "fi" },
+ Token.UNDEFINED));
+ rules.add(getKeywords(new Token(IndentType.INFLEXION), new String[] { "else" }, Token.UNDEFINED));
+
+ strategy.setRules(rules.toArray(new IRule[0]));
+
+ return new IAutoEditStrategy[] { strategy };
+ }
+
+ @Override
+ protected ContentAssistPreference getContentAssistPreference() {
+ return ShellContentAssistPreference.getDefault();
+ }
+
+ @Override
+ protected IInformationControlCreator getOutlinePresenterControlCreator(ISourceViewer sourceViewer,
+ final String commandId) {
+ return new IInformationControlCreator() {
+ @Override
+ public IInformationControl createInformationControl(Shell parent) {
+ int shellStyle = SWT.RESIZE;
+ int treeStyle = SWT.V_SCROLL | SWT.H_SCROLL;
+ return new ScriptOutlineInformationControl(parent, shellStyle, treeStyle, commandId,
+ Activator.getDefault().getPreferenceStore());
+ }
+ };
+ }
+
+ @Override
+ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
+ PresentationReconciler reconciler = new ScriptPresentationReconciler();
+ reconciler.setDocumentPartitioning(this.getConfiguredDocumentPartitioning(sourceViewer));
+
+ DefaultDamagerRepairer dr;
+
+ dr = new DefaultDamagerRepairer(this.fCodeScanner);
+ reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
+ reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
+
+ dr = new DefaultDamagerRepairer(this.fHashbangScanner);
+ reconciler.setDamager(dr, IShellPartitions.HASHBANG_CONTENT_TYPE);
+ reconciler.setRepairer(dr, IShellPartitions.HASHBANG_CONTENT_TYPE);
+
+ dr = new DefaultDamagerRepairer(this.fParamScanner);
+ reconciler.setDamager(dr, IShellPartitions.PARAM_CONTENT_TYPE);
+ reconciler.setRepairer(dr, IShellPartitions.PARAM_CONTENT_TYPE);
+
+ dr = new DefaultDamagerRepairer(this.fFunctionScanner);
+ reconciler.setDamager(dr, IShellPartitions.FUNCTION_CONTENT_TYPE);
+ reconciler.setRepairer(dr, IShellPartitions.FUNCTION_CONTENT_TYPE);
+
+ dr = new DefaultDamagerRepairer(this.fSingleQuoteScanner);
+ reconciler.setDamager(dr, IShellPartitions.SINGLE_QUOTE_CONTENT_TYPE);
+ reconciler.setRepairer(dr, IShellPartitions.SINGLE_QUOTE_CONTENT_TYPE);
+
+ dr = new DefaultDamagerRepairer(this.fDoubleQuoteScanner);
+ reconciler.setDamager(dr, IShellPartitions.DOUBLE_QUOTE_CONTENT_TYPE);
+ reconciler.setRepairer(dr, IShellPartitions.DOUBLE_QUOTE_CONTENT_TYPE);
+
+ dr = new DefaultDamagerRepairer(this.fEvalScanner);
+ reconciler.setDamager(dr, IShellPartitions.EVAL_CONTENT_TYPE);
+ reconciler.setRepairer(dr, IShellPartitions.EVAL_CONTENT_TYPE);
+
+ dr = new DefaultDamagerRepairer(this.fCommentScanner);
+ reconciler.setDamager(dr, IShellPartitions.COMMENT_CONTENT_TYPE);
+ reconciler.setRepairer(dr, IShellPartitions.COMMENT_CONTENT_TYPE);
+
+ return reconciler;
+ }
+
+ // This method called from base class.
+ @Override
+ protected void initializeScanners() {
+ // This is our code scanner
+ this.fCodeScanner = new ShellCodeScanner(this.getColorManager(), this.fPreferenceStore);
+ // This is default scanners for partitions with same color.
+ this.fFunctionScanner = new SingleTokenScriptScanner(this.getColorManager(), this.fPreferenceStore,
+ IShellColorConstants.SHELL_FUNCTION);
+ this.fHashbangScanner = new SingleTokenScriptScanner(this.getColorManager(), this.fPreferenceStore,
+ IShellColorConstants.SHELL_HASHBANG);
+ this.fSingleQuoteScanner = new SingleTokenScriptScanner(this.getColorManager(), this.fPreferenceStore,
+ IShellColorConstants.SHELL_SINGLE_QUOTE);
+ this.fDoubleQuoteScanner = new DoubleQuoteScanner(this.getColorManager(), this.fPreferenceStore);
+ this.fParamScanner = new SingleTokenScriptScanner(this.getColorManager(), this.fPreferenceStore,
+ IShellColorConstants.SHELL_VARIABLE);
+ this.fEvalScanner = new EvalScanner(this.getColorManager(), this.fPreferenceStore);
+ this.fCommentScanner = createCommentScanner(IShellColorConstants.SHELL_COMMENT,
+ IShellColorConstants.SHELL_TODO_TAG);
+ }
+
+ @Override
+ protected void alterContentAssistant(ContentAssistant assistant) {
+ IContentAssistProcessor scriptProcessor = new ShellCompletionProcessor(getEditor(), assistant,
+ IDocument.DEFAULT_CONTENT_TYPE);
+ assistant.setContentAssistProcessor(scriptProcessor, IDocument.DEFAULT_CONTENT_TYPE);
+ }
+
+ @Override
+ public boolean affectsTextPresentation(PropertyChangeEvent event) {
+ return fCodeScanner.affectsBehavior(event) || fCommentScanner.affectsBehavior(event)
+ || fDoubleQuoteScanner.affectsBehavior(event) || fSingleQuoteScanner.affectsBehavior(event)
+ || fFunctionScanner.affectsBehavior(event) || fParamScanner.affectsBehavior(event)
+ || fEvalScanner.affectsBehavior(event) || fHashbangScanner.affectsBehavior(event);
+ }
+
+ @Override
+ public void handlePropertyChangeEvent(PropertyChangeEvent event) {
+ if (fCodeScanner.affectsBehavior(event))
+ fCodeScanner.adaptToPreferenceChange(event);
+ if (fCommentScanner.affectsBehavior(event))
+ fCommentScanner.adaptToPreferenceChange(event);
+ if (fDoubleQuoteScanner.affectsBehavior(event))
+ fDoubleQuoteScanner.adaptToPreferenceChange(event);
+ if (fSingleQuoteScanner.affectsBehavior(event))
+ fSingleQuoteScanner.adaptToPreferenceChange(event);
+ if (fFunctionScanner.affectsBehavior(event))
+ fFunctionScanner.adaptToPreferenceChange(event);
+ if (fParamScanner.affectsBehavior(event))
+ fParamScanner.adaptToPreferenceChange(event);
+ if (fEvalScanner.affectsBehavior(event))
+ fEvalScanner.adaptToPreferenceChange(event);
+ if (fHashbangScanner.affectsBehavior(event))
+ fHashbangScanner.adaptToPreferenceChange(event);
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/AddShellScriptInterpreterDialog.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/AddShellScriptInterpreterDialog.java
new file mode 100644
index 0000000..8a4c47e
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/AddShellScriptInterpreterDialog.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.interpreter;
+
+import org.eclipse.dltk.internal.debug.ui.interpreters.AbstractInterpreterLibraryBlock;
+import org.eclipse.dltk.internal.debug.ui.interpreters.AddScriptInterpreterDialog;
+import org.eclipse.dltk.internal.debug.ui.interpreters.IAddInterpreterDialogRequestor;
+import org.eclipse.dltk.launching.IInterpreterInstall;
+import org.eclipse.dltk.launching.IInterpreterInstallType;
+import org.eclipse.swt.widgets.Shell;
+
+public class AddShellScriptInterpreterDialog extends AddScriptInterpreterDialog {
+ public AddShellScriptInterpreterDialog(IAddInterpreterDialogRequestor requestor, Shell shell,
+ IInterpreterInstallType[] interpreterInstallTypes, IInterpreterInstall editedInterpreter) {
+ super(requestor, shell, interpreterInstallTypes, editedInterpreter);
+ }
+
+ @Override
+ protected AbstractInterpreterLibraryBlock createLibraryBlock(AddScriptInterpreterDialog dialog) {
+ return new ShellScriptInterpreterLibraryBlock(dialog);
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellInterpreterPreferencePage.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellInterpreterPreferencePage.java
new file mode 100644
index 0000000..be5f1e2
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellInterpreterPreferencePage.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.interpreter;
+
+import org.eclipse.dltk.internal.debug.ui.interpreters.InterpretersBlock;
+import org.eclipse.dltk.internal.debug.ui.interpreters.ScriptInterpreterPreferencePage;
+
+public class ShellInterpreterPreferencePage extends ScriptInterpreterPreferencePage {
+
+ public static final String PAGE_ID = "org.eclipse.dltk.sh.ui.preferences.interpreters";
+
+ @Override
+ public InterpretersBlock createInterpretersBlock() {
+ return new ShellScriptInterpretersBlock();
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellMainLaunchConfigurationTab.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellMainLaunchConfigurationTab.java
new file mode 100644
index 0000000..953b297
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellMainLaunchConfigurationTab.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.interpreter;
+
+import org.eclipse.dltk.core.PreferencesLookupDelegate;
+import org.eclipse.dltk.debug.ui.launchConfigurations.MainLaunchConfigurationTab;
+import org.eclipse.dltk.sh.core.ShelledNature;
+
+public class ShellMainLaunchConfigurationTab extends MainLaunchConfigurationTab {
+
+ public ShellMainLaunchConfigurationTab(String mode) {
+ super(mode);
+ }
+
+ @Override
+ protected boolean breakOnFirstLinePrefEnabled(PreferencesLookupDelegate delegate) {
+ return false;
+ }
+
+ @Override
+ protected boolean dbpgLoggingPrefEnabled(PreferencesLookupDelegate delegate) {
+ return false;
+ }
+
+ @Override
+ public String getNatureID() {
+ return ShelledNature.SHELLED_NATURE;
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInstall.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInstall.java
new file mode 100644
index 0000000..ce6c9a6
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInstall.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.interpreter;
+
+import org.eclipse.dltk.internal.launching.StandardInterpreterRunner;
+import org.eclipse.dltk.launching.AbstractInterpreterInstall;
+import org.eclipse.dltk.launching.IInterpreterInstallType;
+import org.eclipse.dltk.launching.IInterpreterRunner;
+import org.eclipse.dltk.sh.core.ShelledNature;
+
+public class ShellScriptInstall extends AbstractInterpreterInstall {
+ public ShellScriptInstall(IInterpreterInstallType type, String id) {
+ super(type, id);
+ }
+
+ @Override
+ public String getNatureId() {
+ return ShelledNature.SHELLED_NATURE;
+ }
+
+ @Override
+ public IInterpreterRunner getInterpreterRunner(String mode) {
+ return new StandardInterpreterRunner(this);
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInstallType.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInstallType.java
new file mode 100644
index 0000000..2437b8d
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInstallType.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.interpreter;
+
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.dltk.core.environment.IDeployment;
+import org.eclipse.dltk.core.environment.IFileHandle;
+import org.eclipse.dltk.internal.launching.AbstractInterpreterInstallType;
+import org.eclipse.dltk.launching.EnvironmentVariable;
+import org.eclipse.dltk.launching.IInterpreterInstall;
+import org.eclipse.dltk.launching.LibraryLocation;
+import org.eclipse.dltk.sh.core.ShelledNature;
+import org.eclipse.dltk.sh.ui.Activator;
+
+public class ShellScriptInstallType extends AbstractInterpreterInstallType {
+ private static final String[] INTERPRETER_NAMES = { "sh", "bash", "zsh", "dash", "ksh", "tcsh", "csh" };
+
+ @Override
+ protected IPath createPathFile(IDeployment deployment) {
+ return null;
+ }
+
+ @Override
+ public synchronized LibraryLocation[] getDefaultLibraryLocations(IFileHandle installLocation,
+ EnvironmentVariable[] variables, IProgressMonitor monitor) {
+ return new LibraryLocation[0];
+ }
+
+ @Override
+ protected IInterpreterInstall doCreateInterpreterInstall(String id) {
+ return new ShellScriptInstall(this, id);
+ }
+
+ @Override
+ protected ILog getLog() {
+ return Activator.getDefault().getLog();
+ }
+
+ @Override
+ public String getName() {
+ return "Shell Interpreter";
+ }
+
+ @Override
+ public String getNatureId() {
+ return ShelledNature.SHELLED_NATURE;
+ }
+
+ @Override
+ protected String getPluginId() {
+ return Activator.PLUGIN_ID;
+ }
+
+ @Override
+ protected String[] getPossibleInterpreterNames() {
+ return INTERPRETER_NAMES;
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInterpreterLibraryBlock.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInterpreterLibraryBlock.java
new file mode 100644
index 0000000..36fd0ec
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInterpreterLibraryBlock.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.interpreter;
+
+import org.eclipse.dltk.internal.debug.ui.interpreters.AbstractInterpreterLibraryBlock;
+import org.eclipse.dltk.internal.debug.ui.interpreters.AddScriptInterpreterDialog;
+import org.eclipse.dltk.internal.debug.ui.interpreters.LibraryLabelProvider;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+
+public class ShellScriptInterpreterLibraryBlock extends AbstractInterpreterLibraryBlock {
+ public ShellScriptInterpreterLibraryBlock(AddScriptInterpreterDialog d) {
+ super(d);
+ }
+
+ @Override
+ protected IBaseLabelProvider getLabelProvider() {
+ return new LibraryLabelProvider();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInterpretersBlock.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInterpretersBlock.java
new file mode 100644
index 0000000..c90c543
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellScriptInterpretersBlock.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.interpreter;
+
+import org.eclipse.dltk.core.environment.IEnvironment;
+import org.eclipse.dltk.internal.debug.ui.interpreters.AddScriptInterpreterDialog;
+import org.eclipse.dltk.internal.debug.ui.interpreters.InterpretersBlock;
+import org.eclipse.dltk.launching.IInterpreterInstall;
+import org.eclipse.dltk.launching.ScriptRuntime;
+import org.eclipse.dltk.sh.core.ShelledNature;
+
+public class ShellScriptInterpretersBlock extends InterpretersBlock {
+ @Override
+ protected AddScriptInterpreterDialog createInterpreterDialog(IEnvironment environment,
+ IInterpreterInstall standin) {
+ AddShellScriptInterpreterDialog dialog = new AddShellScriptInterpreterDialog(this, getShell(),
+ ScriptRuntime.getInterpreterInstallTypes(getCurrentNature()), standin);
+ dialog.setEnvironment(environment);
+ return dialog;
+ }
+
+ @Override
+ protected String getCurrentNature() {
+ return ShelledNature.SHELLED_NATURE;
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellTabGroup.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellTabGroup.java
new file mode 100644
index 0000000..40c143a
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/interpreter/ShellTabGroup.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.interpreter;
+
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.dltk.debug.ui.launchConfigurations.MainLaunchConfigurationTab;
+import org.eclipse.dltk.debug.ui.launchConfigurations.ScriptArgumentsTab;
+import org.eclipse.dltk.debug.ui.launchConfigurations.ScriptCommonTab;
+
+public class ShellTabGroup extends AbstractLaunchConfigurationTabGroup {
+ @Override
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ MainLaunchConfigurationTab main = new ShellMainLaunchConfigurationTab(mode);
+ ScriptArgumentsTab args = new ScriptArgumentsTab();
+ ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { main, args, new ScriptCommonTab(main) };
+ setTabs(tabs);
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/PreviewFile.txt b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/PreviewFile.txt
new file mode 100644
index 0000000..7d36825
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/PreviewFile.txt
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ -z $VARIABLE ] ; then
+ echo "double quoted text" # some comment
+ echo 'single quoted text' # TODO tag
+ echo `command substitution`
+fi \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellColoringConfigurationBlock.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellColoringConfigurationBlock.java
new file mode 100644
index 0000000..ed85e0d
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellColoringConfigurationBlock.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.preferences;
+
+import java.io.InputStream;
+
+import org.eclipse.dltk.internal.ui.editor.ScriptSourceViewer;
+import org.eclipse.dltk.sh.ui.Activator;
+import org.eclipse.dltk.sh.ui.IShellColorConstants;
+import org.eclipse.dltk.sh.ui.editor.ShellDocumentSetupParticipant;
+import org.eclipse.dltk.sh.ui.text.IShellPartitions;
+import org.eclipse.dltk.ui.preferences.AbstractScriptEditorColoringConfigurationBlock;
+import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore;
+import org.eclipse.dltk.ui.text.IColorManager;
+import org.eclipse.dltk.ui.text.ScriptSourceViewerConfiguration;
+import org.eclipse.dltk.ui.text.ScriptTextTools;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.source.IOverviewRuler;
+import org.eclipse.jface.text.source.IVerticalRuler;
+import org.eclipse.jface.text.source.projection.ProjectionViewer;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+public class ShellColoringConfigurationBlock extends AbstractScriptEditorColoringConfigurationBlock {
+
+ private static final String PREVIEW_FILE_NAME = "PreviewFile.txt"; //$NON-NLS-1$
+
+ private static final String[][] fSyntaxColorListModel = new String[][] {
+ { "Comments", IShellColorConstants.SHELL_COMMENT, sCommentsCategory },
+ { "Hashbang", IShellColorConstants.SHELL_HASHBANG, sCommentsCategory },
+ { "TODO tags", IShellColorConstants.SHELL_TODO_TAG, sCommentsCategory },
+
+ { "Eval", IShellColorConstants.SHELL_EVAL, sCoreCategory },
+ { "Double quoted text", IShellColorConstants.SHELL_DOUBLE_QUOTE, sCoreCategory },
+ { "Function", IShellColorConstants.SHELL_FUNCTION, sCoreCategory },
+
+ { "Keyword", IShellColorConstants.SHELL_KEYWORD, sCoreCategory },
+
+ { "Single quoted text", IShellColorConstants.SHELL_SINGLE_QUOTE, sCoreCategory },
+ { "Variables", IShellColorConstants.SHELL_VARIABLE, sCoreCategory },
+ { "Commands", IShellColorConstants.SHELL_COMMAND, sCoreCategory },
+ { "Default", IShellColorConstants.SHELL_DEFAULT, sCoreCategory }
+
+ };
+
+ public ShellColoringConfigurationBlock(OverlayPreferenceStore store) {
+ super(store);
+ }
+
+ @Override
+ protected String[][] getSyntaxColorListModel() {
+ return fSyntaxColorListModel;
+ }
+
+ @Override
+ protected ProjectionViewer createPreviewViewer(Composite parent, IVerticalRuler verticalRuler,
+ IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles, IPreferenceStore store) {
+ return new ScriptSourceViewer(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles, store);
+ }
+
+ @Override
+ protected ScriptSourceViewerConfiguration createSimpleSourceViewerConfiguration(IColorManager colorManager,
+ IPreferenceStore preferenceStore, ITextEditor editor, boolean configureFormatter) {
+ return new SimpleShellSourceViewerConfiguration(colorManager, preferenceStore, editor,
+ IShellPartitions.SHELL_PARTITIONING, true);
+ }
+
+ @Override
+ protected void setDocumentPartitioning(IDocument document) {
+ ShellDocumentSetupParticipant participant = new ShellDocumentSetupParticipant();
+ participant.setup(document);
+ }
+
+ @Override
+ protected InputStream getPreviewContentReader() {
+ return getClass().getResourceAsStream(PREVIEW_FILE_NAME);
+ }
+
+ @Override
+ protected ScriptTextTools getTextTools() {
+ return Activator.getDefault().getTextTools();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellEditorPreferencesPage.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellEditorPreferencesPage.java
new file mode 100644
index 0000000..38ac9b3
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellEditorPreferencesPage.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.preferences;
+
+import org.eclipse.dltk.sh.ui.Activator;
+import org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPreferencePage;
+import org.eclipse.dltk.ui.preferences.EditorConfigurationBlock;
+import org.eclipse.dltk.ui.preferences.IPreferenceConfigurationBlock;
+import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore;
+
+public class ShellEditorPreferencesPage extends AbstractConfigurationBlockPreferencePage {
+
+ @Override
+ protected String getHelpId() {
+ return null;
+ }
+
+ @Override
+ protected void setDescription() {
+ setDescription("Shell Script Editor preferences");
+ }
+
+ @Override
+ protected void setPreferenceStore() {
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ }
+
+ @Override
+ protected IPreferenceConfigurationBlock createConfigurationBlock(OverlayPreferenceStore overlayPreferenceStore) {
+ return new EditorConfigurationBlock(this, overlayPreferenceStore);
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellFoldingPreferencePage.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellFoldingPreferencePage.java
new file mode 100644
index 0000000..09f48d1
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellFoldingPreferencePage.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat Inc. and others.
+ * 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:
+ * Peter Palaga - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.preferences;
+
+import org.eclipse.dltk.sh.ui.Activator;
+import org.eclipse.dltk.sh.ui.text.folding.ShellCodeFoldingPreferenceBlock;
+import org.eclipse.dltk.sh.ui.text.folding.ShellCommentFoldingPreferenceBlock;
+import org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPreferencePage;
+import org.eclipse.dltk.ui.preferences.IPreferenceConfigurationBlock;
+import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore;
+import org.eclipse.dltk.ui.text.folding.DefaultFoldingPreferenceConfigurationBlock;
+import org.eclipse.dltk.ui.text.folding.IFoldingPreferenceBlock;
+import org.eclipse.jface.preference.PreferencePage;
+
+/**
+ * A couple of usual folding options.
+ */
+public class ShellFoldingPreferencePage extends AbstractConfigurationBlockPreferencePage {
+ @Override
+ protected String getHelpId() {
+ return null;
+ }
+
+ @Override
+ protected void setDescription() {
+ }
+
+ @Override
+ protected void setPreferenceStore() {
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ }
+
+ @Override
+ protected IPreferenceConfigurationBlock createConfigurationBlock(OverlayPreferenceStore overlayPreferenceStore) {
+ return new DefaultFoldingPreferenceConfigurationBlock(overlayPreferenceStore, this) {
+ @Override
+ protected IFoldingPreferenceBlock createDocumentationBlock(OverlayPreferenceStore store,
+ PreferencePage page) {
+ return new ShellCommentFoldingPreferenceBlock(store, page);
+ }
+
+ @Override
+ protected IFoldingPreferenceBlock createSourceCodeBlock(OverlayPreferenceStore store, PreferencePage page) {
+ return new ShellCodeFoldingPreferenceBlock(store, page);
+ }
+ };
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellSyntaxColoringPreferencePage.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellSyntaxColoringPreferencePage.java
new file mode 100644
index 0000000..f002923
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellSyntaxColoringPreferencePage.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.preferences;
+
+import org.eclipse.dltk.sh.ui.Activator;
+import org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPreferencePage;
+import org.eclipse.dltk.ui.preferences.IPreferenceConfigurationBlock;
+import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore;
+
+public class ShellSyntaxColoringPreferencePage extends AbstractConfigurationBlockPreferencePage {
+
+ @Override
+ protected String getHelpId() {
+ return null;
+ }
+
+ @Override
+ protected void setDescription() {
+ // leave blank
+ }
+
+ @Override
+ protected void setPreferenceStore() {
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ }
+
+ @Override
+ protected IPreferenceConfigurationBlock createConfigurationBlock(OverlayPreferenceStore overlayPreferenceStore) {
+ return new ShellColoringConfigurationBlock(overlayPreferenceStore);
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellTodoTaskPreferencePage.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellTodoTaskPreferencePage.java
new file mode 100644
index 0000000..fc0b3d0
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/ShellTodoTaskPreferencePage.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.preferences;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.dltk.sh.core.ShelledNature;
+import org.eclipse.dltk.sh.ui.Activator;
+import org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPropertyAndPreferencePage;
+import org.eclipse.dltk.ui.preferences.AbstractOptionsBlock;
+import org.eclipse.dltk.ui.preferences.TodoTaskOptionsBlock;
+import org.eclipse.dltk.ui.util.IStatusChangeListener;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+
+public class ShellTodoTaskPreferencePage extends AbstractConfigurationBlockPropertyAndPreferencePage {
+
+ @Override
+ protected String getHelpId() {
+ return null;
+ }
+
+ @Override
+ protected void setDescription() {
+ setDescription("Strings indicating tasks in Shell Script comments.");
+ }
+
+ @Override
+ protected AbstractOptionsBlock createOptionsBlock(IStatusChangeListener newStatusChangedListener, IProject project,
+ IWorkbenchPreferenceContainer container) {
+ return new TodoTaskOptionsBlock(newStatusChangedListener, project, container, Activator.PLUGIN_ID);
+ }
+
+ @Override
+ protected String getNatureId() {
+ return ShelledNature.SHELLED_NATURE;
+ }
+
+ @Override
+ protected String getProjectHelpId() {
+ return null;
+ }
+
+ @Override
+ protected void setPreferenceStore() {
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ }
+
+ @Override
+ protected String getPreferencePageId() {
+ return "org.eclipse.dltk.sh.todo";
+ }
+
+ @Override
+ protected String getPropertyPageId() {
+ return "org.eclipse.dltk.sh.todo";
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/SimpleShellSourceViewerConfiguration.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/SimpleShellSourceViewerConfiguration.java
new file mode 100644
index 0000000..fdb3046
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/preferences/SimpleShellSourceViewerConfiguration.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.preferences;
+
+import org.eclipse.dltk.sh.ui.editor.ShellSourceViewerConfiguration;
+import org.eclipse.dltk.ui.text.IColorManager;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.formatter.IContentFormatter;
+import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
+import org.eclipse.jface.text.information.IInformationPresenter;
+import org.eclipse.jface.text.source.IAnnotationHover;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+public class SimpleShellSourceViewerConfiguration extends ShellSourceViewerConfiguration {
+
+ private final boolean changeFormatter;
+
+ public SimpleShellSourceViewerConfiguration(IColorManager colorManager, IPreferenceStore preferenceStore,
+ ITextEditor editor, String partitioning, boolean changeFormatter) {
+ super(colorManager, preferenceStore, editor, partitioning);
+ this.changeFormatter = changeFormatter;
+ }
+
+ @Override
+ public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
+ return null;
+ }
+
+ @Override
+ public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
+ return null;
+ }
+
+ @Override
+ public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) {
+ return null;
+ }
+
+ @Override
+ public int[] getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer, String contentType) {
+ return null;
+ }
+
+ @Override
+ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
+ return null;
+ }
+
+ @Override
+ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
+ return null;
+ }
+
+ @Override
+ public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
+ if (changeFormatter) {
+ return super.getContentFormatter(sourceViewer);
+ } else
+ return null;
+ }
+
+ @Override
+ public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) {
+ return null;
+ }
+
+ @Override
+ public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) {
+ return null;
+ }
+
+ @Override
+ public IInformationPresenter getOutlinePresenter(ISourceViewer sourceViewer, boolean doCodeResolve) {
+ return null;
+ }
+
+ @Override
+ public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
+ return null;
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/search/ShelledMatchLocationParser.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/search/ShelledMatchLocationParser.java
new file mode 100644
index 0000000..a588608
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/search/ShelledMatchLocationParser.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.search;
+
+import org.eclipse.dltk.ast.ASTNode;
+import org.eclipse.dltk.core.search.matching.MatchLocator;
+import org.eclipse.dltk.core.search.matching.MatchLocatorParser;
+import org.eclipse.dltk.core.search.matching.PatternLocator;
+
+public class ShelledMatchLocationParser extends MatchLocatorParser {
+ protected ShelledMatchLocationParser(MatchLocator locator) {
+ super(locator);
+ }
+
+ @Override
+ protected void processStatement(ASTNode node, PatternLocator locator) {
+ super.processStatement(node, locator);
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/search/ShelledSearchFactory.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/search/ShelledSearchFactory.java
new file mode 100644
index 0000000..d3ebf07
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/search/ShelledSearchFactory.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.search;
+
+import org.eclipse.dltk.core.search.AbstractSearchFactory;
+import org.eclipse.dltk.core.search.IMatchLocatorParser;
+import org.eclipse.dltk.core.search.matching.MatchLocator;
+
+public class ShelledSearchFactory extends AbstractSearchFactory {
+ @Override
+ public IMatchLocatorParser createMatchParser(MatchLocator locator) {
+ return new ShelledMatchLocationParser(locator);
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/search/ShelledSearchPage.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/search/ShelledSearchPage.java
new file mode 100644
index 0000000..66a4364
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/search/ShelledSearchPage.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.search;
+
+import org.eclipse.dltk.core.IDLTKLanguageToolkit;
+import org.eclipse.dltk.sh.core.ShellScriptLanguageToolkit;
+import org.eclipse.dltk.ui.search.ScriptSearchPage;
+
+public class ShelledSearchPage extends ScriptSearchPage {
+ @Override
+ protected IDLTKLanguageToolkit getLanguageToolkit() {
+ return ShellScriptLanguageToolkit.getDefault();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/selection/ShellDocumentationProvider.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/selection/ShellDocumentationProvider.java
new file mode 100644
index 0000000..5d72ea4
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/selection/ShellDocumentationProvider.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.selection;
+
+import java.io.Reader;
+import java.io.StringReader;
+
+import org.eclipse.dltk.core.IMember;
+import org.eclipse.dltk.ui.documentation.IScriptDocumentationProvider;
+import org.eclipse.linuxtools.man.parser.ManPage;
+
+public class ShellDocumentationProvider implements IScriptDocumentationProvider {
+
+ @Override
+ public Reader getInfo(String content) {
+ return new StringReader(new ManPage(content).getStrippedHtmlPage().toString());
+ }
+
+ @Override
+ public Reader getInfo(IMember element, boolean lookIntoParents, boolean lookIntoExternal) {
+ // TODO show comments for functions if there is any
+ return null;
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/selection/ShelledSelectionEngine.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/selection/ShelledSelectionEngine.java
new file mode 100644
index 0000000..d57c2be
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/selection/ShelledSelectionEngine.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.selection;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.dltk.ast.ASTVisitor;
+import org.eclipse.dltk.ast.declarations.MethodDeclaration;
+import org.eclipse.dltk.ast.declarations.ModuleDeclaration;
+import org.eclipse.dltk.ast.expressions.Expression;
+import org.eclipse.dltk.ast.expressions.MethodCallExpression;
+import org.eclipse.dltk.ast.references.VariableReference;
+import org.eclipse.dltk.codeassist.ScriptSelectionEngine;
+import org.eclipse.dltk.compiler.env.IModuleSource;
+import org.eclipse.dltk.core.DLTKCore;
+import org.eclipse.dltk.core.IModelElement;
+import org.eclipse.dltk.core.IModelElementVisitor;
+import org.eclipse.dltk.core.ISourceModule;
+import org.eclipse.dltk.core.ModelException;
+import org.eclipse.dltk.core.SourceParserUtil;
+
+public class ShelledSelectionEngine extends ScriptSelectionEngine {
+ private ISourceModule sourceModule;
+
+ @Override
+ public IModelElement[] select(IModuleSource module, final int offset, int i) {
+ sourceModule = (ISourceModule) module.getModelElement();
+ ModuleDeclaration moduleDeclaration = SourceParserUtil.getModuleDeclaration(sourceModule, null);
+ final List<IModelElement> results = new ArrayList<>();
+ try {
+ moduleDeclaration.traverse(new ASTVisitor() {
+ @Override
+ public boolean visit(Expression s) throws Exception {
+ if ((s.sourceStart() <= offset) && (offset <= s.sourceEnd())) {
+ if (s instanceof MethodCallExpression) {
+ findDeclaration(((MethodCallExpression) s).getName(), results);
+ }
+ if (s instanceof VariableReference) {
+ findDeclaration(((VariableReference) s).getName(), results);
+ }
+ }
+ return super.visit(s);
+ }
+
+ @Override
+ public boolean visit(MethodDeclaration s) throws Exception {
+ if ((s.getNameStart() <= offset) && (offset <= s.getNameEnd())) {
+ findDeclaration(s.getName(), results);
+ }
+ return super.visit(s);
+ }
+
+ });
+ } catch (Exception e) {
+ if (DLTKCore.DEBUG) {
+ e.printStackTrace();
+ }
+ }
+ return results.toArray(new IModelElement[results.size()]);
+ }
+
+ private void findDeclaration(final String name, final List<IModelElement> results) {
+ try {
+ this.sourceModule.accept(new IModelElementVisitor() {
+ @Override
+ public boolean visit(IModelElement element) {
+ if (element.getElementName().equals(name)) {
+ results.add(element);
+ }
+ return true;
+ }
+ });
+ } catch (ModelException e) {
+ if (DLTKCore.DEBUG) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/AssignmentDetector.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/AssignmentDetector.java
new file mode 100644
index 0000000..0eb5427
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/AssignmentDetector.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Mat Booth and others.
+ * 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:
+ * Mat Booth
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text;
+
+import org.eclipse.jface.text.rules.IWordDetector;
+
+/**
+ * Determines whether given any given character forms part of a shell
+ * assignment.
+ */
+public class AssignmentDetector implements IWordDetector {
+
+ @Override
+ public boolean isWordPart(char c) {
+ return Character.isJavaIdentifierPart(c) || (c == '[') || (c == ']');
+ }
+
+ @Override
+ public boolean isWordStart(char c) {
+ return Character.isJavaIdentifierStart(c);
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/AssignmentRule.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/AssignmentRule.java
new file mode 100644
index 0000000..fb5f885
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/AssignmentRule.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.IWordDetector;
+import org.eclipse.jface.text.rules.Token;
+
+public class AssignmentRule implements IRule {
+ private final StringBuffer buffer = new StringBuffer();
+ private final IToken defaultToken;
+ private final IWordDetector detector;
+ private final IToken successToken;
+
+ public AssignmentRule(IWordDetector detector, IToken defaultToken, IToken token) {
+ this.detector = detector;
+ this.successToken = token;
+ this.defaultToken = defaultToken;
+ }
+
+ @Override
+ public IToken evaluate(ICharacterScanner scanner) {
+ char c = (char) scanner.read();
+ if (detector.isWordStart((c))) {
+ buffer.setLength(0);
+ do {
+ buffer.append((c));
+ c = (char) scanner.read();
+ } while ((c != ICharacterScanner.EOF) && detector.isWordPart(c));
+ scanner.unread();
+ if (c == '=')
+ return successToken;
+ if (defaultToken.isUndefined())
+ unreadBuffer(scanner);
+ return defaultToken;
+ }
+ scanner.unread();
+ return Token.UNDEFINED;
+ }
+
+ /**
+ * Returns the characters in the buffer to the scanner.
+ *
+ * @param scanner
+ * the scanner to be used
+ */
+ protected void unreadBuffer(ICharacterScanner scanner) {
+ for (int i = buffer.length() - 1; i >= 0; i--)
+ scanner.unread();
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DocumentAndCommandScanner.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DocumentAndCommandScanner.java
new file mode 100644
index 0000000..d860d61
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DocumentAndCommandScanner.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DocumentCommand;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+
+/**
+ * This scanner extends the normal rule based scanner by adding the ability to
+ * read DocumentCommands as well as IDocuments. This ability is toggled on or
+ * off depending on whether setRange(document,offset,length) (off) or
+ * setRange(document,documentCommand,offset,length) (on) was called.
+ *
+ * @author Doug Satchwell
+ * @version $Id: DocumentAndCommandScanner.java,v 1.2 2008/12/02 21:59:55
+ * akurtakov Exp $
+ */
+public class DocumentAndCommandScanner extends RuleBasedScanner {
+ private DocumentCommand fDocumentCommand;
+
+ @Override
+ public int read() {
+ try {
+ if (fOffset < fRangeEnd) {
+ try {
+ return fDocument.getChar(fOffset);
+ } catch (BadLocationException e) {
+ }
+ }
+ if ((fDocumentCommand != null) && (fOffset < (fRangeEnd + fDocumentCommand.text.length()))) {
+ return fDocumentCommand.text.charAt(((fRangeEnd + fDocumentCommand.text.length()) - fOffset) - 1);
+ }
+ return EOF;
+ } finally {
+ ++fOffset;
+ }
+ }
+
+ /**
+ * Set this to use as a normal in conjunction with DocumentCommand's
+ */
+ public void setRange(IDocument document, DocumentCommand documentCommand, int offset, int length) {
+ setRange(document, offset, length);
+ fDocumentCommand = documentCommand;
+ }
+
+ /**
+ * Set this to use as a normal RuleBasedScanner
+ */
+ @Override
+ public void setRange(IDocument document, int offset, int length) {
+ super.setRange(document, offset, length);
+ fDocumentCommand = null;
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DollarBraceCountingRule.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DollarBraceCountingRule.java
new file mode 100644
index 0000000..a23af99
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DollarBraceCountingRule.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Mat Booth and others.
+ * 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
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.PatternRule;
+
+/**
+ * This rule captures a pattern that begins with '$' and an opening brace and
+ * ends with a closed brace. This is used for highlighting ${} or $() blocks. It
+ * counts the opening and closing braces as it encounters them to make sure we
+ * always end at the correct closing brace or the end of the line, which ever
+ * comes first.
+ */
+public class DollarBraceCountingRule extends PatternRule {
+
+ private char[][] fLineDelimiters;
+ private char[][] fSortedLineDelimiters;
+
+ private final char fOpening;
+ private final char fClosing;
+ private int fBraceCount;
+
+ /**
+ * Creates a rule for the given opening and closing braces. When these
+ * braces are detected the rule will return the specified token.
+ * Alternatively, the sequence can also be ended by the end of the line. Any
+ * character which follows the given escapeCharacter will be ignored.
+ *
+ * @param openingBrace
+ * the pattern's start sequence
+ * @param closingBrace
+ * the pattern's end sequence, <code>null</code> is a legal value
+ * @param token
+ * the token which will be returned on success
+ * @param escapeChar
+ * any character following this one will be ignored
+ */
+ public DollarBraceCountingRule(char openingBrace, char closingBrace, IToken token, char escapeChar) {
+ super("$" + Character.toString(openingBrace), Character.toString(closingBrace), token, escapeChar, true, false,
+ false);
+ fOpening = openingBrace;
+ fClosing = closingBrace;
+ }
+
+ /**
+ * This method is rather more or less identical to the super class
+ * implementation with the exception that instead of checking for the end
+ * sequence, it counts occurrences of braces and returns successfully when
+ * the number of closing braces encountered equals the number of opening
+ * braces.
+ *
+ * @see org.eclipse.jface.text.rules.PatternRule#endSequenceDetected(org.eclipse.jface.text.rules.ICharacterScanner)
+ */
+ @Override
+ protected boolean endSequenceDetected(ICharacterScanner scanner) {
+ char[][] originalDelimiters = scanner.getLegalLineDelimiters();
+ int count = originalDelimiters.length;
+ if ((fLineDelimiters == null) || (originalDelimiters.length != count)) {
+ fSortedLineDelimiters = new char[count][];
+ } else {
+ while ((count > 0) && (fLineDelimiters[count - 1] == originalDelimiters[count - 1]))
+ count--;
+ }
+ if (count != 0) {
+ fLineDelimiters = originalDelimiters;
+ System.arraycopy(fLineDelimiters, 0, fSortedLineDelimiters, 0, fLineDelimiters.length);
+ }
+
+ int readCount = 1;
+ int c;
+ fBraceCount = 1;
+ while ((c = scanner.read()) != ICharacterScanner.EOF) {
+ if (c == fEscapeCharacter) {
+ // Skip escaped character(s)
+ if (fEscapeContinuesLine) {
+ c = scanner.read();
+ for (char[] fSortedLineDelimiter : fSortedLineDelimiters) {
+ if ((c == fSortedLineDelimiter[0]) && sequenceDetected(scanner, fSortedLineDelimiter, true))
+ break;
+ }
+ } else
+ scanner.read();
+
+ } else if (c == fOpening) {
+ // Count opening braces
+ fBraceCount++;
+ } else if (c == fClosing) {
+ // Count closing braces
+ fBraceCount--;
+ // End successfully when the open brace count returns to zero
+ if (fBraceCount == 0)
+ return true;
+ } else if (fBreaksOnEOL) {
+ // Check for end of line since it can be used to terminate the
+ // pattern.
+ for (char[] fSortedLineDelimiter : fSortedLineDelimiters) {
+ if ((c == fSortedLineDelimiter[0]) && sequenceDetected(scanner, fSortedLineDelimiter, true))
+ return true;
+ }
+ }
+ readCount++;
+ }
+
+ if (fBreaksOnEOF)
+ return true;
+
+ for (; readCount > 0; readCount--)
+ scanner.unread();
+
+ return false;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DollarDetector.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DollarDetector.java
new file mode 100644
index 0000000..fcb8199
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DollarDetector.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text;
+
+import org.eclipse.jface.text.rules.IWordDetector;
+
+/**
+ * Determines whether given any given character forms part of a shell variable.
+ */
+public class DollarDetector implements IWordDetector {
+
+ @Override
+ public boolean isWordPart(char c) {
+ return Character.isJavaIdentifierPart(c);
+ }
+
+ @Override
+ public boolean isWordStart(char c) {
+ return c == '$';
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DollarRule.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DollarRule.java
new file mode 100644
index 0000000..0ee86e1
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DollarRule.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.IWordDetector;
+import org.eclipse.jface.text.rules.Token;
+
+/**
+ * This rule captures parameter expansions that are not covered by
+ * DollarBraceCountingRule. That is, all dollar-prefixed variables including
+ * special variables where encapsulation in braces is not necessary.
+ */
+public class DollarRule implements IRule {
+
+ private final StringBuffer buffer = new StringBuffer();
+ private final IToken defaultToken;
+ private final IWordDetector detector;
+ private final IToken successToken;
+
+ public DollarRule(IWordDetector detector, IToken defaultToken, IToken token) {
+ this.detector = detector;
+ this.successToken = token;
+ this.defaultToken = defaultToken;
+ }
+
+ /**
+ * Returns whether the specified character is a special parameter in shell
+ * script. A dollar sign combined with any of the following characters will
+ * be highlighted, but no characters after that.
+ * <p>
+ * '*', '@' - positional parameters starting from 1<br>
+ * '#' - number of positional parameters<br>
+ * '?' - exit status of the last executed foreground command<br>
+ * '-' - current option flags<br>
+ * '$' - PID of the shell<br>
+ * '!' - PID of the last executed background command<br>
+ * '_' - pathname used to invoke the shell and every subsequent command <br>
+ * '0' - usually the name of the file used to invoke the shell<br>
+ * '1' to '9' - expands to the corresponding positional parameters,
+ * parameters 10+ must be referenced with braces like ${12}
+ *
+ * @param c
+ * a character to test
+ * @return true if the specified character is a special parameter
+ */
+ private static boolean isSpecial(char c) {
+ return ((c == '*') || (c == '@') || (c == '#') || (c == '?') || (c == '-') || (c == '$') || (c == '!')
+ || (c == '_') || Character.isDigit(c));
+ }
+
+ @Override
+ public IToken evaluate(ICharacterScanner scanner) {
+ int c = scanner.read();
+ if (detector.isWordStart((char) c)) {
+ buffer.setLength(0);
+ do {
+ buffer.append((char) c);
+ c = scanner.read();
+ if ((buffer.length() == 1) && isSpecial((char) c))
+ return successToken;
+ } while ((c != ICharacterScanner.EOF) && detector.isWordPart((char) c));
+ scanner.unread();
+ if (buffer.length() > 1)
+ return successToken;
+ if (defaultToken.isUndefined())
+ unreadBuffer(scanner);
+ return defaultToken;
+ }
+ scanner.unread();
+ return Token.UNDEFINED;
+ }
+
+ /**
+ * Returns the characters in the buffer to the scanner.
+ *
+ * @param scanner
+ * the scanner to be used
+ */
+ protected void unreadBuffer(ICharacterScanner scanner) {
+ for (int i = buffer.length() - 1; i >= 0; i--)
+ scanner.unread();
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DoubleQuoteScanner.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DoubleQuoteScanner.java
new file mode 100644
index 0000000..ff3a90c
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/DoubleQuoteScanner.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2009-2010 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.dltk.sh.ui.IShellColorConstants;
+import org.eclipse.dltk.ui.text.AbstractScriptScanner;
+import org.eclipse.dltk.ui.text.IColorManager;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.WhitespaceRule;
+
+/**
+ * Scans interpolated string partitions of documents. I.e., the sections between
+ * double quote marks.
+ */
+public class DoubleQuoteScanner extends AbstractScriptScanner {
+
+ /**
+ * Array of preference keys used to define the style of token types used by
+ * this scanner.
+ */
+ private static String fgTokenProperties[] = new String[] { IShellColorConstants.SHELL_EVAL,
+ IShellColorConstants.SHELL_DOUBLE_QUOTE, IShellColorConstants.SHELL_VARIABLE };
+
+ public DoubleQuoteScanner(IColorManager manager, IPreferenceStore store) {
+ super(manager, store);
+ initialize();
+ }
+
+ @Override
+ protected List<IRule> createRules() {
+ List<IRule> rules = new ArrayList<>();
+
+ // Token types used in the rules
+ IToken defaultToken = this.getToken(IShellColorConstants.SHELL_DOUBLE_QUOTE);
+ IToken evalToken = this.getToken(IShellColorConstants.SHELL_EVAL);
+ IToken varToken = this.getToken(IShellColorConstants.SHELL_VARIABLE);
+
+ // Add generic whitespace rule. This is here for efficiency reasons,
+ // there is a LOT of whitespace and when a token is detected the other
+ // rules are not evaluated.
+ rules.add(new WhitespaceRule(new WhitespaceDetector()));
+ rules.add(new DollarBraceCountingRule('(', ')', evalToken, '\\'));
+ rules.add(new DollarBraceCountingRule('{', '}', varToken, '\\'));
+ rules.add(new DollarRule(new DollarDetector(), defaultToken, varToken));
+ rules.add(new SingleLineRule("`", "`", evalToken, '\\', false));
+ setDefaultReturnToken(defaultToken);
+ return rules;
+ }
+
+ @Override
+ protected String[] getTokenProperties() {
+ return fgTokenProperties;
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/EvalScanner.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/EvalScanner.java
new file mode 100644
index 0000000..53b28e5
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/EvalScanner.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Mat Booth and others.
+ * 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
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.dltk.sh.ui.IShellColorConstants;
+import org.eclipse.dltk.ui.text.AbstractScriptScanner;
+import org.eclipse.dltk.ui.text.IColorManager;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.WhitespaceRule;
+
+/**
+ * Scans command substitution document partitions. I.e., the sections between
+ * back-ticks or enclosed in $()s.
+ */
+public class EvalScanner extends AbstractScriptScanner {
+
+ /**
+ * Array of preference keys used to define the style of token types used by
+ * this scanner.
+ */
+ private static String fgTokenProperties[] = new String[] { IShellColorConstants.SHELL_EVAL,
+ IShellColorConstants.SHELL_VARIABLE };
+
+ public EvalScanner(IColorManager manager, IPreferenceStore store) {
+ super(manager, store);
+ initialize();
+ }
+
+ @Override
+ protected List<IRule> createRules() {
+ List<IRule> rules = new ArrayList<>();
+
+ // Token types used in the rules
+ IToken defaultToken = this.getToken(IShellColorConstants.SHELL_EVAL);
+ IToken varToken = this.getToken(IShellColorConstants.SHELL_VARIABLE);
+
+ // Add generic whitespace rule. This is here for efficiency reasons,
+ // there is a LOT of whitespace and when a token is detected the other
+ // rules are not evaluated.
+ rules.add(new WhitespaceRule(new WhitespaceDetector()));
+ rules.add(new DollarBraceCountingRule('{', '}', varToken, '\\'));
+ rules.add(new DollarRule(new DollarDetector(), defaultToken, varToken));
+ setDefaultReturnToken(defaultToken);
+ return rules;
+ }
+
+ @Override
+ protected String[] getTokenProperties() {
+ return fgTokenProperties;
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/IShellPartitions.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/IShellPartitions.java
new file mode 100644
index 0000000..5a3e05b
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/IShellPartitions.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text;
+
+import org.eclipse.jface.text.IDocument;
+
+public interface IShellPartitions {
+ public final static String SHELL_PARTITIONING = "__shell_partitioning";
+
+ // Content types supplied by the shell script partitioner
+ public static final String COMMENT_CONTENT_TYPE = "__comment";
+ public static final String DOUBLE_QUOTE_CONTENT_TYPE = "__double_quote";
+ public static final String PARAM_CONTENT_TYPE = "__parameter";
+ public static final String EVAL_CONTENT_TYPE = "__eval";
+ public static final String HASHBANG_CONTENT_TYPE = "__hashbang";
+ public static final String FUNCTION_CONTENT_TYPE = "__function";
+ public static final String SINGLE_QUOTE_CONTENT_TYPE = "__single_quote";
+
+ public static final String[] CONTENT_TYPES = new String[] { IDocument.DEFAULT_CONTENT_TYPE, HASHBANG_CONTENT_TYPE,
+ COMMENT_CONTENT_TYPE, SINGLE_QUOTE_CONTENT_TYPE, DOUBLE_QUOTE_CONTENT_TYPE, PARAM_CONTENT_TYPE,
+ EVAL_CONTENT_TYPE, FUNCTION_CONTENT_TYPE };
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/IndentType.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/IndentType.java
new file mode 100644
index 0000000..ef8154b
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/IndentType.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text;
+
+/**
+ * A type of indent.
+ */
+public class IndentType {
+ /** A single indent decrement */
+ public static final IndentType DECREMENT = new IndentType();
+ /** A single indent increment */
+ public static final IndentType INCREMENT = new IndentType();
+ /** An inflexion - both an increment and a decrement */
+ public static final IndentType INFLEXION = new IndentType();
+
+ private IndentType() {
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ScriptAutoIndentStrategy.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ScriptAutoIndentStrategy.java
new file mode 100644
index 0000000..a7a4151
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ScriptAutoIndentStrategy.java
@@ -0,0 +1,340 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ * Mat Booth
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text;
+
+import org.eclipse.dltk.sh.ui.Activator;
+import org.eclipse.dltk.ui.CodeFormatterConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DocumentCommand;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+
+/**
+ * An indent strategy capable of indenting and unindenting on any set of words,
+ * depending on the rules that are set.
+ *
+ * @see #setRules(IRule[])
+ */
+public class ScriptAutoIndentStrategy implements IAutoEditStrategy {
+ /**
+ * Document scanner used to identify indentations.
+ */
+ private final DocumentAndCommandScanner scanner = new DocumentAndCommandScanner();
+
+ /**
+ * Set the rules that will be used in a document scanner to identify where
+ * indentations should occur. Typically you'd have one rule to describe each
+ * type of indentation.
+ *
+ * @param rules
+ * the list of rules
+ * @see IndentType
+ */
+ public void setRules(IRule[] rules) {
+ scanner.setRules(rules);
+ }
+
+ /**
+ * This implementation attempts to auto-indent and auto-unindent after
+ * keywords that require it.
+ */
+ @Override
+ public void customizeDocumentCommand(IDocument d, DocumentCommand c) {
+ int delim = TextUtilities.endsWith(d.getLegalLineDelimiters(), c.text);
+ if ((c.length == 0) && (c.text != null) && (delim != -1)) {
+ smartIndentAfterNewLine(d, c);
+ } else if (c.text.length() == 1) {
+ smartIndentAfterKeypress(d, c);
+ }
+ }
+
+ /**
+ * Set the indent of a new line when the user hits carriage return. The new
+ * indent will either be the same as the previous line or incremented if the
+ * user has hit carriage return on a line that contains a incrementing
+ * keyword.
+ *
+ * @param document
+ * the document being parsed
+ * @param c
+ * the command being performed
+ */
+ protected void smartIndentAfterNewLine(IDocument document, DocumentCommand c) {
+ if ((c.offset == -1) || (document.getLength() == 0))
+ return;
+ try {
+ StringBuffer buf = new StringBuffer(c.text);
+ int p = c.offset == document.getLength() ? c.offset - 1 : c.offset;
+ int line = document.getLineOfOffset(p);
+ int start = document.getLineOffset(line);
+ int bracketCount = getBracketCount(document, null, start, c.offset, true);
+ buf.append(generateIndentation(getIndentOfLine(document, line), bracketCount <= 0 ? 0 : 1));
+ c.text = buf.toString();
+ } catch (BadLocationException x) {
+ x.printStackTrace();
+ }
+ }
+
+ /**
+ * Set the indent of the current line when the user hits a key. The indent
+ * will either be unchanged or decremented if the user types
+ *
+ * @param document
+ * the document being parsed
+ * @param c
+ * the command being performed
+ */
+ protected void smartIndentAfterKeypress(IDocument document, DocumentCommand c) {
+ if ((c.offset == -1) || (document.getLength() == 0))
+ return;
+ try {
+ StringBuffer buf = new StringBuffer();
+ int p = c.offset == document.getLength() ? c.offset - 1 : c.offset;
+ int line = document.getLineOfOffset(p);
+ int start = document.getLineOffset(line);
+ int whiteEnd = findEndOfWhiteSpace(document, start, c.offset);
+
+ int bracketCount = getBracketCount(document, c, start, c.offset, false);
+ buf.append(generateIndentation(getIndentOfLine(document, line), bracketCount >= 0 ? 0 : -1));
+ buf.append(document.get(whiteEnd, c.offset - whiteEnd));
+ buf.append(c.text);
+ // Alter the command
+ c.length = (c.offset - start) + c.length;
+ c.offset = start;
+ c.text = buf.toString();
+ } catch (BadLocationException x) {
+ x.printStackTrace();
+ }
+ }
+
+ /**
+ * Returns the first offset greater than <code>offset</code> and smaller
+ * than <code>end</code> whose character is not a space or tab character. If
+ * no such offset is found, <code>end</code> is returned.
+ *
+ * @param document
+ * the document to search in
+ * @param offset
+ * the offset at which searching start
+ * @param end
+ * the offset at which searching stops
+ * @return the offset in the specified range whose character is not a space
+ * or tab
+ * @exception BadLocationException
+ * if offset is an invalid position in the given document
+ */
+ private static int findEndOfWhiteSpace(IDocument document, int offset, int end) throws BadLocationException {
+ while (offset < end) {
+ char c = document.getChar(offset);
+ if ((c != ' ') && (c != '\t')) {
+ return offset;
+ }
+ offset++;
+ }
+ return end;
+ }
+
+ /**
+ * Returns the indentation of the specified line in <code>document</code>.
+ *
+ * @param document
+ * - the document being parsed
+ * @param line
+ * - the line number being searched
+ * @return the string containing the indentation from the specified line
+ */
+ private static String getIndentOfLine(IDocument document, int line) throws BadLocationException {
+ if (line > -1) {
+ int start = document.getLineOffset(line);
+ int end = start + document.getLineLength(line);
+ int whiteend = findEndOfWhiteSpace(document, start, end);
+ return document.get(start, whiteend - start);
+ } else {
+ return "";
+ }
+ }
+
+ /**
+ * Returns the bracket count of a section of text. The count is incremented
+ * when an opening bracket is encountered and decremented when a closing
+ * bracket is encountered.
+ *
+ * @param document
+ * - the document being parsed
+ * @param command
+ * - if not null, the inserted text specified by the command will
+ * be taken into account as if it were part of the document
+ * @param start
+ * - the start position for the search
+ * @param end
+ * - the end position for the search
+ * @param ignoreInflexions
+ * - whether or not to ignore inflexions in the count
+ * @return the resulting bracket count, a positive value means we've
+ * encountered more opening than closing brackets
+ */
+ private int getBracketCount(IDocument document, DocumentCommand command, int start, int end,
+ boolean ignoreInflexions) {
+ int bracketcount = 0;
+ if (command != null)
+ scanner.setRange(document, command, start, end - start);
+ else
+ scanner.setRange(document, start, end - start);
+
+ while (true) {
+ IToken token = scanner.nextToken();
+ if (token.isEOF())
+ break;
+
+ if (token.isOther()) {
+ IndentType type = (IndentType) token.getData();
+ if (type == IndentType.INCREMENT) {
+ ++bracketcount;
+ } else if (type == IndentType.DECREMENT) {
+ --bracketcount;
+ } else if ((type == IndentType.INFLEXION) && ignoreInflexions) {
+ ++bracketcount;
+ } else if ((type == IndentType.INFLEXION) && !ignoreInflexions) {
+ --bracketcount;
+ }
+ }
+ }
+ return bracketcount;
+ }
+
+ /**
+ * Calculate the indentation needed for a new line based on the contents of
+ * the previous line.
+ *
+ * @param previous
+ * a string containing the indentation of the previous line
+ * @param additional
+ * number of desired addition indentations, may be negative
+ * @return a string containing the indentation to use on the new line
+ */
+ private static String generateIndentation(String previous, int additional) {
+ // Get the indentation preferences
+ IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
+ String tabChar = prefs.getString(CodeFormatterConstants.FORMATTER_TAB_CHAR);
+ int indentSize = prefs.getInt(CodeFormatterConstants.FORMATTER_INDENTATION_SIZE);
+ int tabSize = prefs.getInt(CodeFormatterConstants.FORMATTER_TAB_SIZE);
+
+ // Size in characters of the indentation of the previous line
+ int preLength = computeVisualLength(previous, tabSize);
+
+ // Number of addition characters needed
+ int addLength = indentSize * additional;
+
+ // Target size of the indentation for the new line
+ int endLength = Math.max(0, preLength + addLength);
+
+ // Trim previous indentation back to nearest tab stop
+ int minLength = Math.min(endLength, preLength);
+ int maxCopyLength = tabSize > 0 ? minLength - (minLength % tabSize) : minLength; // maximum
+ // indent
+ // to
+ // copy
+ String indent = stripExtraChars(previous, maxCopyLength, tabSize);
+
+ // Add additional indentation
+ int missing = endLength - maxCopyLength;
+ final int tabs, spaces;
+ if (CodeFormatterConstants.SPACE.equals(tabChar)) {
+ // Each indent is a number of spaces equal to indent size
+ tabs = 0;
+ spaces = missing;
+ } else if (CodeFormatterConstants.TAB.equals(tabChar)) {
+ // Missing should always be in multiples of indent size, so this
+ // means "one tab per indent" and indent size is essentially ignored
+ tabs = missing / indentSize;
+ spaces = 0;
+ } else if (CodeFormatterConstants.MIXED.equals(tabChar)) {
+ // If the missing indent is a multiple of tab size then tabs will be
+ // used, otherwise use spaces
+ tabs = tabSize > 0 ? missing / tabSize : 0;
+ spaces = tabSize > 0 ? missing % tabSize : missing;
+ } else {
+ tabs = 0;
+ spaces = 0;
+ }
+ for (int i = 0; i < tabs; i++)
+ indent += "\t";
+ for (int i = 0; i < spaces; i++)
+ indent += " ";
+ return indent;
+ }
+
+ /**
+ * Computes the length of a an indentation, counting a tab character as the
+ * size until the next tab stop and every other character as one.
+ *
+ * @param indent
+ * the string containing the indentation to measure
+ * @param tabSize
+ * the visual size of tab characters
+ * @return the visual length in number of characters
+ */
+ private static int computeVisualLength(String indent, int tabSize) {
+ int length = 0;
+ for (int i = 0; i < indent.length(); i++) {
+ char ch = indent.charAt(i);
+ switch (ch) {
+ case '\t':
+ if (tabSize > 0) {
+ int reminder = length % tabSize;
+ length += tabSize - reminder;
+ }
+ break;
+ case ' ':
+ length++;
+ break;
+ }
+ }
+ return length;
+ }
+
+ /**
+ * Strips any characters off the end of an indentation that exceed a
+ * specified maximum visual indentation length.
+ *
+ * @param indent
+ * the string containing the indentation to measure
+ * @param max
+ * the maximum visual indentation length
+ * @param tabSize
+ * the visual size of tab characters
+ * @return a string containing the stripped indentation
+ */
+ private static String stripExtraChars(String indent, int max, int tabSize) {
+ int measured = 0;
+ int i = 0;
+ for (; (measured < max) && (i < indent.length()); i++) {
+ char ch = indent.charAt(i);
+ switch (ch) {
+ case '\t':
+ if (tabSize > 0) {
+ int reminder = measured % tabSize;
+ measured += tabSize - reminder;
+ }
+ break;
+ case ' ':
+ measured++;
+ break;
+ }
+ }
+ return indent.substring(0, measured > max ? i - 1 : i);
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ShellCodeScanner.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ShellCodeScanner.java
new file mode 100644
index 0000000..a7cea10
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ShellCodeScanner.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2009-2011 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ * Mat Booth
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.dltk.sh.ui.Activator;
+import org.eclipse.dltk.sh.ui.IShellColorConstants;
+import org.eclipse.dltk.ui.text.AbstractScriptScanner;
+import org.eclipse.dltk.ui.text.IColorManager;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.IWordDetector;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WhitespaceRule;
+import org.eclipse.jface.text.rules.WordRule;
+
+public class ShellCodeScanner extends AbstractScriptScanner {
+ public class ShellWordDetector implements IWordDetector {
+ @Override
+ public boolean isWordPart(char character) {
+ return (Character.isJavaIdentifierPart(character) && (character != '$')) || (character == '-')
+ || (character == '.');
+ }
+
+ @Override
+ public boolean isWordStart(char character) {
+ return Character.isJavaIdentifierStart(character) && (character != 36);
+ }
+ }
+
+ public static String[] KEYWORDS = { "do", "done", "if", "fi", "then", "else", "elif", "case", "esac", "while",
+ "for", "in", "select", "time", "until", "function", "[", "[[", "]", "]]", "set", "unset", "declare" };
+
+ private static List<String> fgCommands = getCommands();
+
+ private static String fgTokenProperties[] = new String[] { IShellColorConstants.SHELL_DEFAULT,
+ IShellColorConstants.SHELL_KEYWORD, IShellColorConstants.SHELL_VARIABLE,
+ IShellColorConstants.SHELL_COMMAND };
+
+ public ShellCodeScanner(IColorManager manager, IPreferenceStore store) {
+ super(manager, store);
+ this.initialize();
+ }
+
+ public static List<String> getCommands() {
+ String path = System.getenv("PATH");
+ List<String> commands = new ArrayList<>();
+ String[] pathEntries = path.split(System.getProperty("path.separator"));
+ for (String pathEntry : pathEntries) {
+ File dir = new File(pathEntry);
+ if (dir.exists() && dir.isDirectory()) {
+
+ File[] files = dir.listFiles();
+
+ // GRO: Prevent NullPointerException
+ if (files == null) {
+ // @formatter:off
+ Activator.getDefault().getLog().log(// +
+ new Status(IStatus.ERROR, Activator.PLUGIN_ID, "listFiles() returned null: " + dir));
+ // @formatter:on
+ files = new File[] {};
+ }
+
+ for (File file : files) {
+ if (file.canExecute()) {
+ if (file.getName().endsWith(".exe"))
+ commands.add(file.getName().substring(0, file.getName().length() - 4));
+ else
+ commands.add(file.getName());
+ }
+ }
+ }
+ }
+ return commands;
+ }
+
+ @Override
+ protected List<IRule> createRules() {
+ List<IRule> rules = new ArrayList<>();
+ IToken keyword = this.getToken(IShellColorConstants.SHELL_KEYWORD);
+ IToken commandToken = this.getToken(IShellColorConstants.SHELL_COMMAND);
+ IToken other = this.getToken(IShellColorConstants.SHELL_DEFAULT);
+ IToken variable = this.getToken(IShellColorConstants.SHELL_VARIABLE);
+ rules.add(new WhitespaceRule(new WhitespaceDetector()));
+ rules.add(new AssignmentRule(new AssignmentDetector(), Token.UNDEFINED, variable));
+ rules.add(new DollarRule(new DollarDetector(), Token.UNDEFINED, variable));
+ WordRule wordRule = new WordRule(new ShellWordDetector(), other);
+ for (String element : KEYWORDS) {
+ wordRule.addWord(element, keyword);
+ }
+ for (String command : fgCommands) {
+ wordRule.addWord(command, commandToken);
+ }
+ rules.add(wordRule);
+ return rules;
+ }
+
+ @Override
+ protected String[] getTokenProperties() {
+ return fgTokenProperties;
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ShellPartitionScanner.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ShellPartitionScanner.java
new file mode 100644
index 0000000..d3be4aa
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ShellPartitionScanner.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.dltk.sh.ui.text;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.IPredicateRule;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+
+public class ShellPartitionScanner extends RuleBasedPartitionScanner {
+
+ public ShellPartitionScanner() {
+ super();
+
+ List<IRule> rules = new ArrayList<>();
+ // Add rule for single line comments.
+ rules.add(new EndOfLineRule("#!", new Token(IShellPartitions.HASHBANG_CONTENT_TYPE)));
+ /*
+ * There are 2 comment rules in order to correctly support # in
+ * variables.
+ */
+ // This rule recognizes only comments starting from the beginning of
+ // line.
+ EndOfLineRule commentRule = new EndOfLineRule("#", new Token(IShellPartitions.COMMENT_CONTENT_TYPE));
+ commentRule.setColumnConstraint(0);
+ rules.add(commentRule);
+ // This rule recognizes only comments which has space in front of it
+ commentRule = new EndOfLineRule(" #", new Token(IShellPartitions.COMMENT_CONTENT_TYPE));
+ rules.add(commentRule);
+ commentRule = new EndOfLineRule("\t#", new Token(IShellPartitions.COMMENT_CONTENT_TYPE));
+ rules.add(commentRule);
+
+ rules.add(new DollarBraceCountingRule('(', ')', new Token(IShellPartitions.EVAL_CONTENT_TYPE), '\\'));
+ rules.add(new DollarBraceCountingRule('{', '}', new Token(IShellPartitions.PARAM_CONTENT_TYPE), '\\'));
+ rules.add(new SingleLineRule("`", "`", new Token(IShellPartitions.EVAL_CONTENT_TYPE), '\\', false, true));
+ rules.add(new SingleLineRule("\"", "\"", new Token(IShellPartitions.DOUBLE_QUOTE_CONTENT_TYPE), '\\', false,
+ true));
+ rules.add(
+ new SingleLineRule("'", "'", new Token(IShellPartitions.SINGLE_QUOTE_CONTENT_TYPE), '\\', false, true));
+
+ IPredicateRule[] result = new IPredicateRule[rules.size()];
+ rules.toArray(result);
+ setPredicateRules(result);
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ShellTextTools.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ShellTextTools.java
new file mode 100644
index 0000000..8419a82
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/ShellTextTools.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text;
+
+import org.eclipse.dltk.sh.ui.editor.ShellSourceViewerConfiguration;
+import org.eclipse.dltk.ui.text.ScriptSourceViewerConfiguration;
+import org.eclipse.dltk.ui.text.ScriptTextTools;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.rules.IPartitionTokenScanner;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+public class ShellTextTools extends ScriptTextTools {
+
+ private final IPartitionTokenScanner fPartitionScanner;
+
+ public ShellTextTools(boolean autoDisposeOnDisplayDispose) {
+ super(IShellPartitions.SHELL_PARTITIONING, IShellPartitions.CONTENT_TYPES, autoDisposeOnDisplayDispose);
+ fPartitionScanner = new ShellPartitionScanner();
+ }
+
+ @Override
+ public ScriptSourceViewerConfiguration createSourceViewerConfiguraton(IPreferenceStore preferenceStore,
+ ITextEditor editor, String partitioning) {
+ return new ShellSourceViewerConfiguration(getColorManager(), preferenceStore, editor, partitioning);
+ }
+
+ @Override
+ public IPartitionTokenScanner createPartitionScanner() {
+ return fPartitionScanner;
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/WhitespaceDetector.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/WhitespaceDetector.java
new file mode 100644
index 0000000..b2b0ddf
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/WhitespaceDetector.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text;
+
+import org.eclipse.jface.text.rules.IWhitespaceDetector;
+
+public class WhitespaceDetector implements IWhitespaceDetector {
+
+ @Override
+ public boolean isWhitespace(char c) {
+ return Character.isWhitespace(c);
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/FoldingBlockKind.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/FoldingBlockKind.java
new file mode 100644
index 0000000..7807d2f
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/FoldingBlockKind.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text.folding;
+
+import org.eclipse.dltk.ui.text.folding.IFoldingBlockKind;
+
+public enum FoldingBlockKind implements IFoldingBlockKind {
+ FUNCTION, COMMENT;
+
+ @Override
+ public boolean isComment() {
+ return this == COMMENT;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCodeFoldingBlockProvider.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCodeFoldingBlockProvider.java
new file mode 100644
index 0000000..cd00441
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCodeFoldingBlockProvider.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text.folding;
+
+import org.eclipse.dltk.core.IMethod;
+import org.eclipse.dltk.core.IModelElement;
+import org.eclipse.dltk.ui.PreferenceConstants;
+import org.eclipse.dltk.ui.text.folding.IFoldingBlockKind;
+import org.eclipse.dltk.ui.text.folding.ModelFoldingBlockProvider;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+public class ShellCodeFoldingBlockProvider extends ModelFoldingBlockProvider {
+ private int minimalLineCount;
+ private boolean foldingEnabled;
+ private boolean functionsCollapsedInitially;
+
+ @Override
+ public boolean visit(IModelElement element) {
+ if (element instanceof IMethod) {
+ reportElement(element);
+ }
+ return true;
+ }
+
+ @Override
+ public void initializePreferences(IPreferenceStore preferenceStore) {
+ super.initializePreferences(preferenceStore);
+ minimalLineCount = preferenceStore.getInt(PreferenceConstants.EDITOR_FOLDING_LINES_LIMIT);
+ foldingEnabled = preferenceStore.getBoolean(PreferenceConstants.EDITOR_FOLDING_ENABLED);
+ functionsCollapsedInitially = preferenceStore.getBoolean(PreferenceConstants.EDITOR_FOLDING_INIT_METHODS);
+ }
+
+ @Override
+ public int getMinimalLineCount() {
+ return minimalLineCount;
+ }
+
+ @Override
+ protected boolean isFoldedInitially(IModelElement element) {
+ if (foldingEnabled) {
+ if (element instanceof IMethod) {
+ return functionsCollapsedInitially;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ protected IFoldingBlockKind getKind(IModelElement element) {
+ if (element instanceof IMethod) {
+ return FoldingBlockKind.FUNCTION;
+ }
+ /*
+ * this should not happen. getKind() should be called for functions only
+ * because we reportElement() only for IMethod in visit()
+ */
+ return null;
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCodeFoldingPreferenceBlock.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCodeFoldingPreferenceBlock.java
new file mode 100644
index 0000000..0178fdb
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCodeFoldingPreferenceBlock.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat Inc. and others.
+ * 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:
+ * Peter Palaga - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text.folding;
+
+import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore;
+import org.eclipse.dltk.ui.text.folding.SourceCodeFoldingPreferenceBlock;
+import org.eclipse.jface.preference.PreferencePage;
+
+/**
+ * A preference block for folding of Shell Script commands.
+ */
+public class ShellCodeFoldingPreferenceBlock extends SourceCodeFoldingPreferenceBlock {
+ public ShellCodeFoldingPreferenceBlock(OverlayPreferenceStore store, PreferencePage page) {
+ super(store, page);
+ }
+
+ @Override
+ protected String getInitiallyFoldMethodsText() {
+ return "Functions";
+ }
+
+ @Override
+ protected boolean supportsClassFolding() {
+ return false;
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCommentFoldingBlockProvider.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCommentFoldingBlockProvider.java
new file mode 100644
index 0000000..a3cbbaf
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCommentFoldingBlockProvider.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat Inc. and others.
+ * 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:
+ * Alexander Kurtakov - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text.folding;
+
+import org.eclipse.dltk.sh.ui.Activator;
+import org.eclipse.dltk.sh.ui.text.IShellPartitions;
+import org.eclipse.dltk.ui.text.folding.IFoldingContent;
+import org.eclipse.dltk.ui.text.folding.PartitioningFoldingBlockProvider;
+
+public class ShellCommentFoldingBlockProvider extends PartitioningFoldingBlockProvider {
+
+ public ShellCommentFoldingBlockProvider() {
+ super(Activator.getDefault().getTextTools());
+ }
+
+ @Override
+ public void computeFoldableBlocks(IFoldingContent content) {
+ if (isFoldingComments()) {
+ computeBlocksForPartitionType(content, IShellPartitions.COMMENT_CONTENT_TYPE, FoldingBlockKind.COMMENT,
+ isCollapseComments());
+ }
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCommentFoldingPreferenceBlock.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCommentFoldingPreferenceBlock.java
new file mode 100644
index 0000000..e69b5e5
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/text/folding/ShellCommentFoldingPreferenceBlock.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat Inc. and others.
+ * 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:
+ * Peter Palaga - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.dltk.sh.ui.text.folding;
+
+import org.eclipse.dltk.ui.PreferenceConstants;
+import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore;
+import org.eclipse.dltk.ui.preferences.PreferencesMessages;
+import org.eclipse.dltk.ui.text.folding.DocumentationFoldingPreferenceBlock;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.widgets.Group;
+
+/**
+ * A preference block for folding of Shell Script comments.
+ */
+public class ShellCommentFoldingPreferenceBlock extends DocumentationFoldingPreferenceBlock {
+
+ public ShellCommentFoldingPreferenceBlock(OverlayPreferenceStore store, PreferencePage page) {
+ super(store, page);
+ }
+
+ /**
+ * Overridden to add just the "Comments" checkbox rather than both
+ * "Comments" and "Header comments" as it is done in the super class. It is
+ * because we do not detect header comments and therefore we cannot fold
+ * them separately.
+ *
+ * @see org.eclipse.dltk.ui.text.folding.DocumentationFoldingPreferenceBlock#addInitiallyFoldOptions(org.eclipse.swt.widgets.Group)
+ */
+ @Override
+ protected void addInitiallyFoldOptions(Group group) {
+ createCheckBox(group, PreferencesMessages.FoldingConfigurationBlock_initiallyFoldComments,
+ PreferenceConstants.EDITOR_FOLDING_INIT_COMMENTS);
+ }
+
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/wizards/NewShellScriptFilePage.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/wizards/NewShellScriptFilePage.java
new file mode 100644
index 0000000..fa62e5b
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/wizards/NewShellScriptFilePage.java
@@ -0,0 +1,22 @@
+package org.eclipse.dltk.sh.ui.wizards;
+
+import org.eclipse.dltk.sh.core.ShelledNature;
+import org.eclipse.dltk.ui.wizards.NewSourceModulePage;
+
+public class NewShellScriptFilePage extends NewSourceModulePage {
+
+ @Override
+ protected String getPageTitle() {
+ return "Shell Script";
+ }
+
+ @Override
+ protected String getPageDescription() {
+ return "Create a new Shell Script.";
+ }
+
+ @Override
+ protected String getRequiredNature() {
+ return ShelledNature.SHELLED_NATURE;
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/wizards/NewShellScriptFileWizard.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/wizards/NewShellScriptFileWizard.java
new file mode 100644
index 0000000..b1ea1dd
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/wizards/NewShellScriptFileWizard.java
@@ -0,0 +1,18 @@
+package org.eclipse.dltk.sh.ui.wizards;
+
+import org.eclipse.dltk.ui.DLTKUIPlugin;
+import org.eclipse.dltk.ui.wizards.NewSourceModulePage;
+import org.eclipse.dltk.ui.wizards.NewSourceModuleWizard;
+
+public class NewShellScriptFileWizard extends NewSourceModuleWizard {
+
+ public NewShellScriptFileWizard() {
+ setWindowTitle("New Shell Script");
+ setDialogSettings(DLTKUIPlugin.getDefault().getDialogSettings());
+ }
+
+ @Override
+ protected NewSourceModulePage createNewSourceModulePage() {
+ return new NewShellScriptFilePage();
+ }
+}
diff --git a/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/wizards/ShellScriptProjectWizard.java b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/wizards/ShellScriptProjectWizard.java
new file mode 100644
index 0000000..5bc8109
--- /dev/null
+++ b/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/ui/wizards/ShellScriptProjectWizard.java
@@ -0,0 +1,43 @@
+package org.eclipse.dltk.sh.ui.wizards;
+
+import org.eclipse.dltk.sh.core.ShelledNature;
+import org.eclipse.dltk.ui.DLTKUIPlugin;
+import org.eclipse.dltk.ui.wizards.ProjectWizard;
+import org.eclipse.dltk.ui.wizards.ProjectWizardFirstPage;
+import org.eclipse.dltk.ui.wizards.ProjectWizardSecondPage;
+
+public class ShellScriptProjectWizard extends ProjectWizard {
+ private ProjectWizardFirstPage firstPage;
+ private ProjectWizardSecondPage secondPage;
+
+ public ShellScriptProjectWizard() {
+ setWindowTitle("New Shell Script Project");
+ setDialogSettings(DLTKUIPlugin.getDefault().getDialogSettings());
+ }
+
+ @Override
+ public String getScriptNature() {
+ return ShelledNature.SHELLED_NATURE;
+ }
+
+ @Override
+ public void addPages() {
+ super.addPages();
+ firstPage = new ProjectWizardFirstPage() {
+
+ @Override
+ protected boolean interpeterRequired() {
+ return false;
+ }
+ };
+
+ // First page
+ firstPage.setTitle("Shell Script Project");
+ firstPage.setDescription("Create a new Shell Script project.");
+ addPage(firstPage);
+
+ // Second page
+ secondPage = new ProjectWizardSecondPage(firstPage);
+ addPage(secondPage);
+ }
+}
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..4e4ef11
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, Inc. and others
+
+ 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:
+ Red Hat Incorporated - initial implementation
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <prerequisites>
+ <maven>3.1.1</maven>
+ </prerequisites>
+ <groupId>org.eclipse.dltk.sh</groupId>
+ <artifactId>parent</artifactId>
+ <version>2.0.4-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>ShellEd</name>
+ <licenses>
+ <license>
+ <name>Eclipse Public License v1.0</name>
+ <comments>
+ 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.htm
+ </comments>
+ </license>
+ </licenses>
+ <properties>
+ <tycho-version>0.23.1</tycho-version>
+ </properties>
+ <modules>
+ <module>org.eclipse.dltk.sh.core</module>
+ <module>org.eclipse.dltk.sh.ui</module>
+ <module>org.eclipse.dltk.sh.core.tests</module>
+ <module>org.eclipse.dltk.sh.ui.tests</module>
+ <module>org.eclipse.dltk.sh.doc</module>
+ <module>org.eclipse.dltk.sh.feature</module>
+ <module>org.eclipse.dltk.sh.site</module>
+ <module>org.eclipse.dltk.sh.target</module>
+ </modules>
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-ssh</artifactId>
+ <version>1.0</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <resolver>p2</resolver>
+ <environments>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86_64</arch>
+ </environment>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86_64</arch>
+ </environment>
+ <environment>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch>x86_64</arch>
+ </environment>
+ </environments>
+ <target>
+ <artifact>
+ <groupId>org.eclipse.dltk.sh</groupId>
+ <artifactId>org.eclipse.dltk.sh.target</artifactId>
+ <version>${project.version}</version>
+ </artifact>
+ </target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-compiler-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <useUIHarness>true</useUIHarness>
+ <useUIThread>true</useUIThread>
+ <product>org.eclipse.sdk.ide</product>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ <version>${tycho-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.7</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.4</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <description>A superb shell script editor for Eclipse.</description>
+</project>

Back to the top