Added missing code block language in docs (#147481)

- added language for all code blocks
- replaced `bash` or `shell` with `sh` for consistency.
- added `sh` and `console` in the GitHub template link generator.
- updated test for GitHub template.
This commit is contained in:
Kishan Dhankecha
2024-05-01 20:14:27 +05:30
committed by GitHub
parent cb2197e9b3
commit 2867ac7885
28 changed files with 58 additions and 58 deletions

View File

@@ -4,7 +4,7 @@
The `flutter` command-line tool supports a daemon server mode for use by IDEs and other tools.
```
```sh
flutter daemon
```
@@ -16,13 +16,13 @@ A set of `flutter daemon` commands/events are also exposed via `flutter run --ma
The daemon speaks [JSON-RPC](http://json-rpc.org/) to clients. It uses stdin and stdout as the transport protocol. To send a command to the server, create your command as a JSON-RPC message, encode it to JSON, surround the encoded text with square brackets, and write it as one line of text to the stdin of the process:
```
```json
[{"method":"daemon.version","id":0}]
```
The response will come back as a single line from stdout:
```
```json
[{"id":0,"result":"0.1.0"}]
```
@@ -34,17 +34,17 @@ Each command should have a `method` field. This is in the form '`domain.command`
Any params for that command should be passed in through a `params` field. Here's an example request/response for the `device.getDevices` method:
```
```json
[{"method":"device.getDevices","id":2}]
```
```
```json
[{"id":2,"result":[{"id":"702ABC1F-5EA5-4F83-84AB-6380CA91D39A","name":"iPhone 6","platform":"ios_x64","available":true}]}]
```
Events that come from the server will have an `event` field containing the type of event, along with a `params` field.
```
```json
[{"event":"device.added","params":{"id":"1DD6786B-37D4-4355-AA15-B818A87A18B4","name":"iPhone XS Max","platform":"ios","emulator":true,"ephemeral":false,"platformType":"ios","category":"mobile"}}]
```

View File

@@ -53,7 +53,7 @@ Some custom requests are available for clients to call. Below are the Flutter-sp
`hotReload` injects updated source code files into the running VM and then rebuilds the widget tree. An optional `reason` can be provided and should usually be `"manual"` or `"save"` to indicate what how the reload was triggered (for example by the user clicking a button, versus a hot-reload-on-save feature).
```
```json
{
"reason": "manual"
}
@@ -63,7 +63,7 @@ Some custom requests are available for clients to call. Below are the Flutter-sp
`hotRestart` updates the code on the device and performs a full restart (which does not preserve state). An optional `reason` can be provided and should usually be `"manual"` or `"save"` to indicate what how the reload was triggered (for example by the user clicking a button, versus a hot-reload-on-save feature).
```
```json
{
"reason": "manual"
}
@@ -81,7 +81,7 @@ This event is emitted when the application has started up. Unlike `dart.debugger
When the value of a Flutter service extension changes, this event is emitted and includes the new value. Values are always encoded as strings, even if numeric/boolean.
```
```json
{
"type": "event",
"event": "flutter.serviceExtensionStateChanged",

View File

@@ -85,7 +85,7 @@ class GitHubTemplateCreator {
final String title = '[tool_crash] $errorString';
final String body = '''
## Command
```
```sh
$command
```
@@ -96,10 +96,10 @@ $command
## Logs
$errorString
```
```console
${LineSplitter.split(stackTrace.toString()).take(25).join('\n')}
```
```
```console
$doctorText
```

View File

@@ -165,10 +165,10 @@ void main() {
expect(
await creator.toolCrashIssueTemplateGitHubURL(command, error, stackTrace, doctorText),
'https://github.com/flutter/flutter/issues/new?title=%5Btool_crash%5D+ArgumentError%3A+'
'Invalid+argument%28s%29%3A+argument+error+message&body=%23%23+Command%0A%60%60%60%0A'
'Invalid+argument%28s%29%3A+argument+error+message&body=%23%23+Command%0A%60%60%60sh%0A'
'flutter+test%0A%60%60%60%0A%0A%23%23+Steps+to+Reproduce%0A1.+...%0A2.+...%0A3.+...%0'
'A%0A%23%23+Logs%0AArgumentError%3A+Invalid+argument%28s%29%3A+argument+error+message'
'%0A%60%60%60%0Atrace%0A%60%60%60%0A%60%60%60%0A+%5B%E2%9C%93%5D+Flutter+%28Channel+r'
'%0A%60%60%60console%0Atrace%0A%60%60%60%0A%60%60%60console%0A+%5B%E2%9C%93%5D+Flutter+%28Channel+r'
'eport%0A%60%60%60%0A%0A%23%23+Flutter+Application+Metadata%0ANo+pubspec+in+working+d'
'irectory.%0A&labels=tool%2Csevere%3A+crash'
);
@@ -222,7 +222,7 @@ project_type: app
final String? actualBody = Uri.parse(actualURL).queryParameters['body'];
const String expectedBody = '''
## Command
```
```sh
flutter test
```
@@ -233,10 +233,10 @@ flutter test
## Logs
ArgumentError: Invalid argument(s): argument error message
```
```console
trace
```
```
```console
[✓] Flutter (Channel report
```

View File

@@ -6,7 +6,7 @@ Dart VM and Flutter integration.
Use this command to run (from the `flutter_tools` directory):
```shell
```sh
../../bin/cache/dart-sdk/bin/dart run test test/integration.shard
```

View File

@@ -6,7 +6,7 @@ Dart web debug services (dwds) and Flutter integration.
Use this command to run (from the `flutter_tools` directory):
```shell
```sh
../../bin/cache/dart-sdk/bin/dart run test test/web.shard
```