]> git.lizzy.rs Git - rust.git/blobdiff - crates/ra_lsp_server/src/world.rs
translate \n -> \r\n on the way out
[rust.git] / crates / ra_lsp_server / src / world.rs
index 9990ef62e163928691fb8265607ba22bd84608b6..10f96812fbd2bc01ae7a2e660254c3809fafe316 100644 (file)
@@ -9,7 +9,7 @@
 use ra_ide_api::{
     Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, LibraryData, SourceRootId,
 };
-use ra_vfs::{RootEntry, Vfs, VfsChange, VfsFile, VfsRoot};
+use ra_vfs::{LineEndings, RootEntry, Vfs, VfsChange, VfsFile, VfsRoot};
 use ra_vfs_glob::{Glob, RustPackageFilterBuilder};
 use relative_path::RelativePathBuf;
 
@@ -210,6 +210,10 @@ pub fn file_id_to_uri(&self, id: FileId) -> Result<Url> {
         Ok(url)
     }
 
+    pub fn file_line_endings(&self, id: FileId) -> LineEndings {
+        self.vfs.read().file_line_endings(VfsFile(id.0))
+    }
+
     pub fn path_to_uri(&self, root: SourceRootId, path: &RelativePathBuf) -> Result<Url> {
         let base = self.vfs.read().root2path(VfsRoot(root.0));
         let path = path.to_path(base);