mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-24 11:31:31 +00:00
Created ide.write (markdown)
parent
87225a7eed
commit
6f5a2ababa
54
ide.write.md
Normal file
54
ide.write.md
Normal file
@ -0,0 +1,54 @@
|
||||
### Request
|
||||
* **Description**: Overwrites the contents of a file.
|
||||
* **Subscribers**: [IdeHandler](https://github.com/avatao-content/baseimage-tutorial-framework/wiki/IdeHandler)
|
||||
|
||||
```json
|
||||
{
|
||||
"key": "ide.write",
|
||||
"intent": "control",
|
||||
"scope": "zmq"
|
||||
}
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------ |:--------:|:------------------:| --------------------------- |
|
||||
| *filename* | `string` | :heavy_check_mark: | Full path or basename of a file. |
|
||||
| *content* | `string` | | New contents of the selected file. |
|
||||
|
||||
***
|
||||
|
||||
**Example**:
|
||||
```json
|
||||
{
|
||||
"key": "ide.write",
|
||||
"filename": "main.c",
|
||||
"content": "#include <stdio.h>..."
|
||||
}
|
||||
```
|
||||
|
||||
### Response
|
||||
* **Description**: Informs the frontend that the file was changed.
|
||||
* **Subscribers**: *none*
|
||||
|
||||
```json
|
||||
{
|
||||
"key": "ide.write",
|
||||
"scope": "websocket"
|
||||
}
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------ |:--------:|:------------------:| --------------------------- |
|
||||
| *filename* | `string` | :heavy_check_mark: | Full path or basename of a file. |
|
||||
| *files* | `array` | :heavy_check_mark: | List of every readable file according to the current patterns. |
|
||||
|
||||
***
|
||||
|
||||
**Example**:
|
||||
```json
|
||||
{
|
||||
"key": "ide.write",
|
||||
"filename": "main.c",
|
||||
"files": ["/home/main.c", "/home/not_main.c"]
|
||||
}
|
||||
```
|
Loading…
Reference in New Issue
Block a user