Skip to content

Commit 3be706e

Browse files
authored
Merge pull request #10 from sidmishraw/feature/code-cleanup
Feature/code cleanup Code clean up and add the requested features
2 parents 2318bd6 + fbc52f5 commit 3be706e

27 files changed

+2255
-13497
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
node_modules
2+
out

.vscode/extensions.json

-7
This file was deleted.

.vscode/launch.json

+13-7
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,27 @@
77
"type": "extensionHost",
88
"request": "launch",
99
"runtimeExecutable": "${execPath}",
10-
"args": [
11-
"--extensionDevelopmentPath=${workspaceRoot}"
12-
],
13-
"stopOnEntry": false
10+
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
11+
"stopOnEntry": false,
12+
"sourceMaps": true,
13+
"outFiles": ["${workspaceRoot}/out/src/**/*.js"],
14+
"preLaunchTask": "npm: compile"
1415
},
1516
{
1617
"name": "Launch Tests",
1718
"type": "extensionHost",
1819
"request": "launch",
1920
"runtimeExecutable": "${execPath}",
2021
"args": [
22+
"${workspaceRoot}/testWorkspace.code-workspace",
23+
"--extensions-dir=${workspaceRoot}/.", // no other extension loaded
2124
"--extensionDevelopmentPath=${workspaceRoot}",
22-
"--extensionTestsPath=${workspaceRoot}/test"
25+
"--extensionTestsPath=${workspaceRoot}/out/test"
2326
],
24-
"stopOnEntry": false
27+
"stopOnEntry": false,
28+
"sourceMaps": true,
29+
"outFiles": ["${workspaceRoot}/out/test/**/*.js"],
30+
"preLaunchTask": "npm: compile"
2531
}
2632
]
27-
}
33+
}

.vscode/settings.json

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
// Place your settings in this file to overwrite default and user settings.
21
{
3-
"cSpell.words": [
4-
"bitbucket",
5-
"bulbasaur",
6-
"doejohn",
7-
"ivysaur",
8-
"loginfo",
9-
"rplc",
10-
"topperv",
11-
"venosaur",
12-
"yababbdadado"
13-
]
14-
}
2+
"files.exclude": {
3+
"out": false // set this to true to hide the "out" folder with the compiled JS files
4+
},
5+
"search.exclude": {
6+
"out": true // set this to false to include "out" folder in search results
7+
},
8+
9+
"prettier.tabWidth": 4,
10+
"prettier.singleQuote": true,
11+
"prettier.trailingComma": "es5",
12+
13+
"typescript.tsdk": "./node_modules/typescript/lib", // we want to use the TS server from our node_modules folder to control its version
14+
"typescript.tsc.autoDetect": "off"
15+
}

.vscode/tasks.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "npm",
6+
"script": "compile",
7+
"problemMatcher": "$tsc-watch",
8+
"isBackground": true,
9+
"presentation": {
10+
"reveal": "silent"
11+
},
12+
"group": {
13+
"kind": "build",
14+
"isDefault": true
15+
}
16+
}
17+
]
18+
}

CHANGELOG.md

+28-18
Original file line numberDiff line numberDiff line change
@@ -6,64 +6,74 @@ Author: Sidharth Mishra
66

77
All notable changes to the "topper" extension will be documented in this file.
88

9+
### [v1.0.0]
10+
11+
**[!!!] This release has breaking changes and might need some configuration from your part for the first time you start using it –– especially on older files that were annotated with older versions of Topper. No worries for new users and new files.**
12+
13+
- Re-wrote the code from scratch in Typescript for better maintenance. Also got rid of the popup, it seems that the use of a keyboard shortcut is the best approach. The other way is to invoke command directly using the commands menu of vscode.
14+
- The command palette now shows a command that is bound to the first profile in the list, no need for the popup –– this was made for streamlined usage. For a more streamlined approach, please use the keyboard shortcuts to the desired profiles.
15+
- [CAUTION] Externalized the date formatting for created date and last modified date.
16+
- [CAUTION] Externalized the last modified date capture regex in case the user defines their custom last modified date format.
17+
- [CAUTION] Externalized the row and column indices to be used for insertion of the header string: use with care. Defaults to 0 for both row and col for sanity.
18+
919
### [v0.4.0]
1020

11-
- Merged pull request from @Drakesinger into master to allow more flexible formats for the `last modified` field in the headers. Thanks @Drakesinger for the PR!
21+
- Merged pull request from @Drakesinger into master to allow more flexible formats for the `last modified` field in the headers. Thanks @Drakesinger for the PR!
1222

13-
- Updated the readme document with more information about the `topper.lastModified` contribution point. Since, I had forgotten to add the description of this contribution point in the document I believe some of the users might have found it difficult to configure the `lastModified` field name in their headers. Sorry!
23+
- Updated the readme document with more information about the `topper.lastModified` contribution point. Since, I had forgotten to add the description of this contribution point in the document I believe some of the users might have found it difficult to configure the `lastModified` field name in their headers. Sorry!
1424

1525
### [v0.3.2]
1626

17-
- Fixed the issue [problem about last-modified when press cmd+s #3](https://github.com/sidmishraw/topper/issues/3). Now, topper's watcher listens to the `TextDocumentWillSaveEvent` and updates the last-modified field before the document saves.
27+
- Fixed the issue [problem about last-modified when press cmd+s #3](https://github.com/sidmishraw/topper/issues/3). Now, topper's watcher listens to the `TextDocumentWillSaveEvent` and updates the last-modified field before the document saves.
1828

1929
### [v0.3.1]
2030

21-
- Fixed the issue of Topper capturing templates of "last-modified". Now, there are strict patterns in place.
31+
- Fixed the issue of Topper capturing templates of "last-modified". Now, there are strict patterns in place.
2232

2333
### [v0.3.0]
2434

25-
- Fixed issue where the `@last-modified` field in the header was not getting updated automatically. Now, there is a configuration field `topper.lastModified` where the users can specify their custom field names for `last-modified` incase they do not use `@last-modified`. The default value is `@last-modified`.
35+
- Fixed issue where the `@last-modified` field in the header was not getting updated automatically. Now, there is a configuration field `topper.lastModified` where the users can specify their custom field names for `last-modified` incase they do not use `@last-modified`. The default value is `@last-modified`.
2636

2737
> Caveats: The implementation is choppy in some aspects because of limited support from VS Code APIs. Expect a better implementation in the next version.
2838
29-
- Code cleanup.
39+
- Code cleanup.
3040

3141
### [v0.2.0]
3242

33-
- Code cleanup.
43+
- Code cleanup.
3444

35-
- Addition of profile specific shortcuts added to `keybinding.json` of VSCode:
45+
- Addition of profile specific shortcuts added to `keybinding.json` of VSCode:
3646

3747
```json
38-
{
48+
({
3949
"key": "cmd+shift+t 1",
4050
"command": "topper.addTopHeader.personalProfile"
41-
},
42-
{
51+
},
52+
{
4353
"key": "shift+cmd+t 2",
4454
"command": "topper.addTopHeader.officeProfile"
45-
}
55+
})
4656
```
4757

4858
The first key combination is `Command + Shift + T` followed by a `1` or `2` depending on the profile. The user is free to bind any profile to any key combination.
4959
The commandId is of the form `topper.addTopHeader.<your-profile-name>`.
5060

5161
### [v0.1.0]
5262

53-
- Stable release.
63+
- Stable release.
5464

5565
### [v0.0.3]
5666

57-
- Changed the extension's command from `extension.addTopHeader` to `topper.addTopHeader`. To make it easier for customized keybinding.
67+
- Changed the extension's command from `extension.addTopHeader` to `topper.addTopHeader`. To make it easier for customized keybinding.
5868

59-
- Code cleanup.
69+
- Code cleanup.
6070

6171
### [v0.0.2]
6272

63-
- Added support for multi line strings as values for the custom template parameters.
73+
- Added support for multi line strings as values for the custom template parameters.
6474

65-
- Updated `lastModifiedDate` to be fetched from the underlying OS. This is the true last modified date.
75+
- Updated `lastModifiedDate` to be fetched from the underlying OS. This is the true last modified date.
6676

6777
### [v0.0.1]
6878

69-
- Initial release of `Topper` extension. [Alpha]
79+
- Initial release of `Topper` extension. [Alpha]

0 commit comments

Comments
 (0)