Skip to content

Commit

Permalink
Version 1.1.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennykorsukewitz committed Aug 14, 2023
1 parent 11f1cd2 commit 40fc0e5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to the "Znuny" extension will be documented in this file.

## [1.1.6]

### QuoteWithMarker

- Updated README.md.
- Tidied code.

## [1.1.5]

### QuoteWithMarker
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

| Versions | Status |
| ------ | ------ |
| ![GitHub label version](https://img.shields.io/github/labels/dennykorsukewitz/dennykorsukewitz/Znuny%206.0) ![GitHub label version](https://img.shields.io/github/labels/dennykorsukewitz/dennykorsukewitz/Znuny%206.4) ![GitHub label version](https://img.shields.io/github/labels/dennykorsukewitz/dennykorsukewitz/Znuny%206.5) <br> ![GitHub label version](https://img.shields.io/github/labels/dennykorsukewitz/dennykorsukewitz/Znuny%207.0) ![GitHub label version](https://img.shields.io/github/labels/dennykorsukewitz/DK4/dev) | [![GitHub commits since tagged version](https://img.shields.io/github/commits-since/dennykorsukewitz/VSCode-Znuny/1.1.5/dev)](https://github.com/dennykorsukewitz/VSCode-Znuny/compare/1.1.5...dev) ![GitHub Workflow Lint](https://github.com/dennykorsukewitz/VSCode-Znuny/actions/workflows/lint.yml/badge.svg?branch=dev&style=flat&label=Lint) [![Snippet](https://github.com/dennykorsukewitz/VSCode-Znuny/actions/workflows/snippet.yml/badge.svg)](https://github.com/dennykorsukewitz/VSCode-Znuny/actions/workflows/snippet.yml) ![GitHub Workflow Pages](https://github.com/dennykorsukewitz/VSCode-Znuny/actions/workflows/pages.yml/badge.svg?branch=dev&style=flat&label=GitHub%20Pages) |
| ![GitHub label version](https://img.shields.io/github/labels/dennykorsukewitz/dennykorsukewitz/Znuny%206.0) ![GitHub label version](https://img.shields.io/github/labels/dennykorsukewitz/dennykorsukewitz/Znuny%206.4) ![GitHub label version](https://img.shields.io/github/labels/dennykorsukewitz/dennykorsukewitz/Znuny%206.5) <br> ![GitHub label version](https://img.shields.io/github/labels/dennykorsukewitz/dennykorsukewitz/Znuny%207.0) ![GitHub label version](https://img.shields.io/github/labels/dennykorsukewitz/DK4/dev) | [![GitHub commits since tagged version](https://img.shields.io/github/commits-since/dennykorsukewitz/VSCode-Znuny/1.1.6/dev)](https://github.com/dennykorsukewitz/VSCode-Znuny/compare/1.1.6...dev) ![GitHub Workflow Lint](https://github.com/dennykorsukewitz/VSCode-Znuny/actions/workflows/lint.yml/badge.svg?branch=dev&style=flat&label=Lint) [![Snippet](https://github.com/dennykorsukewitz/VSCode-Znuny/actions/workflows/snippet.yml/badge.svg)](https://github.com/dennykorsukewitz/VSCode-Znuny/actions/workflows/snippet.yml) ![GitHub Workflow Pages](https://github.com/dennykorsukewitz/VSCode-Znuny/actions/workflows/pages.yml/badge.svg?branch=dev&style=flat&label=GitHub%20Pages) |

## Features

Expand Down Expand Up @@ -52,7 +52,9 @@ Statically created snippets.
- Needed
- Perl
- POD
- Scaffolding
- Selenium
- SOPM
- VariableCheck

#### Generated
Expand Down
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## QuoteWithMarker

- Updated README.md.
- Tidied code.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "znuny",
"displayName": "Znuny",
"description": "Znuny is an extension that helps you to make Znuny development easier, faster and more error-free.",
"version": "1.1.5",
"version": "1.1.6",
"publisher": "dennykorsukewitz",
"icon": "doc/images/icon.png",
"license": "SEE LICENSE IN LICENSE",
Expand Down Expand Up @@ -142,7 +142,7 @@
"order": 1,
"type": "string",
"description": "Znuny Code Marker used in QuoteWithMarker function.",
"default": "Znuny"
"default": "Znuny - ${year}.${month}.${day}"
},
"znuny.quoteWithMarker.lineComment": {
"order": 2,
Expand Down Expand Up @@ -6385,4 +6385,4 @@
}
]
}
}
}
19 changes: 10 additions & 9 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,25 +361,26 @@ function initQuoteWithMarker(context) {

// Select current line if nothing is selected
if (selection.isEmpty == true) {
activeEditor.selection = new vscode.Selection(selection.active.line, 0 ,selection.active.line, 99)
activeEditor.selection = new vscode.Selection(selection.active.line, 0, selection.active.line, 99);
selection = activeEditor.selection;
}

let text = activeEditor.document.getText(selection) || '';
let config = vscode.workspace.getConfiguration('znuny').get('quoteWithMarker');

let quoteChar,
codeMarkerReplace,
codeMarker = vscode.workspace.getConfiguration('znuny').get('codeMarker') || 'Znuny',
lineComment = vscode.workspace.getConfiguration('znuny').get('lineComment') || '',
languageId = activeEditor.document.languageId;
codeMarker = config.codeMarker || 'Znuny',
lineComment = config.lineComment || {},
languageId = activeEditor.document.languageId;

let currentTime = new Date()
let currentTime = new Date();

// returns the month (from 0 to 11)
let month = currentTime.getMonth() + 1;

// returns the day of the month (from 1 to 31);
let day = currentTime.getDate()
let day = currentTime.getDate();

// returns the year (four digits)
let year = currentTime.getFullYear();
Expand All @@ -389,13 +390,13 @@ function initQuoteWithMarker(context) {
codeMarker = codeMarker.replace(/\${day}/g, day);

// Get quoteChar from config
if (lineComment[languageId] && lineComment[languageId].length){
if (lineComment && lineComment[languageId] && lineComment[languageId].length) {
quoteChar = lineComment[languageId];
}

// If no quoteChar is set, try to use the default value of lineComment of the current language config
if (quoteChar.length === 0 && languageId){
let extensions = vscode.extensions.all;
if (quoteChar.length === 0 && languageId) {
let extensions = vscode.extensions.all;
let languagesData = extensions.filter((extension) => extension.packageJSON.name === languageId);

let languageExtensionPath = languagesData[0].extensionPath;
Expand Down

0 comments on commit 40fc0e5

Please sign in to comment.