Commit 599d97c
committed
ProjectSnapshotManager: Ensure that Open/CloseDocument always work
It turns out that CloseDocument can easily fail resulting in IsDocumentOpen to report true for documents that are not actually open. This is because the _openDocumentSet is only updated after updating the project with a SourceText or TextLoader. For example, if the project has already been removed, CloseDocument wouldn't update the _openDocumentSet. This change updates _openDocumentSet before updating the document text, which should by more correct.1 parent 1f0b467 commit 599d97c
File tree
2 files changed
+35
-27
lines changed- src/Razor
- src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem
- test/Microsoft.VisualStudio.LanguageServices.Razor.Test/ProjectSystem
2 files changed
+35
-27
lines changedLines changed: 8 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
| 304 | + | |
311 | 305 | | |
312 | | - | |
| 306 | + | |
313 | 307 | | |
| 308 | + | |
| 309 | + | |
314 | 310 | | |
315 | 311 | | |
316 | 312 | | |
317 | 313 | | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
| 314 | + | |
325 | 315 | | |
326 | | - | |
| 316 | + | |
327 | 317 | | |
| 318 | + | |
| 319 | + | |
328 | 320 | | |
329 | 321 | | |
330 | 322 | | |
| |||
413 | 405 | | |
414 | 406 | | |
415 | 407 | | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | 408 | | |
426 | 409 | | |
427 | 410 | | |
| |||
459 | 442 | | |
460 | 443 | | |
461 | 444 | | |
462 | | - | |
463 | | - | |
464 | 445 | | |
465 | 446 | | |
466 | 447 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
892 | 892 | | |
893 | 893 | | |
894 | 894 | | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
895 | 922 | | |
0 commit comments