|
2 | 2 | This is the README for the Visual Studio Code extension named "Regex Show Go".
|
3 | 3 |
|
4 | 4 | ## Features
|
5 |
| -When hovering a line in Visual Studio Code, the line text is matched against one or several regex patterns. If a match is found, a hover box is shown with a link which is created from a match-prefix and the actual match and a match-postfix. See Extension Settings section for configuration. |
| 5 | +When hovering a line in Visual Studio Code, the line is matched against one or several regex patterns. If a match is found, a hover box is shown with a link which is created from a match-prefix and the actual match and a match-postfix. See Extension Settings section for configuration. |
6 | 6 |
|
7 | 7 | ## Extension Settings
|
8 |
| -To use the extension, you must configure a regex match pattern and a match prefix. See configuration example: |
| 8 | +To use the extension, you must configure a regex match pattern, match prefix, and match postfix. Note, for backward compatibility, if "search_at" is not defined, the default value is "false". |
| 9 | + |
| 10 | +Configuration example: |
9 | 11 | ```
|
10 | 12 | "regex_show_go.config.match": [
|
11 |
| - { |
12 |
| - "match_pattern": "WIKI[0-9-]+", |
13 |
| - "prefix": "https://duckduckgo.com/?q=", |
14 |
| - "postfix" "" |
15 |
| - }, |
16 | 13 | {
|
17 | 14 | "match_pattern": "TEST[0-9-]+",
|
18 |
| - "prefix": "https://www.imdb.com/find?q=" |
| 15 | + "prefix": "https://www.google.com/search?q=" |
19 | 16 | "postfix": "-test"
|
20 |
| - } |
| 17 | + }, |
| 18 | + { |
| 19 | + "match_pattern": "WIKI", |
| 20 | + "prefix": "https://en.wikipedia.org/wiki/", |
| 21 | + "postfix": "", |
| 22 | + "search_at": true |
| 23 | + }] |
21 | 24 | ```
|
22 |
| -If a line contains the word "WIKI-123", the following link is generated "https://duckduckgo.com/?q=WIKI-123" when hovering the line. |
| 25 | +Example 1: |
| 26 | +Hovering a line containing the text "TEST-1234", will generate the following link "https://www.google.com/search?q=TEST-1234-test". |
| 27 | + |
| 28 | +Example 2: |
| 29 | +Hovering a line containing the text "WIKI#test#", will generate the following link "https://en.wikipedia.org/wiki/test". Note, "match_pattern" is not included in the generated URL. |
23 | 30 |
|
24 | 31 | ## Release Notes
|
| 32 | +#### Version 1.0.0 |
| 33 | +- [Feature] Possibility to leave match out of the generated URL. See the section "Extension Settings". |
| 34 | + |
25 | 35 | #### Version 0.2.0
|
26 | 36 | - [breaking change] Added 'postfix' string. Update extension configuration with 'postfix' field
|
27 | 37 | - Added icon.
|
|
0 commit comments