Skip to content

Commit

Permalink
Fix for issue #10 lastModifiedBy undefined - lastModifiedBy should be…
Browse files Browse the repository at this point in the history
… config.LastModifiedBy

extension.js:
* Added another field into the config, called lastModifiedBy (because existing fields are all read only, and although it is unlkely, we were previously catering for the eventuality that last modified is undefined in the settings, and referring to that by a local variable 'lastModifiedBy', which was later removed - the afore mentioned error occured because older code that referred to this variable had been committed wrongly. So this new field does the same job.
  • Loading branch information
Nos78 committed Nov 15, 2022
1 parent 254404a commit bf562d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: mikey.zhaopeng
* @Date: 2016-07-29 15:57:29
* @Last Modified by: Noscere
* @Last Modified time: 2022-11-15 06:15:56.517
* @Last Modified time: 2022-11-15 07:22:32.354
*/

var vscode = require('vscode');
Expand All @@ -13,6 +13,7 @@ Date.prototype.format = fileheader.dateFormat;

function getConfig() {
var config = vscode.workspace.getConfiguration('fileheader');
config.lastModifiedBy = config.LastModifiedBy;
if(config.Author) {
// Sanity check - shouldn't be null, but you never know
if(config.LastModifiedBy) {
Expand Down Expand Up @@ -95,7 +96,7 @@ function activate(context) {
var data = {
author: config.Author,
email: config.Email,
lastModifiedBy: lastModifiedBy, // use local variable assigned above
lastModifiedBy: config.lastModifiedBy, // use local variable assigned in getConfig()
createTime: time,
updateTime: time,
description: description
Expand Down

0 comments on commit bf562d9

Please sign in to comment.