Skip to content
Ivo Yankulovski edited this page Dec 17, 2020 · 23 revisions

ProtoSS IDE for Atom

Zeta Ret ProtoSS Atom IDE

Settings:

Settings allow to customize appearance and toggle key bindings.

Console feature allows tracking changes in editor and its token database, cursor buffer position, current/next/previous token of the same kind. Token value is always trimmed of whitespace during search, and might use case insensitive string comparison.
Open Developer tools or use keyboard shortcut CTRL + SHIFT + I.
During console development reload of atom may be required due to debugging overload of memory, shortcut is CTRL + SHIFT + F5.

Breadcrumbs will automatically appear for supported files only. You may choose to have them otherwise in order to view count of file lines or absolute path, usually positive for MD and JSON files.

Key Bindings:

  • F7 - locate current token and navigate to next token in editor
  • CTRL + F7 - locate current token and navigate to previous token in editor
  • SHIFT + F7 - locate current token and execute selection from start to end of its buffer position, you may chain selection of tokens to trace them visually
  • ALT + F7 - refresh token database and line count
  • CTRL + ALT + F7 - refresh ProtoSS IDE
  • CTRL + SHIFT + F7 - open JSON descriptor of current file
  • ALT + SHIFT + F7 - open MD documentation of current file
  • CTRL + SHIFT + ALT + F7 - access ProtoSS project protossdox.json
  • F8 - resolve token
  • ALT + F8 - resolve token in file explorer
  • CTRL + SHIFT + F8 - open all files of class supers from inheritance in the current hierarchy, requires JSON descriptor
  • CTRL + SHIFT + ALT + F8 - build project

Token resolve:

Activated by key, command or menu, will resolve current cursor token depending on implementation using a predefined order. Works with simple tokens like strings, comments, use token trace SHIFT+F7. Tokens will be broken in parts to detect in-between states i.e. JSON descriptors as String.

  • resolve hyperlink - open http or https link from within Atom in Electron instance or default system browser as external
  • resolve file path - merges active editor path with the value of token, checks file for existence and opens it. Use with require
    • resolve on stats.json or xserverModule string value will open the file
    • resolving require function with prefix parameter is allowed on string
...
sfile = global.ProtoSSCheStatsFile || 'stats.json',
...
xserverModule = './modules/XProtoSSChe.js',
...
var mod = require(appjson.indexPath || './../protoss-nodejs-basic/index.js');
...
  • resolve supername based on ProtoSS project descriptors and package namespace

JSON data format export of file tokens:

  1. Open ide-protoss settings
  2. Turn on Console
  3. Open file tab and developer tools [CTRL + SHIFT + I]
  4. Editor info appears in the console as follows:
    change editor: FILE_PATH
    editor tokens:

Array (XXX) or (XXX) [Array(XX)...]

  1. Store as global variable by opening a context menu over Array object in the console
  2. console will assign global variable name using template tempX and will output object immediately, or use:
var ideprotoss = atom.packages.activePackages['ide-protoss'];
var temp0 = ideprotoss.TokenUtil.getActiveTokens();
  1. type JSON.stringify(tempX) in console input and hit ENTER, tokens will appear as JSON string format, copy-paste for external use

Advanced text editing

Plain text and Markdown format files use simple grammar colors and tokens. You can change grammar per file CTRL + SHIFT + L and refresh ProtoSS IDE (CTRL + ALT + F7 or Click on ProtoSS icon button). Omnipotent mode must be enabled in ProtoSS package settings to work on any file extension.
If you choose your own grammar, including Auto grammar in ProtoSS settings, the file will be colorized and tokenized automatically.
If you enforce specific grammar for tokenization purposes from ProtoSS settings like TypeScript, will be able to navigate with F7 key combination and move from token to token by word.

Auto-complete:

Requires Autocomplete Plus package enabled. Recommended settings:

  • disable Include Completions From All Buffers, if you are planning to use ProtoSS Word
  • set Minimum Word Length to great value i.e. 100, if you do not want default word suggestion along with ProtoSS Word or uncheck Enable Built-In Provider
  • add - slash in Extra Word Characters
  • enable Consume suggestion text following the cursor and Automatically Confirm Single Suggestion
  • disable Alternate Scoring and Locality Bonus, to improve performance as they are not used in ProtoSS autocompletion

Fuzzy search implemented by default, JavaScript/TypeScript/HTML reserved words/global functions/native classes suggestions:
Auto-complete search

Auto-complete word
File and Directory listing:
Auto-complete file
ProtoSS hierarchy based on JSON descriptors, properties/methods, inherits/imports:
Auto-complete supername
Merger Provider:
Auto-complete merger
Auto-complete Options:
Auto-complete Options
Word Options:
Word Options

Breadcrumbs Options:
Breadcrumbs Options
Marker Styles:
Marker Styles

TypeScript Export:

Generated JSON Descriptors output *.d.ts declaration with namespace and interface for VSCode use of ProtoSS or other alike libraries.
Public, private and protected properties and methods, including constructor as new will build the interface body including multityping.
Project protossdox.json enumerates additional conversion of types unknown to TypeScript, i.e. slash namespace /interfaces.IEvent, such namespace browses the namespace upwards as directory. ProtoSS can generate interfaces and abstracts at real time, including diamond inheritance, additional configuration is required to be supported as declaration, and JSON configuration of the interface/abstract supported.

Future development of the feature:

  • configure Array<T> templates per JSON descriptor, key/name to argument key, templates may be multiple
  • protossdox.json enumerates additional type conversion alike String -> string
  • additional UI in Atom to batch folders and projects, and write declaration in node_modules/@types/project folder per class name maintaining namespace scope
  • automatic build of index.d.ts in @types/project folder importing all other classes
  • protossdox.json scripts to run in Atom and absorb converted descriptors to declarations
  • automatic build of index.ts and index.js files per module, to test interfaces, namespace, imports, instances
  • extends of interface