diff --git a/LICENSE_NOTICE.md b/LICENSE_NOTICE.md index e00a71c..b17b76a 100644 --- a/LICENSE_NOTICE.md +++ b/LICENSE_NOTICE.md @@ -1,9 +1,9 @@ # License Notice @@ -13,19 +13,15 @@ this notice are preserved. This file is offered as-is, without any warranty. Project files listed below cannot carry a license notice by themselves, due to file format restrictions. -```text -assets/texinfo.png -``` + assets/texinfo.png They should be treated as if they each contains the following text: -```text -Copyright (C) 2020,2021 CismonX + Copyright (C) 2020,2021 CismonX -Copying and distribution of this file, with or without modification, are -permitted in any medium without royalty, provided the copyright notice and -this notice are preserved. This file is offered as-is, without any warranty. -``` + Copying and distribution of this file, with or without modification, are + permitted in any medium without royalty, provided the copyright notice and + this notice are preserved. This file is offered as-is, without any warranty. ## Files from other projects @@ -33,14 +29,21 @@ Source code from the projects listed below are **not** part of vscode-texinfo. However, when building the project, they are downloaded, compiled, and packaged into a single binary file alongside with vscode-texinfo. -| Project | Copyright Holder | License | -| - | - | - | -| [Texinfo syntax highlighting](https://github.com/Alhadis/language-texinfo) | John Gardner | [ISC](https://github.com/Alhadis/language-texinfo/blob/master/LICENSE.md) | +| Project | Copyright Holder | License | +| - | - | - | +| [Texinfo syntax highlighting] | John Gardner | [ISC](https://github.com/Alhadis/language-texinfo/blob/master/LICENSE.md) | The following projects are required during runtime of vscode-texinfo, but as separate programs. -| Project | Copyright Holder | License | -| - | - | - | -| [Visual Studio Code](https://github.com/microsoft/vscode) | Microsoft Corporation | [MIT](https://github.com/microsoft/vscode/blob/main/LICENSE.txt) | -| [GNU Texinfo](https://www.gnu.org/software/texinfo) | Free Software Foundation | [GPL-3.0](https://git.savannah.gnu.org/cgit/texinfo.git/tree/COPYING)-or-later | +| Project | Copyright Holder | License | +| - | - | - | +| [Visual Studio Code] | Microsoft Corporation | [MIT](https://github.com/microsoft/vscode/blob/main/LICENSE.txt) | +| [GNU Texinfo] | Free Software Foundation | [GPL-3.0](https://git.savannah.gnu.org/cgit/texinfo.git/tree/COPYING)-or-later | + + + + +[Texinfo syntax highlighting]: https://github.com/Alhadis/language-texinfo +[Visual Studio Code]: https://github.com/microsoft/vscode +[GNU Texinfo]: https://www.gnu.org/software/texinfo diff --git a/src/context_mapping.ts b/src/context_mapping.ts index b446b98..c51101e 100644 --- a/src/context_mapping.ts +++ b/src/context_mapping.ts @@ -97,7 +97,9 @@ export default class ContextMapping implements vscode.Disposable private _onDocumentSave(document: vscode.TextDocument) { const documentContext = this._tryGetDocumentContext(document); - if (documentContext === undefined) return; + if (documentContext === undefined) { + return; + } documentContext.foldingRange.clear(); documentContext.getPreview()?.updateWebview(); } diff --git a/src/contexts/folding_range.ts b/src/contexts/folding_range.ts index 9023c29..1f52468 100644 --- a/src/contexts/folding_range.ts +++ b/src/contexts/folding_range.ts @@ -54,7 +54,9 @@ export default class FoldingRangeContext */ update(events: readonly vscode.TextDocumentContentChangeEvent[]) { this._contentMayChange = true; - if (this._foldingRanges === undefined) return false; + if (this._foldingRanges === undefined) { + return false; + } const eol = this._document.eol === vscode.EndOfLine.LF ? '\n' : '\r\n'; for (const event of events) { // Clear cached folding range when line count changes. @@ -147,7 +149,9 @@ export default class FoldingRangeContext } // Process block. if (line.startsWith('@end ')) { - if (verbatim) continue; + if (verbatim) { + continue; + } const name = line.substring(5).trimRight(); if (name === 'verbatim') { verbatim = true; @@ -193,14 +197,20 @@ export default class FoldingRangeContext private _getLastTextLine(lineNum: number, limit = 3) { for (let idx = lineNum; idx > lineNum - limit; --idx) { const line = this._document.lineAt(idx).text; - if (line.startsWith('@node ')) return idx - 1; - if (line === '') return idx; + if (line.startsWith('@node ')) { + return idx - 1; + } + if (line === '') { + return idx; + } } return lineNum; } private _processComment(lineText: string, lineNum: number) { - if (!lineText.startsWith('@c')) return false; + if (!lineText.startsWith('@c')) { + return false; + } if (lineText.charAt(2) != ' ' && !lineText.startsWith('omment ', 2)) { return false; } @@ -233,7 +243,9 @@ export default class FoldingRangeContext lastLineNum: number, ) { const result = lineText.match(FoldingRangeContext._nodeFormat); - if (result === null) return false; + if (result === null) { + return false; + } // Node identifier. if (result[1] !== undefined) { this._nodes.push(new vscode.CodeLens(lineNumToRange(lineNum), { diff --git a/src/contexts/preview.ts b/src/contexts/preview.ts index 514bc5b..1752db2 100644 --- a/src/contexts/preview.ts +++ b/src/contexts/preview.ts @@ -127,7 +127,9 @@ export default class PreviewContext * preview with code lens. */ private get _script() { - if (!this._globalContext.options.enableCodeLens) return undefined; + if (!this._globalContext.options.enableCodeLens) { + return undefined; + } return "window.addEventListener('message', event => {" + "const message = event.data;" + "switch (message.command) {" + diff --git a/src/providers/completion_item.ts b/src/providers/completion_item.ts index 277fc1b..eeef2a1 100644 --- a/src/providers/completion_item.ts +++ b/src/providers/completion_item.ts @@ -1156,7 +1156,9 @@ export default class CompletionItemProvider this._oldOptions = newOptions; this._completionItems = undefined; } - if (position.character === 1) return this._getCompletionItems(); + if (position.character === 1) { + return this._getCompletionItems(); + } // Check whether the '@' character is escaped. const secondCharBeforeWord = new vscode.Range( position.translate(0, -2),