Permalink
Browse files

templates : adjust some parameters

  • Loading branch information...
1 parent 910eb7e commit 2abb0d69cec62d234c1a2f9f49593c42b858d4df @davidB davidB committed Jul 13, 2010
@@ -69,7 +69,7 @@ class ScalaTemplateCompletionProcessor(val tm : ScalaTemplateManager) extends Te
}
protected override def getRelevance(template : Template, prefix : String) : Int = {
- (prefix == null | prefix.trim().length == 0) match {
+ (prefix == null || prefix.trim().length == 0) match {
case true => 0
case false => super.getRelevance(template, prefix)
}
@@ -72,6 +72,14 @@ class TemplateCompletionProposalComputer extends IJavaCompletionProposalComputer
*/
def sessionEnded() {}
}
+
+//Take inspiration from :
+// * http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_codeassist.htm
+// * http://eclipseone.wordpress.com/2009/11/29/how-to-tweak-eclipse-templates-to-suit-you/
+// * org.eclipse.jdt.internal.ui.text.java http://www.java2s.com/Open-Source/Java-Document/IDE-Eclipse/jdt/org.eclipse.jdt.internal.ui.text.java.htm
+// * org.eclipse.jdt.internal.ui.text.template.contentassist http://www.java2s.com/Open-Source/Java-Document/IDE-Eclipse/jdt/org.eclipse.jdt.internal.ui.text.template.contentassist.htm
+// * http://blog.jcake.com/2009/11/29/easy-sharing-of-eclipse-templates/ but need that scala templates be listed into Template View before !
+
//TODO try to do find if it's possible to extends AbstractTemplateCompletionProposalComputer (without fully rewrite TemplateEngine (use JavaPlugin.getTemplateStore)
///**
// * Computer computing template proposals for Scala (and Javadoc) context type.
@@ -3,7 +3,7 @@
<template name="actor"
description="actor statement"
id="scala.templates.actor"
- context="org.scala-ide.sdt.core.templates" enabled="true"
+ context="org.scala-ide.sdt.core.templates" enabled="false"
>val a = actor {
loop {
react {
@@ -14,7 +14,7 @@
<template name="app"
description="application object"
id="scala.templates.app"
- context="org.scala-ide.sdt.core.templates" enabled="true"
+ context="org.scala-ide.sdt.core.templates" enabled="false"
>object ${name} extends Application {
${line_selection}${cursor}
}</template>
@@ -71,7 +71,7 @@
<template name="trycatch"
description="try catch block"
id="scala.templates.trycatch"
- context="org.scala-ide.sdt.core.templates" enabled="true"
+ context="org.scala-ide.sdt.core.templates" enabled="false"
>try {
${line_selection}${cursor}
} catch {
@@ -108,12 +108,12 @@
<template name="lazy"
description="lazy val"
id="scala.templates.lazy"
- context="org.scala-ide.sdt.core.templates" enabled="true"
+ context="org.scala-ide.sdt.core.templates" enabled="false"
>lazy val ${name} = new ${type}(${cursor})</template>
<template name="class"
description="new class"
id="scala.templates.newClass"
- context="org.scala-ide.sdt.core.templates" enabled="true"
+ context="org.scala-ide.sdt.core.templates" enabled="false"
>/**
* @author ${user}
*/
@@ -123,7 +123,7 @@ class ${type_name}() {
<template name="trait"
description="new trait"
id="scala.templates.newTrait"
- context="org.scala-ide.sdt.core.templates" enabled="true"
+ context="org.scala-ide.sdt.core.templates" enabled="false"
>/**
* @author ${user}
*/
@@ -133,7 +133,7 @@ trait ${type_name} {
<template name="obj"
description="new object"
id="scala.templates.newObject"
- context="org.scala-ide.sdt.core.templates" enabled="true"
+ context="org.scala-ide.sdt.core.templates" enabled="false"
>/**
* @author ${user}
*/
@@ -143,12 +143,12 @@ object ${new_name} {
<template name="var"
description="new variable"
id="scala.templates.var"
- context="org.scala-ide.sdt.core.templates" enabled="true"
+ context="org.scala-ide.sdt.core.templates" enabled="false"
>var ${new_name} : ${type} = ${cursor}</template>
<template name="val"
description="new constant"
id="scala.templates.val"
- context="net.alchim31.yascaladt.template" enabled="true"
+ context="net.alchim31.yascaladt.template" enabled="false"
>val ${new_name} : ${type} = ${cursor}</template>
<template name="main"
description="main"

0 comments on commit 2abb0d6

Please sign in to comment.