You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user-guide.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,26 @@ Language-configuration files enable additional editor behavior for a language. T
57
57
These behaviors are applied on top of whatever the underlying editor already provides.
58
58
TM4E can add these behaviors to simple text editors, or refine them when an editor or language server already offers partial support.
59
59
60
-
### 3) Diagnostic tools (token hover)
60
+
### 3) Custom code templates and code proposals
61
+
62
+
TM4E offers support for defining and proposing custom code templates for the languages available through a TextMate grammar.
63
+
Users can specify their own code templates using the `TextMate > Templates` preferences page.
64
+
65
+
Each template is registered to a context type, i.e. a language or grammar (technically a TextMate scope).
66
+
In addition to available grammars, TM4E offers two special context types for comments.
67
+
Templates registered for these context types can be used in all languages having such comments in their grammar.
68
+
69
+
For example, users can register custom C/C++ or JavaScript statements, but also generally usable comment texts like a Copyright notice, a license, or a TODO comment with the user's name.
70
+
Having a TM4E-based editor open, they'll get that code snippets suggested via code completion triggered by Ctrl + Space.
71
+
72
+
The two generic context types for comments are:
73
+
74
+
- Comment (any comment that is not a documentation comment, i.e. line comments and standard block comments like code between `/*` and `*/` in Java / C++)
75
+
- Documentation comment (a comment that is used for code documentation, e.g. javadoc comments in Java, i.e. code between `/**` and `*/`)
For advanced users, some editors expose a TextMate token hover that shows the token scopes and partition information at the caret location.
63
82
@@ -102,6 +121,9 @@ Most user-facing configuration lives under the `TextMate` section in the Eclipse
102
121
1.`TextMate > Task Tags` lets you define tags in comments (such as `TODO` or `FIXME`) that should be treated as tasks or problems, and configure how they are marked in the workspace.\
1.`TextMate > Templates` lets you specify custom code templates for available TextMate grammars (languages). These will be used in code proposals triggered by Ctrl + Space.\
1.`TextMate > Themes` lets you choose between built-in Light and Dark themes and any additional themes contributed by installed plugins, as well as import extra theme files and set the default theme for light and dark modes.
106
128
You can also switch themes from the editor's context menu under `TextMate`.\
0 commit comments