@@ -12,7 +12,7 @@ use std::{
1212
1313use intern:: Symbol ;
1414use proc_macro:: bridge:: { self , server} ;
15- use span:: { Span , FIXUP_ERASED_FILE_AST_ID_MARKER } ;
15+ use span:: { FileId , Span , FIXUP_ERASED_FILE_AST_ID_MARKER } ;
1616use tt:: { TextRange , TextSize } ;
1717
1818use crate :: server_impl:: {
@@ -32,8 +32,10 @@ mod tt {
3232
3333type TokenStream = crate :: server_impl:: TokenStream < Span > ;
3434
35- #[ derive( Clone ) ]
36- pub struct SourceFile ;
35+ #[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
36+ pub struct SourceFile {
37+ file_id : FileId ,
38+ }
3739pub struct FreeFunctions ;
3840
3941pub struct RaSpanServer {
@@ -291,9 +293,8 @@ impl server::TokenStream for RaSpanServer {
291293}
292294
293295impl server:: SourceFile for RaSpanServer {
294- fn eq ( & mut self , _file1 : & Self :: SourceFile , _file2 : & Self :: SourceFile ) -> bool {
295- // FIXME
296- true
296+ fn eq ( & mut self , file1 : & Self :: SourceFile , file2 : & Self :: SourceFile ) -> bool {
297+ file1 == file2
297298 }
298299 fn path ( & mut self , _file : & Self :: SourceFile ) -> String {
299300 // FIXME
@@ -308,9 +309,8 @@ impl server::Span for RaSpanServer {
308309 fn debug ( & mut self , span : Self :: Span ) -> String {
309310 format ! ( "{:?}" , span)
310311 }
311- fn source_file ( & mut self , _span : Self :: Span ) -> Self :: SourceFile {
312- // FIXME stub, requires db
313- SourceFile { }
312+ fn source_file ( & mut self , span : Self :: Span ) -> Self :: SourceFile {
313+ SourceFile { file_id : span. anchor . file_id . file_id ( ) }
314314 }
315315 fn save_span ( & mut self , _span : Self :: Span ) -> usize {
316316 // FIXME, quote is incompatible with third-party tools
0 commit comments