Skip to content

Commit 88ecb9e

Browse files
committed
update to version 0.2.2
1. removed debug lines from extension.js 2. update of keywords.json 3. update of patterns.json. Now the extension could handle both CRLF and LF line breaks in the regular expressions.
1 parent 7245419 commit 88ecb9e

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ N/A
1212

1313
## Extension Settings
1414

15-
The current version (0.2.1) of this extension does not have any settings.
15+
The current version (0.2.2) of this extension does not have any settings.
1616

1717
## Issues and Important Notes
1818

@@ -24,7 +24,7 @@ The current version (0.2.1) of this extension does not have any settings.
2424

2525
For detailed release notes, please see [CHANGELOG.md](CHANGELOG.md).
2626

27-
### 0.2.1
27+
### 0.2.2
2828

2929
Bug fixes and optimizations.
3030

extension.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class OrcaOutlineProvider {
5050
});
5151
} else {
5252
// If there's no element, return the top-level matches
53-
console.log(typeof this._matches, this._matches);
53+
//console.log(typeof this._matches, this._matches);
5454
return this._matches.map(match => {
5555
return {
5656
label: `${match.title} (Line ${match.line + 1})`,
@@ -173,6 +173,7 @@ function parseOrcaFile(document, filePath) {
173173
const line = document.positionAt(match.index).line;
174174
let title = match[1] || pattern.title;
175175
title = toTitleCase(title.trim());
176+
//console.log(title);
176177

177178
// Replace keywords in the title
178179
//for (let keyword in keywordReplacements) {
@@ -227,7 +228,7 @@ async function replaceKeywords(matches) {
227228
for (let match of matches) {
228229
for (let keyword in keywordReplacements) {
229230
if (match.title.includes(keyword)) {
230-
match.title = match.title.replace(keyword, keywordReplacements[keyword]);
231+
match.title = match.title.replace(keyword, keywordReplacements[keyword]).trim();
231232
}
232233
}
233234
if (match.children) {

keywords.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
"Uhf": "UHF",
1515
"Epr": "EPR",
1616
"nmr": "NMR",
17-
"Td":"TD",
18-
"td": "TD",
1917
"Dft": "DFT",
2018
"dft": "DFT",
2119
"Spin-orbit": "Spin-Orbit",
@@ -26,15 +24,17 @@
2624
"On ": "on ",
2725
"And ": "and ",
2826
"Of ": "of ",
29-
"The ": "the ",
27+
" The ": " the ",
3028
"In ": "in ",
3129
"To ": "to ",
32-
"For": "for ",
30+
"For ": "for ",
3331
"With": "with ",
3432
"By": "by ",
3533
"Ci-": "CI-",
3634
"tda": "TDA",
3735
"Tda": "TDA",
36+
"Td":"TD",
37+
"td": "TD",
3838
"Cd ": "CD ",
3939
"Cis/": "CIS/",
4040
"Xc": "XC",
@@ -45,5 +45,12 @@
4545
"rijcosx": "RIJCOSX",
4646
"Rijcosx": "RIJCOSX",
4747
"Ir ": "IR ",
48-
"Cp-": "CP-"
48+
"Cp-": "CP-",
49+
"...":"",
50+
"15k":"15K",
51+
"Lr-":"LR-",
52+
"Mr-pt":"MR-PT",
53+
"Tsel":"TSel",
54+
"-field":"-Field",
55+
"-splitting":"-Splitting"
4956
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "orcatoc",
33
"displayName": "orca_toc",
44
"description": "Provides an outline for ORCA files in the VS Code sidebar.",
5-
"version": "0.2.1",
5+
"version": "0.2.2",
66
"engines": {
77
"vscode": "^1.82.0"
88
},

patterns.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[
22
{
3-
"regex": " +\\*{10,}\\s*\\n +\\*(.*?)\\*\\s*\\n +\\*{10,}",
3+
"regex": " +\\*{10,}\\s*\\r?\\n +\\*(.*?)\\*\\s*\\r?\\n +\\*{10,}",
44
"level": 1
55
},
66
{
7-
"regex": "\\=+\\s*\\n +([^\\n]+)\\s*\\n\\=+",
7+
"regex": "^\\=+\\r?\\n +([^\\r?\\n]+)\\r?\\n\\=+",
88
"level": 2
99
},
1010
{
11-
"regex": "^\\-+\\n +([^\\n]+)\\n\\-+",
11+
"regex": "^\\-+\\r?\\n +([^\\r?\\n]+)\\r?\\n\\-+",
1212
"level": 3
1313
},
1414
{
15-
"regex": "^\\-+\\n +([^\\n]+)\\n +[^\\n]+\\n\\-+",
15+
"regex": "^\\-+\\r?\\n +([^\\r?\\n]+)\\r?\\n +[^\\r?\\n\\(]+\\r?\\n\\-+",
1616
"level": 3
1717
},
1818
{
19-
"regex": "^\\-+\\n([^\\s\\n][^\\n]*)\\n\\-+",
19+
"regex": "^\\-+\\r?\\n([^\\s\\r?\\n][^\\r?\\n]*)\\r?\\n\\-+",
2020
"level": 4
2121
}
2222
]

0 commit comments

Comments
 (0)