MISC: Add raw command string to autocomplete data (#1846)

This commit is contained in:
catloversg
2024-12-18 18:16:38 +07:00
committed by GitHub
parent cffd6d75a6
commit bb7a1fbb22
4 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [AutocompleteData](./bitburner.autocompletedata.md) &gt; [command](./bitburner.autocompletedata.command.md)
## AutocompleteData.command property
The raw command string that you have typed until you press \[Tab\] to use the autocomplete feature.
For example, if you type `[Space]run test.js[Space][Space][Space][Press tab to use autocomplete]`<!-- -->, "command" will contain all space characters (1 space character before "run" and 3 space characters after ".js").
**Signature:**
```typescript
command: string;
```

View File

@@ -16,6 +16,7 @@ interface AutocompleteData
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [command](./bitburner.autocompletedata.command.md) | | string | <p>The raw command string that you have typed until you press \[Tab\] to use the autocomplete feature.</p><p>For example, if you type <code>[Space]run test.js[Space][Space][Space][Press tab to use autocomplete]</code>, "command" will contain all space characters (1 space character before "run" and 3 space characters after ".js").</p> |
| [enums](./bitburner.autocompletedata.enums.md) | | [NSEnums](./bitburner.nsenums.md) | Netscript Enums |
| [filename](./bitburner.autocompletedata.filename.md) | | string | The filename of the script about to be run |
| [hostname](./bitburner.autocompletedata.hostname.md) | | string | The hostname of the server the script would be running on |

View File

@@ -9671,6 +9671,13 @@ interface AutocompleteData {
filename: string;
/** The processes running on the host */
processes: ProcessInfo[];
/**
* The raw command string that you have typed until you press [Tab] to use the autocomplete feature.
*
* For example, if you type `[Space]run test.js[Space][Space][Space][Press tab to use autocomplete]`, "command" will
* contain all space characters (1 space character before "run" and 3 space characters after ".js").
*/
command: string;
}
/**

View File

@@ -324,6 +324,7 @@ export async function getTabCompletionPossibilities(terminalText: string, baseDi
temporary: r.temporary,
})),
).flat(),
command: terminalText,
};
let pos: string[] = [];
let pos2: string[] = [];