From 49d185361a9943f440d8efe389259a3374ade905 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Wed, 20 Jan 2021 09:45:38 +0100 Subject: [PATCH 1/3] Release 0.16.22 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 45b8ba135..926f3dd89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "lean", - "version": "0.16.21", + "version": "0.16.22", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8d3d7defb..cabab7b3e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "lean", "displayName": "lean", "description": "An extension for VS Code which provides support for the Lean language.", - "version": "0.16.21", + "version": "0.16.22", "publisher": "jroesch", "engines": { "vscode": "^1.38.0" From ff052d7ad78afbea30e7a6e81e613fcdd6fc30fe Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Sat, 30 Jan 2021 19:01:05 +0100 Subject: [PATCH 2/3] Fixes #255. --- .../rewriter/AbbreviationRewriterFeature.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/abbreviation/rewriter/AbbreviationRewriterFeature.ts b/src/abbreviation/rewriter/AbbreviationRewriterFeature.ts index 3437190da..61057ebde 100644 --- a/src/abbreviation/rewriter/AbbreviationRewriterFeature.ts +++ b/src/abbreviation/rewriter/AbbreviationRewriterFeature.ts @@ -1,5 +1,5 @@ import { observable } from 'mobx'; -import { Disposable, TextEditor, window } from 'vscode'; +import { Disposable, languages, TextEditor, window } from 'vscode'; import { autorunDisposable } from '../../utils/autorunDisposable'; import { AbbreviationProvider } from '../AbbreviationProvider'; import { AbbreviationConfig } from '../config'; @@ -16,7 +16,7 @@ export class AbbreviationRewriterFeature { private activeTextEditor: TextEditor | undefined; constructor( - config: AbbreviationConfig, + private readonly config: AbbreviationConfig, abbreviationProvider: AbbreviationProvider ) { this.activeTextEditor = window.activeTextEditor; @@ -26,7 +26,7 @@ export class AbbreviationRewriterFeature { this.activeTextEditor = e; }), autorunDisposable((disposables) => { - if (this.activeTextEditor && config.inputModeEnabled) { + if (this.activeTextEditor && this.shouldEnableRewriterForEditor(this.activeTextEditor)) { // This creates an abbreviation rewriter for the active text editor. // Old rewriters are disposed automatically. // This is also updated when this feature is turned off/on. @@ -42,6 +42,16 @@ export class AbbreviationRewriterFeature { ); } + private shouldEnableRewriterForEditor(editor: TextEditor): boolean { + if (!this.config.inputModeEnabled) { + return false; + } + if (!languages.match(this.config.languages.get(), editor.document)) { + return false; + } + return true; + } + dispose(): void { for (const d of this.disposables) { d.dispose(); From b1485373117f0e1888ff5cf4130f9806463a8acf Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Tue, 2 Feb 2021 19:07:15 +0100 Subject: [PATCH 3/3] Release 0.16.23 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 926f3dd89..a8505d5c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "lean", - "version": "0.16.22", + "version": "0.16.23", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index cabab7b3e..0ce12dc37 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "lean", "displayName": "lean", "description": "An extension for VS Code which provides support for the Lean language.", - "version": "0.16.22", + "version": "0.16.23", "publisher": "jroesch", "engines": { "vscode": "^1.38.0"