Search in sources :

Example 1 with IProjectConfigProvider

use of org.eclipse.xtext.workspace.IProjectConfigProvider in project xtext-xtend by eclipse.

the class JavaIoFileSystemTest method setUp.

@Before
public void setUp() {
    try {
        final File tempDir = this.temporaryFolder.newFolder();
        JavaIOFileSystemSupport _javaIOFileSystemSupport = new JavaIOFileSystemSupport();
        final Procedure1<JavaIOFileSystemSupport> _function = (JavaIOFileSystemSupport it) -> {
            final IProjectConfigProvider _function_1 = (ResourceSet it_1) -> {
                File _file = new File(tempDir, "foo");
                FileProjectConfig _fileProjectConfig = new FileProjectConfig(_file);
                final Procedure1<FileProjectConfig> _function_2 = (FileProjectConfig it_2) -> {
                    it_2.addSourceFolder("src");
                };
                return ObjectExtensions.<FileProjectConfig>operator_doubleArrow(_fileProjectConfig, _function_2);
            };
            it.setProjectConfigProvider(_function_1);
            IEncodingProvider.Runtime _runtime = new IEncodingProvider.Runtime();
            it.setEncodingProvider(_runtime);
            XtextResourceSet _xtextResourceSet = new XtextResourceSet();
            it.setContext(_xtextResourceSet);
        };
        JavaIOFileSystemSupport _doubleArrow = ObjectExtensions.<JavaIOFileSystemSupport>operator_doubleArrow(_javaIOFileSystemSupport, _function);
        this.fs = _doubleArrow;
        this.createProject("foo");
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : JavaIOFileSystemSupport(org.eclipse.xtend.core.macro.JavaIOFileSystemSupport) XtextResourceSet(org.eclipse.xtext.resource.XtextResourceSet) IEncodingProvider(org.eclipse.xtext.parser.IEncodingProvider) IProjectConfigProvider(org.eclipse.xtext.workspace.IProjectConfigProvider) ResourceSet(org.eclipse.emf.ecore.resource.ResourceSet) XtextResourceSet(org.eclipse.xtext.resource.XtextResourceSet) FileProjectConfig(org.eclipse.xtext.workspace.FileProjectConfig) File(java.io.File) Before(org.junit.Before)

Example 2 with IProjectConfigProvider

use of org.eclipse.xtext.workspace.IProjectConfigProvider in project xtext-xtend by eclipse.

the class JavaIoFileSystemTest method setUp.

@Before
public void setUp() {
    try {
        final File tempDir = this.temporaryFolder.newFolder();
        JavaIOFileSystemSupport _javaIOFileSystemSupport = new JavaIOFileSystemSupport();
        final Procedure1<JavaIOFileSystemSupport> _function = (JavaIOFileSystemSupport it) -> {
            final IProjectConfigProvider _function_1 = (ResourceSet it_1) -> {
                File _file = new File(tempDir, "foo");
                FileProjectConfig _fileProjectConfig = new FileProjectConfig(_file);
                final Procedure1<FileProjectConfig> _function_2 = (FileProjectConfig it_2) -> {
                    it_2.addSourceFolder("src");
                };
                return ObjectExtensions.<FileProjectConfig>operator_doubleArrow(_fileProjectConfig, _function_2);
            };
            it.setProjectConfigProvider(_function_1);
            IEncodingProvider.Runtime _runtime = new IEncodingProvider.Runtime();
            it.setEncodingProvider(_runtime);
            XtextResourceSet _xtextResourceSet = new XtextResourceSet();
            it.setContext(_xtextResourceSet);
        };
        JavaIOFileSystemSupport _doubleArrow = ObjectExtensions.<JavaIOFileSystemSupport>operator_doubleArrow(_javaIOFileSystemSupport, _function);
        this.fs = _doubleArrow;
        this.createProject("foo");
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : JavaIOFileSystemSupport(org.eclipse.xtend.core.macro.JavaIOFileSystemSupport) XtextResourceSet(org.eclipse.xtext.resource.XtextResourceSet) IEncodingProvider(org.eclipse.xtext.parser.IEncodingProvider) IProjectConfigProvider(org.eclipse.xtext.workspace.IProjectConfigProvider) ResourceSet(org.eclipse.emf.ecore.resource.ResourceSet) XtextResourceSet(org.eclipse.xtext.resource.XtextResourceSet) FileProjectConfig(org.eclipse.xtext.workspace.FileProjectConfig) File(java.io.File) Before(org.junit.Before)

Aggregations

File (java.io.File)2 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)2 JavaIOFileSystemSupport (org.eclipse.xtend.core.macro.JavaIOFileSystemSupport)2 IEncodingProvider (org.eclipse.xtext.parser.IEncodingProvider)2 XtextResourceSet (org.eclipse.xtext.resource.XtextResourceSet)2 FileProjectConfig (org.eclipse.xtext.workspace.FileProjectConfig)2 IProjectConfigProvider (org.eclipse.xtext.workspace.IProjectConfigProvider)2 Before (org.junit.Before)2