mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 15:01:57 +01:00
Start moving html ext to strict mode compile
Moves the html extension's client code to strict mode and also updates some of the server code. The rest of this migration will requires changes to the *.d.ts files that the server consumes
This commit is contained in:
@@ -32,7 +32,7 @@ export function activate(context: ExtensionContext) {
|
||||
let toDispose = context.subscriptions;
|
||||
|
||||
let packageInfo = getPackageInfo(context);
|
||||
let telemetryReporter: TelemetryReporter = packageInfo && new TelemetryReporter(packageInfo.name, packageInfo.version, packageInfo.aiKey);
|
||||
let telemetryReporter: TelemetryReporter | null = packageInfo && new TelemetryReporter(packageInfo.name, packageInfo.version, packageInfo.aiKey);
|
||||
if (telemetryReporter) {
|
||||
toDispose.push(telemetryReporter);
|
||||
}
|
||||
@@ -166,7 +166,7 @@ export function activate(context: ExtensionContext) {
|
||||
});
|
||||
}
|
||||
|
||||
function getPackageInfo(context: ExtensionContext): IPackageInfo {
|
||||
function getPackageInfo(context: ExtensionContext): IPackageInfo | null {
|
||||
let extensionPackage = require(context.asAbsolutePath('./package.json'));
|
||||
if (extensionPackage) {
|
||||
return {
|
||||
|
||||
@@ -15,7 +15,7 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio
|
||||
updateEnabledState();
|
||||
window.onDidChangeActiveTextEditor(updateEnabledState, null, disposables);
|
||||
|
||||
let timeout: NodeJS.Timer = void 0;
|
||||
let timeout: NodeJS.Timer | undefined = void 0;
|
||||
|
||||
function updateEnabledState() {
|
||||
isEnabled = false;
|
||||
@@ -56,13 +56,15 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio
|
||||
tagProvider(document, position).then(text => {
|
||||
if (text && isEnabled) {
|
||||
let activeEditor = window.activeTextEditor;
|
||||
let activeDocument = activeEditor && activeEditor.document;
|
||||
if (document === activeDocument && activeDocument.version === version) {
|
||||
let selections = activeEditor.selections;
|
||||
if (selections.length && selections.some(s => s.active.isEqual(position))) {
|
||||
activeEditor.insertSnippet(new SnippetString(text), selections.map(s => s.active));
|
||||
} else {
|
||||
activeEditor.insertSnippet(new SnippetString(text), position);
|
||||
if (activeEditor) {
|
||||
let activeDocument = activeEditor.document;
|
||||
if (document === activeDocument && activeDocument.version === version) {
|
||||
let selections = activeEditor.selections;
|
||||
if (selections.length && selections.some(s => s.active.isEqual(position))) {
|
||||
activeEditor.insertSnippet(new SnippetString(text), selections.map(s => s.active));
|
||||
} else {
|
||||
activeEditor.insertSnippet(new SnippetString(text), position);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
declare module "color-convert" {
|
||||
module convert {
|
||||
module rgb {
|
||||
function hex(r: number, g: number, b: number);
|
||||
function hsl(r: number, g: number, b: number);
|
||||
function hvs(r: number, g: number, b: number);
|
||||
}
|
||||
}
|
||||
|
||||
export = convert;
|
||||
}
|
||||
Reference in New Issue
Block a user