public override RazorProjectEngine Create(
            ProjectSnapshot project,
            RazorProjectFileSystem fileSystem,
            Action <RazorProjectEngineBuilder> configure)
        {
            var remoteFileSystem = new RemoteRazorProjectFileSystem(_filePathNormalizer);

            return(base.Create(project, remoteFileSystem, configure));
        }
Ejemplo n.º 2
0
        public void GetItem_RootedFilePath_DoesNotBelongToProject()
        {
            // Arrange
            var fileSystem       = new RemoteRazorProjectFileSystem("C:/path/to", FilePathNormalizer);
            var documentFilePath = "C:/otherpath/to/file.cshtml";

            // Act
            var item = fileSystem.GetItem(documentFilePath, fileKind: null);

            // Assert
            Assert.Equal(documentFilePath, item.FilePath);
            Assert.Equal(documentFilePath, item.PhysicalPath);
        }
Ejemplo n.º 3
0
        public void GetItem_RootlessFilePath()
        {
            // Arrange
            var fileSystem       = new RemoteRazorProjectFileSystem("/C:/path/to", FilePathNormalizer);
            var documentFilePath = "file.cshtml";

            // Act
            var item = fileSystem.GetItem(documentFilePath, fileKind: null);

            // Assert
            Assert.Equal(documentFilePath, item.FilePath);
            Assert.Equal("/C:/path/to/file.cshtml", item.PhysicalPath);
        }
Ejemplo n.º 4
0
        public override RazorProjectEngine Create(
            RazorConfiguration configuration,
            RazorProjectFileSystem fileSystem,
            Action <RazorProjectEngineBuilder> configure)
        {
            if (!(fileSystem is DefaultRazorProjectFileSystem defaultFileSystem))
            {
                Debug.Fail("Unexpected file system.");
                return(null);
            }

            var remoteFileSystem = new RemoteRazorProjectFileSystem(defaultFileSystem.Root, _filePathNormalizer);

            return(base.Create(configuration, remoteFileSystem, configure));
        }
        public override RazorProjectEngine Create(
            RazorConfiguration configuration,
            RazorProjectFileSystem fileSystem,
            Action <RazorProjectEngineBuilder> configure)
        {
            if (!(fileSystem is DefaultRazorProjectFileSystem defaultFileSystem))
            {
                Debug.Fail("Unexpected file system.");
                return(null);
            }

            var remoteFileSystem = new RemoteRazorProjectFileSystem(defaultFileSystem.Root, _filePathNormalizer);

            return(base.Create(configuration, remoteFileSystem, Configure));

            void Configure(RazorProjectEngineBuilder builder)
            {
                configure(builder);
                builder.Features.Add(new RemoteCodeGenerationOptionsFeature(_optionsMonitor));
            }
        }