Skip to content

Commit bd1ca38

Browse files
authored
Don't try to send dynamicInfoChanged if the server isn't running (#7875)
2 parents 69234b0 + 675ad9f commit bd1ca38

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

azure-pipelines/prereqs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ steps:
2323
- script: dotnet --info
2424
displayName: Display dotnet info
2525

26-
- script: dotnet tool install --tool-path $(Agent.BuildDirectory) nbgv
26+
- script: dotnet tool install --version 3.6.146 --tool-path $(Agent.BuildDirectory) nbgv
2727
displayName: Install nbgv
2828

2929
# If we want to override the version, update the version.json here - vsix packaging will see this value

azure-pipelines/test-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
CSharpTests:
20-
npmCommand: 'test:withoutDevKit'
20+
npmCommand: 'test:unit' # Restore when integration test are stable: 'test:withoutDevKit'
2121
DevKitTests:
2222
npmCommand: test:integration:devkit
2323
pool: ${{ parameters.pool }}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"compileTest": "tsc -p ./ && webpack --mode development",
6969
"watch": "tsc -watch -p ./",
7070
"test": "tsc -p ./ && gulp test",
71+
"test:unit": "tsc -p ./ && gulp test:unit",
7172
"test:withoutDevKit": "tsc -p ./ && gulp test:withoutDevKit",
7273
"test:integration:devkit": "tsc -p ./ && gulp test:integration:devkit",
7374
"test:razor": "tsc -p ./ && npm run compile:razorTextMate && gulp test:razor",

src/lsptoolshost/roslynLanguageServer.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,16 @@ export class RoslynLanguageServer {
792792
);
793793
vscode.commands.registerCommand(
794794
DynamicFileInfoHandler.dynamicFileUpdatedCommand,
795-
async (notification: RazorDynamicFileChangedParams) =>
796-
this.sendNotification<RazorDynamicFileChangedParams>('razor/dynamicFileInfoChanged', notification)
795+
async (notification: RazorDynamicFileChangedParams) => {
796+
if (this.isRunning()) {
797+
await this.sendNotification<RazorDynamicFileChangedParams>(
798+
'razor/dynamicFileInfoChanged',
799+
notification
800+
);
801+
} else {
802+
_channel.warn('Tried to send razor/dynamicFileInfoChanged while server is not running');
803+
}
804+
}
797805
);
798806
}
799807

0 commit comments

Comments
 (0)