111 dir + JFile.separator + File.platform_path(path) |
111 dir + JFile.separator + File.platform_path(path) |
112 else if (path.is_basic) dir + File.platform_path(path) |
112 else if (path.is_basic) dir + File.platform_path(path) |
113 else File.absolute_name(new JFile(dir + JFile.separator + File.platform_path(path))) |
113 else File.absolute_name(new JFile(dir + JFile.separator + File.platform_path(path))) |
114 } |
114 } |
115 |
115 |
116 def get_models: Map[JFile, VSCode_Model] = state.value.models |
116 def get_models(): Map[JFile, VSCode_Model] = state.value.models |
117 def get_model(file: JFile): Option[VSCode_Model] = get_models.get(file) |
117 def get_model(file: JFile): Option[VSCode_Model] = get_models().get(file) |
118 def get_model(name: Document.Node.Name): Option[VSCode_Model] = get_model(node_file(name)) |
118 def get_model(name: Document.Node.Name): Option[VSCode_Model] = get_model(node_file(name)) |
|
119 |
|
120 |
|
121 /* snapshot */ |
|
122 |
|
123 def snapshot(model: VSCode_Model): Document.Snapshot = |
|
124 model.session.snapshot( |
|
125 node_name = model.node_name, |
|
126 pending_edits = Document.Pending_Edits.make(get_models().values)) |
|
127 |
|
128 def get_snapshot(file: JFile): Option[Document.Snapshot] = |
|
129 get_model(file).map(snapshot) |
|
130 |
|
131 def get_snapshot(name: Document.Node.Name): Option[Document.Snapshot] = |
|
132 get_model(name).map(snapshot) |
|
133 |
|
134 |
|
135 /* rendering */ |
|
136 |
|
137 def rendering(snapshot: Document.Snapshot, model: VSCode_Model): VSCode_Rendering = |
|
138 new VSCode_Rendering(snapshot, model) |
|
139 |
|
140 def rendering(model: VSCode_Model): VSCode_Rendering = rendering(snapshot(model), model) |
|
141 |
|
142 def get_rendering(file: JFile): Option[VSCode_Rendering] = |
|
143 get_model(file).map(rendering) |
|
144 |
|
145 def get_rendering(name: Document.Node.Name): Option[VSCode_Rendering] = |
|
146 get_model(name).map(rendering) |
119 |
147 |
120 |
148 |
121 /* file content */ |
149 /* file content */ |
122 |
150 |
123 def read_file_content(name: Document.Node.Name): Option[String] = { |
151 def read_file_content(name: Document.Node.Name): Option[String] = { |
273 state.change_result { st => |
301 state.change_result { st => |
274 val (postponed, flushed) = |
302 val (postponed, flushed) = |
275 (for { |
303 (for { |
276 file <- st.pending_output.iterator |
304 file <- st.pending_output.iterator |
277 model <- st.models.get(file) |
305 model <- st.models.get(file) |
278 } yield (file, model, model.rendering())).toList.partition(_._3.snapshot.is_outdated) |
306 } yield (file, model, rendering(model))).toList.partition(_._3.snapshot.is_outdated) |
279 |
307 |
280 val changed_iterator = |
308 val changed_iterator = |
281 for { |
309 for { |
282 (file, model, rendering) <- flushed.iterator |
310 (file, model, rendering) <- flushed.iterator |
283 (changed_diags, changed_decos, model1) = model.publish(rendering) |
311 (changed_diags, changed_decos, model1) = model.publish(rendering) |