Beispiel #1
0
        public void TestCsprojResolution()
        {
            string directory = Path.Combine(TestUtils.GetApplicationRoot(), "..\\AvaloniaSample\\Views\\MainWindow.axaml");

            var mapper = new TextDocumentToProjectMapper(Substitute.For <ILogger <TextDocumentToProjectMapper> >());

            string csprojPath = mapper.GetProjectForDocument(directory);

            Assert.Equal(CsProjLocation, csprojPath);
        }
Beispiel #2
0
        public Metadata GetMetadataForDocument(string documentPath)
        {
            string projectPath = _documentMapper.GetProjectForDocument(documentPath);

            if (projectPath == null)
            {
                return(null);
            }

            var metadataTask = _metadataRepository.GetMetadataForProject(projectPath);

            if (!metadataTask.IsCompletedSuccessfully)
            {
                return(null);
            }
            return(metadataTask.Result);
        }