|
1 | 1 | # Modes In Text Forge |
2 | 2 |
|
3 | 3 | Text Forge is lightweight and language agnostic, So there is no default dependence on any language. But how you can work |
4 | | -with any file type and have special features like syntax highlighter? |
5 | | -This is where the mods come in, a mode is a special module designed to adapt to certain types of files and languages, |
6 | | -you can enter the mods and leave the rest to the editor, everything is automatically managed to you can work with files. |
| 4 | +with any file type and have special features like syntax highlighters and linters? |
| 5 | +This is where the modes come in, a mode is a special module designed to adapt to certain types of files and languages, |
| 6 | +you can install the modes and leave the rest to the editor, everything is automatically managed to you can work with files. |
7 | 7 |
|
8 | | -## Packages |
| 8 | +## Mode Features |
| 9 | + |
| 10 | +There is a list of all standard available features for modes, some mode can have more features with custom solutions and |
| 11 | +some modes can haven't one or more feature is this list. In short, you can find optional features with *optional* tag, |
| 12 | +features of a mode depends on its developers: |
| 13 | + |
| 14 | +- **Save & Load** |
| 15 | + |
| 16 | + Modes can encode and decode files, with this customizable encoding system you can work with a lot of files, even |
| 17 | + with files they aren't text files! |
| 18 | + |
| 19 | +- **Syntax Highlighter** _optional_ |
| 20 | + |
| 21 | + We provide both simple and advanced syntax highlighting ability to mode developers, including simple highlighters to |
| 22 | + fully customized highlighters. Highlighters currently can just one theme and highlighter colors are completely mode-driven. |
| 23 | + |
| 24 | +- **Advanced Commenting Handling** _optional_ |
| 25 | + |
| 26 | + We have easy API for defining comment delimiters and logics. Editor provides line folding and more based on these |
| 27 | + information. |
| 28 | + |
| 29 | +- **Mode Panels** _optional_ |
| 30 | + |
| 31 | + Modes can have their panels, so you can configure a mode visually based on mode features. |
| 32 | + |
| 33 | +- **Auto Format** & **Auto Indent** _optional_ |
| 34 | + |
| 35 | + We provide auto format and auto indent options separately, you can run these options to clean your files with modes' |
| 36 | + power. You can use these features from command palette, menus, or with shortcuts; These features are available in |
| 37 | + `Edit > Indention > Auto Indent` and `Format > Auto Format`, to see shortcuts, type `Auto Indent` or `Auto Format` |
| 38 | + in command palette. |
| 39 | + |
| 40 | +- **Initialization Lifecycle** |
| 41 | + |
| 42 | + We have high standards about your files safety, so a mode will load completely before working with your file, or if |
| 43 | + initialization fails, we will cancel task. |
| 44 | + |
| 45 | +- **Code Completion** _optional_ |
| 46 | + |
| 47 | + We provide a mode-based code completion to you with complete API for mode developers, so features and smartness of |
| 48 | + this feature is based on your current mode. |
| 49 | + |
| 50 | +- **Preview Rendering** _optional_ |
| 51 | + |
| 52 | + Modes can generate live preview based on your file, and you can see this preview in **Preview Panel** in right side of editor. |
| 53 | + |
| 54 | +- **File Outline** _optional_ |
| 55 | + |
| 56 | + You can navigate between sections in your file or review them in **Outline Panel** in left side of editor, this is a |
| 57 | + mode-driven feature too, so this section features are based on your mode. |
| 58 | + |
| 59 | +- **Linting** _optional_ |
| 60 | + |
| 61 | + We currently haven't supported LSP & DAP client ([feature tracking issue↗️](https://github.com/text-forge/text-forge/issues/88)) |
| 62 | + for complete language based features, but we have a simple mode-driven linting feature, and you can see your file |
| 63 | + problems in **Problems Panel** in bottom of editor, in this panel all error and warnings provided by mode will show |
| 64 | + , and you can navigate between them by clicking on an item. |
| 65 | + |
| 66 | +!!! Note |
| 67 | + |
| 68 | + A lot of above features were added in TFM API v2.0, you can read more about this API [here](mode_development.md#text-forge-mode-api). |
| 69 | + We provide a lot of these features as optional features, because a mode can work with simple text or non-code files, |
| 70 | + so there is a lot of optional but basic features. |
| 71 | + |
| 72 | +!!! Note |
| 73 | + |
| 74 | + After TFM API v2.0, we use buffer based save and load instead of file based behavior, this new system have safer |
| 75 | + error handling and modes can no longer see the file paths in your system directly when you save / load a file. |
| 76 | + |
| 77 | +!!! Important |
| 78 | + |
| 79 | + Modes are unlimited moduless! So you should be sure about a mode before installing it, otherwise modes can get access |
| 80 | + to your files content, for completely safe experience download official and community modes in [mode library](https://github.com/text-forge/mode-library). |
| 81 | + |
| 82 | +!!! Note |
| 83 | + |
| 84 | + Auto Format and Auto Indent are triggerable actions, there is an **Auto Indention** toggleable feature in `Format` |
| 85 | + menu that will change indention automatically when you create new line. |
| 86 | + |
| 87 | +## Mode Kits |
9 | 88 |
|
10 | 89 | In programming word, there is a lot of types of programmers, for example you can be a web developer, in this case you |
11 | | -need to work with some files as your basic workflow, such as `.html`, `.css`, and `.js`. So we provide packages, a |
12 | | -package is a collection from related modes create for a special type of users. |
| 90 | +need to work with some files as your basic workflow, such as `.html`, `.css`, and `.js`. So we provide mode kits, a |
| 91 | +mode kit is a collection from related modes create for a special type of users. |
13 | 92 |
|
14 | | -## Installing Modes & Packages |
| 93 | +## Installing Modes & Mode Kits |
15 | 94 |
|
16 | | -You can find modes and packages from official library or community created collections, there is some useful link about modes: |
| 95 | +You can find modes and mode kits in official library or community created collections, there is some useful link about modes: |
17 | 96 |
|
18 | 97 | - [Currently Available Modes List](https://github.com/text-forge/mode-library#mode-support-status) |
19 | 98 | - [Official Mode Library](https://github.com/text-forge/mode-library) |
20 | | -- [Latest Modes Release](https://github.com/text-forge/mode-library/releases/latest) |
21 | | -- [Official Packages](https://github.com/text-forge/mode-library/wiki/Packages) |
22 | 99 |
|
23 | | -A mode or package is a `.zip` or `.tfmode` file, use **Mode Manager** (`Settings > Mode Manager` in menus) and select |
24 | | -this file with `Import Mode / Package`. After loading, you will receive an **info** notification that says |
25 | | -`"Load mode / package completed"` and you can use your new modes now without restart editor. |
| 100 | +A mode or mode kit is a `.zip` or `.tfmode` file, use **Mode Manager** (`Settings > Mode Manager` in menus) and select |
| 101 | +this file with `Import Mode / Mode Kit`. After loading, you will receive an **info** notification that says |
| 102 | +`"Load mode / mode kit completed"` and you can use your new modes now without restart editor. |
0 commit comments