22
33namespace Vezel . Celerity . Language . Tooling . Workspaces ;
44
5- public sealed class ProjectWorkspace : PhysicalWorkspace
5+ public sealed class ProjectWorkspace : Workspace
66{
77 public const string ConfigurationFileName = "celerity.json" ;
88
@@ -12,23 +12,26 @@ public sealed class ProjectWorkspace : PhysicalWorkspace
1212
1313 private readonly bool _disableAnalysis ;
1414
15- private ProjectWorkspace ( string path , ProjectConfiguration configuration , bool disableAnalysis )
16- : base ( path )
15+ private ProjectWorkspace (
16+ string path , SourceTextProvider textProvider , ProjectConfiguration configuration , bool disableAnalysis )
17+ : base ( path , textProvider )
1718 {
1819 Configuration = configuration ;
1920 _sourceDirectory = new ( System . IO . Path . Join ( path , configuration . SourcePath ) ) ;
2021 _disableAnalysis = disableAnalysis ;
2122 }
2223
23- public static ValueTask < ProjectWorkspace > OpenAsync ( string path , CancellationToken cancellationToken = default )
24+ public static ValueTask < ProjectWorkspace > OpenAsync (
25+ string path , SourceTextProvider textProvider , CancellationToken cancellationToken = default )
2426 {
25- return OpenAsync ( path , false , cancellationToken ) ;
27+ return OpenAsync ( path , textProvider , false , cancellationToken ) ;
2628 }
2729
2830 public static ValueTask < ProjectWorkspace > OpenAsync (
29- string path , bool disableAnalysis , CancellationToken cancellationToken = default )
31+ string path , SourceTextProvider textProvider , bool disableAnalysis , CancellationToken cancellationToken = default )
3032 {
3133 Check . Null ( path ) ;
34+ Check . Null ( textProvider ) ;
3235
3336 return OpenAsync ( ) ;
3437
@@ -43,7 +46,7 @@ async ValueTask<ProjectWorkspace> OpenAsync()
4346 await using ( stream . ConfigureAwait ( false ) )
4447 cfg = await ProjectConfiguration . LoadAsync ( stream , cancellationToken ) . ConfigureAwait ( false ) ;
4548
46- return new ( path , cfg , disableAnalysis ) ;
49+ return new ( path , textProvider , cfg , disableAnalysis ) ;
4750 }
4851 }
4952
@@ -59,7 +62,7 @@ protected override WorkspaceDocumentAttributes GetDocumentAttributes(string path
5962 ? WorkspaceDocumentAttributes . DisableAnalyzers | WorkspaceDocumentAttributes . SuppressDiagnostics
6063 : WorkspaceDocumentAttributes . None ;
6164
62- if ( ( file . DirectoryName , file . Name ) == ( _sourceDirectory . FullName , EntryPointDocumentName ) )
65+ if ( ( file . DirectoryName , file . Name ) == ( _sourceDirectory . FullName , WorkspaceDocument . EntryPointPath ) )
6366 return WorkspaceDocumentAttributes . EntryPoint | srcAttrs ;
6467
6568 var current = file . Directory ;
0 commit comments