UI: Search and read NS API docs in editor tab and documentation tab (#2163)

This commit is contained in:
catloversg
2025-06-01 13:53:20 +07:00
committed by GitHub
parent 98f6cc9554
commit 6a23c85e12
41 changed files with 3602 additions and 130 deletions
+1 -1
View File
@@ -186,7 +186,7 @@ function Root(props: IProps): React.ReactElement {
return;
}
// this is duplicate code with saving later.
if (ITutorial.isRunning && ITutorial.currStep === iTutorialSteps.TerminalTypeScript) {
if (ITutorial.isRunning && ITutorial.currStep === iTutorialSteps.TerminalEditScript) {
//Make sure filename + code properly follow tutorial
if (currentScript.path !== "n00dles.js") {
dialogBoxCreate("Don't change the script name for now.");
+13
View File
@@ -23,6 +23,9 @@ import { OptionsModal, OptionsModalProps } from "./OptionsModal";
import { useScriptEditorContext } from "./ScriptEditorContext";
import { NsApiDocumentationLink } from "../../ui/React/NsApiDocumentationLink";
import { CurrentKeyBindings, parseKeyCombinationsToString, ScriptEditorAction } from "../../utils/KeyBindingUtils";
import { DocumentationAutocomplete } from "../../Documentation/ui/DocumentationAutocomplete";
import { openDocumentationPopUp } from "../../Documentation/root";
import { openDocExternally } from "../../ui/React/Documentation";
type IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;
@@ -82,6 +85,16 @@ export function Toolbar({ editor, onSave, onRun }: IProps) {
Run
</Button>
</Tooltip>
<DocumentationAutocomplete
sx={{ marginRight: "10px" }}
onChange={(path, external) => {
if (external) {
openDocExternally(path);
return;
}
openDocumentationPopUp(path);
}}
/>
<Typography>
<NsApiDocumentationLink />
</Typography>