Skip to content

Commit 8083079

Browse files
committed
Merged PR 474164: Fix issue with Razor editing of deleted files
Goes with dotnet/razor#8759 to fix #1823464 Won't be merged until I can update it with a Razor bump. Essentially, when a file was deleted we were removing all our knowledge of the document, but with Green's delete behaviour, and VS Codes lazy `didClose` (and the fact that the file system exists) that could cause us to be in a bad state. We already have code in place that calls `removeDocument` when a document is closed, if it isn't in the workspace. Related work items: #1823464
2 parents bd18521 + b52c3f6 commit 8083079

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"defaults": {
3838
"roslyn": "4.7.0-2.23272.9",
3939
"omniSharp": "1.39.6",
40-
"razor": "7.0.0-preview.23272.3"
40+
"razor": "7.0.0-preview.23275.2"
4141
},
4242
"main": "./dist/extension",
4343
"brokeredServices": [
@@ -544,7 +544,7 @@
544544
{
545545
"id": "Razor",
546546
"description": "Razor Language Server (Windows / x64)",
547-
"url": "https://download.visualstudio.microsoft.com/download/pr/576f9ae5-59eb-47ec-9d50-a230f6109561/3207901c89a7cff26442a999a4dacc51/razorlanguageserver-win-x64-7.0.0-preview.23272.3.zip",
547+
"url": "https://download.visualstudio.microsoft.com/download/pr/badc9874-13de-4e0c-bad3-ea51383f5a51/477b855ceecec09efb2045364090418d/razorlanguageserver-win-x64-7.0.0-preview.23275.2.zip",
548548
"installPath": ".razor",
549549
"platforms": [
550550
"win32"
@@ -556,7 +556,7 @@
556556
{
557557
"id": "Razor",
558558
"description": "Razor Language Server (Windows / x86)",
559-
"url": "https://download.visualstudio.microsoft.com/download/pr/576f9ae5-59eb-47ec-9d50-a230f6109561/a2044198c2f26c2e877daee6156498e5/razorlanguageserver-win-x86-7.0.0-preview.23272.3.zip",
559+
"url": "https://download.visualstudio.microsoft.com/download/pr/badc9874-13de-4e0c-bad3-ea51383f5a51/24405c0cf69106fdb63e48b2612c1416/razorlanguageserver-win-x86-7.0.0-preview.23275.2.zip",
560560
"installPath": ".razor",
561561
"platforms": [
562562
"win32"
@@ -568,7 +568,7 @@
568568
{
569569
"id": "Razor",
570570
"description": "Razor Language Server (Windows / ARM64)",
571-
"url": "https://download.visualstudio.microsoft.com/download/pr/576f9ae5-59eb-47ec-9d50-a230f6109561/0341a44e7e3f4678cd3bf0f03077b88d/razorlanguageserver-win-arm64-7.0.0-preview.23272.3.zip",
571+
"url": "https://download.visualstudio.microsoft.com/download/pr/badc9874-13de-4e0c-bad3-ea51383f5a51/e5b0a15d0b9d2ba3e3014315b6ea9407/razorlanguageserver-win-arm64-7.0.0-preview.23275.2.zip",
572572
"installPath": ".razor",
573573
"platforms": [
574574
"win32"
@@ -580,7 +580,7 @@
580580
{
581581
"id": "Razor",
582582
"description": "Razor Language Server (Linux / x64)",
583-
"url": "https://download.visualstudio.microsoft.com/download/pr/576f9ae5-59eb-47ec-9d50-a230f6109561/5f0a5a054a3df9d3b3a72a31abd73d9e/razorlanguageserver-linux-x64-7.0.0-preview.23272.3.zip",
583+
"url": "https://download.visualstudio.microsoft.com/download/pr/badc9874-13de-4e0c-bad3-ea51383f5a51/057b76d69f86efcc7c23d4bc7272bd94/razorlanguageserver-linux-x64-7.0.0-preview.23275.2.zip",
584584
"installPath": ".razor",
585585
"platforms": [
586586
"linux"
@@ -595,7 +595,7 @@
595595
{
596596
"id": "Razor",
597597
"description": "Razor Language Server (Linux ARM64)",
598-
"url": "https://download.visualstudio.microsoft.com/download/pr/576f9ae5-59eb-47ec-9d50-a230f6109561/c852a151e48cefa41b6fce257badb762/razorlanguageserver-linux-arm64-7.0.0-preview.23272.3.zip",
598+
"url": "https://download.visualstudio.microsoft.com/download/pr/badc9874-13de-4e0c-bad3-ea51383f5a51/77b20657f7b71760d4befa8f5b48bb1c/razorlanguageserver-linux-arm64-7.0.0-preview.23275.2.zip",
599599
"installPath": ".razor",
600600
"platforms": [
601601
"linux"
@@ -610,7 +610,7 @@
610610
{
611611
"id": "Razor",
612612
"description": "Razor Language Server (Linux musl / x64)",
613-
"url": "https://download.visualstudio.microsoft.com/download/pr/576f9ae5-59eb-47ec-9d50-a230f6109561/628c787509d17cfe2b5654d52ca971e4/razorlanguageserver-linux-musl-x64-7.0.0-preview.23272.3.zip",
613+
"url": "https://download.visualstudio.microsoft.com/download/pr/badc9874-13de-4e0c-bad3-ea51383f5a51/cd9dc77613f131dbbd573f9bd35b783b/razorlanguageserver-linux-musl-x64-7.0.0-preview.23275.2.zip",
614614
"installPath": ".razor",
615615
"platforms": [
616616
"linux-musl"
@@ -625,7 +625,7 @@
625625
{
626626
"id": "Razor",
627627
"description": "Razor Language Server (Linux musl ARM64)",
628-
"url": "https://download.visualstudio.microsoft.com/download/pr/576f9ae5-59eb-47ec-9d50-a230f6109561/871d917bb638c823e847d627929fbfea/razorlanguageserver-linux-musl-arm64-7.0.0-preview.23272.3.zip",
628+
"url": "https://download.visualstudio.microsoft.com/download/pr/badc9874-13de-4e0c-bad3-ea51383f5a51/50520a9da2d929c6963e1d43e1c1f278/razorlanguageserver-linux-musl-arm64-7.0.0-preview.23275.2.zip",
629629
"installPath": ".razor",
630630
"platforms": [
631631
"linux-musl"
@@ -640,7 +640,7 @@
640640
{
641641
"id": "Razor",
642642
"description": "Razor Language Server (macOS / x64)",
643-
"url": "https://download.visualstudio.microsoft.com/download/pr/576f9ae5-59eb-47ec-9d50-a230f6109561/31e2ab46d9d1952f8a494fcd2b07a9e1/razorlanguageserver-osx-x64-7.0.0-preview.23272.3.zip",
643+
"url": "https://download.visualstudio.microsoft.com/download/pr/badc9874-13de-4e0c-bad3-ea51383f5a51/8e3b2bda0270673beb7bf6afe8acceb9/razorlanguageserver-osx-x64-7.0.0-preview.23275.2.zip",
644644
"installPath": ".razor",
645645
"platforms": [
646646
"darwin"
@@ -655,7 +655,7 @@
655655
{
656656
"id": "Razor",
657657
"description": "Razor Language Server (macOS ARM64)",
658-
"url": "https://download.visualstudio.microsoft.com/download/pr/576f9ae5-59eb-47ec-9d50-a230f6109561/d1c346e0e2a1f9904fc25c9e12d774a8/razorlanguageserver-osx-arm64-7.0.0-preview.23272.3.zip",
658+
"url": "https://download.visualstudio.microsoft.com/download/pr/badc9874-13de-4e0c-bad3-ea51383f5a51/49828192b55eaa95e02aa58bcaaf9313/razorlanguageserver-osx-arm64-7.0.0-preview.23275.2.zip",
659659
"installPath": ".razor",
660660
"platforms": [
661661
"darwin"

src/razor/src/Document/RazorDocumentManager.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ export class RazorDocumentManager implements IRazorDocumentManager {
115115
const watcher = vscode.workspace.createFileSystemWatcher(RazorLanguage.globbingPattern);
116116
const didCreateRegistration = watcher.onDidCreate(
117117
async (uri: vscode.Uri) => this.addDocument(uri));
118-
const didDeleteRegistration = watcher.onDidDelete(
119-
async (uri: vscode.Uri) => this.removeDocument(uri));
120118
const didOpenRegistration = vscode.workspace.onDidOpenTextDocument(async document => {
121119
if (document.languageId !== RazorLanguage.id) {
122120
return;
@@ -142,7 +140,6 @@ export class RazorDocumentManager implements IRazorDocumentManager {
142140
return vscode.Disposable.from(
143141
watcher,
144142
didCreateRegistration,
145-
didDeleteRegistration,
146143
didOpenRegistration,
147144
didCloseRegistration);
148145
}

0 commit comments

Comments
 (0)