-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Description
- VSCode Version: 1.14.1
- OS Version: Windows 7 and Windows 10, likely all OSes
When editing documents with very long lines, such as lines containing data-URIs, the property vscode.window.activeTextEditor will be undefined when it should be defined.
Steps to reproduce:
- Create a new (blank) VSCode extension, and add this command to
extension.ts:
'use strict';
import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
let disposable = vscode.commands.registerCommand('bigDocTest.runDocTest', () => {
let hasActiveTextEditor = (vscode.window.activeTextEditor !== undefined);
if (hasActiveTextEditor) {
vscode.window.showInformationMessage('Success, activeTextEditor is defined.');
} else {
vscode.window.showErrorMessage('Oops, activeTextEditor is not defined.');
}
});
context.subscriptions.push(disposable);
}
export function deactivate() {
}
-
Launch this extension, load any normal text file, and run this command, you see the "Success, activeTextEditor is defined" information message appear.
-
But, try loading a file with a very long line contained inside it, such as this one: MetalRoughSpheres.gltf. This file has long lines due to the use of embedded data URIs in the file. If you run the above sample extension while editing this file, you see "Oops, activeTextEditor is not defined."
This makes it difficult for VSCode extensions to work with such files. I'm the lead dev of the GLTF extension for VSCode, and this prevents my extension from running on GLTF files that embed large images as data URIs.