From bd01214dbe4a5c9e2308a06e060cf1df1a755ac7 Mon Sep 17 00:00:00 2001 From: kuro Date: Thu, 15 Oct 2026 20:38:40 +0000 Subject: [PATCH] Add Features-EN --- Features-EN.-.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Features-EN.-.md diff --git a/Features-EN.-.md b/Features-EN.-.md new file mode 100644 index 0000000..0afe8ef --- /dev/null +++ b/Features-EN.-.md @@ -0,0 +1,42 @@ +# ✨ Features & Usage + +The BMC TPL Code All around Extension brings features to VS Code that are otherwise only known from fully integrated IDEs for languages like C# or Java. Here is a detailed overview of what the plugin has under the hood and how to use it. + +## 🤖 The Intelligent Linter (Stateful Analysis) +The linter runs completely in the background and analyzes your code with every keystroke in real-time. It reads the code contextually and "remembers" which block you are currently in. + +**What the linter checks:** +- **Assignments vs. Comparisons:** In TPL, `=` is a comparison and `:=` is an assignment. The linter throws an error if you use `=` for an assignment. *But:* It is smart enough to correctly tolerate an `=` inside an `if`, `elif`, or `where` block as a comparison! +- **Semicolon Check:** Detects missing semicolons at the end of statements. There are exceptions here too: In `enumeration` blocks, open conditions, or multi-line logical operations (`and`, `or`), the linter remains quiet. +- **Block & Bracket Tracking:** Warns immediately about unclosed round `(` or square `[` brackets and checks whether blocks like `pattern`, `definitions`, or `body` are correctly closed with `end ...;`. +- **TPL Structure:** Verifies the mandatory order (e.g., `metadata` must come before `pattern`) and warns if mandatory fields (`origin`, `author`, `products`, `publishers`, `tree_path`) are missing in the `metadata` block. +- **Version Checking:** Notifies you if you are working on a module whose TPL version is older than the target version defined in your VS Code settings. + +## 💡 IntelliSense & Smart Auto-Completion +The plugin always offers you exactly what makes sense at the current location (triggered automatically when typing or manually via `Ctrl + Space`). + +**The Highlights:** +- **BMC Built-In Functions:** For example, if you type `discovery.`, you get all native TPL methods of this namespace. +- **Method Overloading:** Many BMC functions have optional parameters. If you select `number.toText` from the list, for instance, you can decide whether you only want to pass the number, or also the base and width. The chosen snippet is inserted, and you can elegantly jump from parameter to parameter using `Tab`. +- **Cross-Project Scanning:** If you import a foreign module (`from my.company.helpers import string_utils;`), the plugin searches your entire workspace for this file. After typing `string_utils.`, it automatically suggests all `define` methods defined there! +- **Local Variables & Namespaces:** The plugin remembers all variables you declare with `:=`. Local `definitions` blocks are also immediately offered in the autocomplete. + +## 🔍 Hover Documentation (Tooltips) +Simply hover your mouse over a method name, a pattern, or a table to get immediate explanations. + +- **Native BMC Support:** All official global functions (like `size`, `datatype`) and namespace methods (like `discovery.runCommand`) are integrated. You immediately see the original, multi-line BMC documentation including parameter descriptions in a clean Markdown format. +- **Custom DocStrings:** If you hover over a self-written pattern or a `define` method, the plugin pulls your multi-line comment (`"""` or `'''`) located right below the declaration and displays it as a clean tooltip. This also works perfectly for imported modules! + +## 🎨 Auto-Formatter (Visual Alignment) +No more chaotic indentations. You can tidy up your code at any time by right-clicking -> *Format Document* (or `Shift + Alt + F`). + +- **Fixed Standards:** The formatter consistently enforces 4 spaces per indentation level. +- **Dynamic Block Indentation:** The code "breathes". Opening blocks (`if`, `for`, `pattern`, `table`) indent the code, closing ones (`end if;`) revert the indentation. +- **Bracket Memory:** For multi-line arrays or function calls, the formatter remembers the exact column position of the opening bracket `[` or `(` and aligns all subsequent parameters exactly vertically to it. + +## ⚡ Quick Fixes (Code Actions / Lightbulb) +If the linter flags an error or a warning, a lightbulb often appears at the beginning of the line (or press `Ctrl + .`). You can use it to solve problems with one click: + +- **Generate missing metadata:** Immediately fills in all missing fields in an incomplete `metadata` block. +- **Insert log statement:** Places the mandatory `log.debug("Start pattern...");` right at the beginning of the body if you forgot it. +- **Tabs to spaces:** Instantly converts illegal tab characters in the flagged line into 4 clean spaces. \ No newline at end of file