Commit Graph

272 Commits

Author SHA1 Message Date
lucebac 7513fec507 EDITOR: import resolution in code editor (#1661)
* FIX: import resolution in code editor
Since I did not find any callback where we could just load imports
on-demand, I opted for just loading all scripts from the server where
a given script was opened from command line. This does not include
scripts which are already open, only files which are not yet opened
will be loaded.
2024-09-26 11:36:42 -07:00
catloversg 4f426e1b20 UI: Change description of Documentation button in Script Editor (#1644) 2024-09-07 18:08:16 -07:00
catloversg cea0afe1f4 EDITOR: Follow-up of #1470 (Editor outline) (#1498) 2024-07-17 15:18:10 -07:00
catloversg 864613c616 MISC: Support JSX, TS, TSX script files (#1216) 2024-07-14 14:47:10 -07:00
catloversg 8f0ea7c8c4 EDITOR: Work around bug in monaco-editor (#1470) 2024-07-07 14:38:22 -07:00
catloversg f18d28fc6e DOCUMENTATION: Add link to NS API documentation (#1460) 2024-07-06 12:54:56 -07:00
David Walker 1f2e69631e EDITOR: Use ramOverride() to set compiled script RAM (#1446)
To use this, add a line like "ns.ramOverride(2);" as the first statement
in main(). Not only will it take effect at runtime, but it will now
*also* be parsed at compile time, changing the script's static RAM
limit. Since ns.ramOverride is a 0-cost function, the call to it on
startup then becomes a no-op.

This is an often-requested feature, and allows for scripts to set their
usage without it needing to be explicitly mentioned via args or options
when being launched. This also reduces pressure on the static RAM
analysis to be perfect all the time. (But certain limits, such as
"functions names must be unique across namespaces," remain.)

This also adds a tooltip to the RAM calculation, to make this slightly
discoverable.
2024-07-05 17:32:46 -07:00
catloversg e66a8e319f MISC: Remove debug code (#1448) 2024-07-01 13:16:47 -07:00
G4mingJon4s bec6e82d7f EDITOR: changed editor tabs to have their own editor mode (#1372) 2024-06-12 19:19:40 -07:00
G4mingJon4s ab80ee66c8 EDITOR: re-added vim notifications and register view (#1382) 2024-06-12 01:24:10 -07:00
G4mingJon4s 463d4cdb1d EDITOR: useVimEditor uses Material UI (#1332) 2024-06-05 18:30:03 -07:00
Caldwell f40d4f8e92 BUGFIX: fix relative imports (#1305)
Relative paths work in imports, at last.
2024-06-02 17:38:01 -07:00
catloversg 8703da4ab6 BUGFIX: Save position of cursor when switching tabs and unmounting editor (#1297) 2024-05-23 01:51:33 -07:00
G4mingJon4s 08eb60d21b EDITOR: Improved infinite loop checking (#1276) 2024-05-23 00:44:15 -07:00
gmcew 1d8a1d5089 UI: Trigger RAM checking on tab closure (#1279)
Fixes UI bug described at https://discord.com/channels/415207508303544321/415213413745164318/1240361787564490854
2024-05-17 04:46:04 -07:00
Shy d2dd6916b1 allow json (#1137)
Allow creating .json files.
Also added the json language server so syntax highlighting and validation works with the ingame editor
2024-03-06 15:52:32 -08:00
LJ 078f94cbc0 BUGFIX: Fix script editor documentation button using wrong URL (#1099)
* Fix script editor documentation button
* Fix lint and import url
2024-02-15 04:55:36 -08:00
LJ fd5b0f8241 MISC: Use structuredClone() for deep cloning (#1077) 2024-02-10 04:10:19 -05:00
Caldwell 6f8a59593a EDITOR: fix disposing models (#1026) 2024-01-09 18:45:31 -05:00
Shy 68a8427838 EDITOR: Add file URI's to monaco to improve intellisense (#1017) 2024-01-07 07:13:52 -05:00
Snarling 87925f1900 EDITOR: Reorganization and minor efficiency improvements (#886) 2023-10-23 07:02:33 -04:00
hydroflame 931d7e588a Remove more rtd references (#702) 2023-08-06 00:05:03 -04:00
Snarling 26cdc502bf Fix backwards name for indent option (#659) 2023-07-05 18:18:53 -04:00
Aleksei Bezrodnov 1d5a735941 MISC: enforce eslint react checks (#640) 2023-06-26 22:29:44 -04:00
Aleksei Bezrodnov 08e3afd125 FIX: show ram calculation error reason to player (#627) 2023-06-19 03:49:32 -04:00
Aleksei Bezrodnov 9e75621cd2 UI: add cursor options to the script editor (#615) 2023-06-18 21:17:15 -04:00
Aleksei Bezrodnov 709875d9ca FIX: script options modal issue #625 (#626) 2023-06-17 17:58:56 -04:00
Aleksei Bezrodnov 12b5c00d14 fix RAM calculation on a different server (#612) 2023-06-13 17:19:42 -04:00
Snarling 6732549196 ENUMS: Initial Enum Helper rework + Reorganization (#596) 2023-06-12 00:34:20 -04:00
Aleksei Bezrodnov 7050c90378 UI: Fix several issues with script editor tabs (#554) (#567) 2023-06-04 12:01:06 -04:00
Aleksei Bezrodnov dd9849f53d BUGFIX: script tab reordering (#563) 2023-06-03 14:26:55 -04:00
Aleksei Bezrodnov 99954ebd1e REFACTORING: ScriptEditor (#560) 2023-06-03 13:55:25 -04:00
omuretsu 7240bbe8b7 Fix hotfix 2023-05-30 20:47:01 -04:00
omuretsu 8bc67f542a Satisfy lint 2023-05-30 20:06:13 -04:00
omuretsu b65bd62345 More hotfixes...
* Script editor theme could be corrupted leading to a recovery screen, this should fix that.
* Because script filepath changes were moved before the detection of .ns files, a check was added for .ns files in BaseServer so they get the better name.
2023-05-30 20:00:43 -04:00
omuretsu 27a6b619eb Lint fix
Also reduce unnecessary imports
2023-05-16 11:41:55 -04:00
omuretsu 00522fb8f3 Fix infinite loop detection
Also debounce it with the ram calc to improve performance
2023-05-16 11:27:11 -04:00
Snarling ebae35b1fb CODEBASE: Expand lint rules, and Aliases are stored as maps (#501) 2023-05-05 03:55:59 -04:00
omuretsu 003be33886 Lint fix 2023-05-03 07:31:29 -04:00
omuretsu 3c996a47ea Fully remove formatCode function (trim on script save) 2023-05-03 07:21:23 -04:00
Snarling 62adaf3006 Various bugfix/cleanup (#489)
* parseCommands no longer removes excess whitespace (it was unneeded and also had a bug in it relating to commands that ended in a quote mark)
* more documentation and some variable renaming
* Fix script editor focus bug on navigating to the editor from sidebar
* Fix initialization for lastNodeReset and lastAugReset
2023-04-24 15:48:49 -04:00
Snarling e0272ad4af FILES: Path rework & typesafety (#479)
* Added new types for various file paths, all in the Paths folder.
* TypeSafety and other helper functions related to these types
* Added basic globbing support with * and ?. Currently only implemented for Script/Text, on nano and download terminal commands
* Enforcing the new types throughout the codebase, plus whatever rewrites happened along the way
* Server.textFiles is now a map
* TextFile no longer uses a fn property, now it is filename
* Added a shared ContentFile interface for shared functionality between TextFile and Script.
* related to ContentFile change above, the player is now allowed to move a text file to a script file and vice versa.
* File paths no longer conditionally start with slashes, and all directory names other than root have ending slashes. The player is still able to provide paths starting with / but this now indicates that the player is specifying an absolute path instead of one relative to root.
* Singularized the MessageFilename and LiteratureName enums
* Because they now only accept correct types, server.writeToXFile functions now always succeed (the only reasons they could fail before were invalid filepath).
* Fix several issues with tab completion, which included pretty much a complete rewrite
* Changed the autocomplete display options so there's less chance it clips outside the display area.
* Turned CompletedProgramName into an enum.
* Got rid of programsMetadata, and programs and DarkWebItems are now initialized immediately instead of relying on initializers called from the engine.
* For any executable (program, cct, or script file) pathing can be used directly to execute without using the run command (previously the command had to start with ./ and it wasn't actually using pathing).
2023-04-24 10:26:57 -04:00
Snarling 0df984eea0 CODEBASE: Add Jsonable Map and Set types, move player.sourceFiles to a map (#473) 2023-04-18 03:19:45 -04:00
Snarling 04d49e3a6d SCRIPTS: Script modules are reused when they are imported (#461)
Also corrects some compile race conditions.
2023-04-07 00:33:51 -04:00
Snarling 4166c09bd4 More script editor options (#386)
* Options are responsive again (fix from previous changes)
* Better height control on the monaco container using flexbox.
* Added options for tab size, auto-detect indentation per-file, font family, and font ligatures.
2023-02-24 07:37:29 -05:00
Snarling 71051cde9c Upgrade monaco and bump game version to 2.3.0dev (#369) 2023-02-23 21:43:29 -05:00
Snarling 6a6043c509 CODEBASE: Add custom useRerender hook (#359) 2023-02-11 13:22:55 -05:00
Snarling b4074328ec UI: Added new locale-aware and configurable number formatting (#354) 2023-02-11 13:18:50 -05:00
Mughur 7e183c4e4a Updated ReadTheDocs links 2023-01-06 15:24:10 +02:00
David Walker 8d793ea271 Internal refactoring of Router (#241) 2022-12-04 03:14:06 -05:00