mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 00:38:56 +00:00
[idea] introduced URIHandler that works with VirtualFileSystem and Documents
This commit is contained in:
parent
26675d73e7
commit
1ca974821f
5 changed files with 49 additions and 3 deletions
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="xtend-gen"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -5,6 +5,11 @@
|
|||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
|
@ -36,5 +41,6 @@
|
|||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
|
||||
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
|
@ -21,5 +21,6 @@ Export-Package: org.eclipse.xtext.util;
|
|||
Require-Bundle: org.eclipse.emf.ecore;bundle-version="2.10.2",
|
||||
com.google.guava;bundle-version="[10.0.1,19.0.0)";visibility:=reexport,
|
||||
com.google.inject;bundle-version="3.0.0";visibility:=reexport,
|
||||
javax.inject;bundle-version="1.0.0";resolution:=optional;visibility:=reexport;x-installation:=greedy
|
||||
javax.inject;bundle-version="1.0.0";resolution:=optional;visibility:=reexport;x-installation:=greedy,
|
||||
org.eclipse.xtend.lib;bundle-version="2.9.0"
|
||||
Import-Package: org.apache.log4j;version="1.2.15"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
source.. = src/
|
||||
source.. = src/,\
|
||||
xtend-gen/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) 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.xtext.util.internal
|
||||
|
||||
import com.google.common.annotations.Beta
|
||||
import java.lang.annotation.Target
|
||||
import org.apache.log4j.Logger
|
||||
import org.eclipse.xtend.lib.macro.AbstractClassProcessor
|
||||
import org.eclipse.xtend.lib.macro.Active
|
||||
import org.eclipse.xtend.lib.macro.TransformationContext
|
||||
import org.eclipse.xtend.lib.macro.declaration.MutableClassDeclaration
|
||||
|
||||
@Beta
|
||||
@Target(TYPE)
|
||||
@Active(LogProcessor)
|
||||
annotation Log {
|
||||
}
|
||||
|
||||
class LogProcessor extends AbstractClassProcessor {
|
||||
|
||||
override doTransform(MutableClassDeclaration cls, extension TransformationContext context) {
|
||||
cls.addField("LOG") [
|
||||
static = true
|
||||
final = true
|
||||
type = Logger.newTypeReference
|
||||
initializer = '''
|
||||
«Logger».getLogger(«cls.simpleName».class)
|
||||
'''
|
||||
primarySourceElement = cls
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue