10 ide.read
therealkrispet edited this page 2019-11-18 11:02:40 +01:00

Request

  • Description: Attempts to fetch the contents of a file, then loads it in the IDE. You can also define new patterns for allowed files.
  • Subscribers: FrontendProxyHandler, IdeHandler, IdeComponent
{
    "key": "ide.read"
}
Parameter Type Required Description
filename string ✔️ Full path or basename of a file.
patterns array Expects a list of glob patterns that will be matched against the absolute paths of file system nodes. Important: symbolic links are always resolved.

Example:

{
    "key": "ide.read",
    "filename": "main.c"
}

Response

  • Description: Returns with the content of the selected file.
  • Subscribers: IdeComponent
{
    "key": "ide.read"
}
Parameter Type Required Description
filename string ✔️ Full path or basename of a file.
content string ✔️ Content stored in the file.
files array ✔️ List of every readable file according to the current patterns.

Example:

{
    "key": "ide.read",
    "filename": "main.c",
    "files": ["/home/main.c", "/home/not_main.c"],
    "content": "#include <stdio.h>..."
}