mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
Merge pull request #37743 from mjbvz/css-ext-strict
Move css extension to strict
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -6,7 +6,8 @@
|
||||
"noUnusedLocals": true,
|
||||
"lib": [
|
||||
"es5", "es2015.promise"
|
||||
]
|
||||
],
|
||||
"strict": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
|
||||
@@ -49,7 +49,7 @@ let scopedSettingsSupport = false;
|
||||
connection.onInitialize((params: InitializeParams): InitializeResult => {
|
||||
function hasClientCapability(name: string) {
|
||||
let keys = name.split('.');
|
||||
let c = params.capabilities;
|
||||
let c: any = params.capabilities;
|
||||
for (let i = 0; c && i < keys.length; i++) {
|
||||
c = c[keys[i]];
|
||||
}
|
||||
@@ -60,7 +60,7 @@ connection.onInitialize((params: InitializeParams): InitializeResult => {
|
||||
let capabilities: ServerCapabilities & CPServerCapabilities = {
|
||||
// Tell the client that the server works in FULL text document sync mode
|
||||
textDocumentSync: documents.syncKind,
|
||||
completionProvider: snippetSupport ? { resolveProvider: false } : null,
|
||||
completionProvider: snippetSupport ? { resolveProvider: false } : undefined,
|
||||
hoverProvider: true,
|
||||
documentSymbolProvider: true,
|
||||
referencesProvider: true,
|
||||
@@ -93,7 +93,7 @@ let documentSettings: { [key: string]: Thenable<LanguageSettings> } = {};
|
||||
documents.onDidClose(e => {
|
||||
delete documentSettings[e.document.uri];
|
||||
});
|
||||
function getDocumentSettings(textDocument: TextDocument): Thenable<LanguageSettings> {
|
||||
function getDocumentSettings(textDocument: TextDocument): Thenable<LanguageSettings> | undefined {
|
||||
if (scopedSettingsSupport) {
|
||||
let promise = documentSettings[textDocument.uri];
|
||||
if (!promise) {
|
||||
@@ -113,7 +113,7 @@ connection.onDidChangeConfiguration(change => {
|
||||
|
||||
function updateConfiguration(settings: Settings) {
|
||||
for (let languageId in languageServices) {
|
||||
languageServices[languageId].configure(settings[languageId]);
|
||||
languageServices[languageId].configure((settings as any)[languageId]);
|
||||
}
|
||||
// reset all document settings
|
||||
documentSettings = {};
|
||||
@@ -154,6 +154,9 @@ function triggerValidation(textDocument: TextDocument): void {
|
||||
|
||||
function validateTextDocument(textDocument: TextDocument): void {
|
||||
let settingsPromise = getDocumentSettings(textDocument);
|
||||
if (!settingsPromise) {
|
||||
return;
|
||||
}
|
||||
let stylesheet = stylesheets.get(textDocument);
|
||||
settingsPromise.then(settings => {
|
||||
let diagnostics = getLanguageService(textDocument).doValidation(textDocument, stylesheet, settings);
|
||||
|
||||
@@ -16,7 +16,7 @@ export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTime
|
||||
let languageModels: { [uri: string]: { version: number, languageId: string, cTime: number, languageModel: T } } = {};
|
||||
let nModels = 0;
|
||||
|
||||
let cleanupInterval = void 0;
|
||||
let cleanupInterval: NodeJS.Timer | undefined = void 0;
|
||||
if (cleanupIntervalTimeInSec > 0) {
|
||||
cleanupInterval = setInterval(() => {
|
||||
let cutoffTime = Date.now() - cleanupIntervalTimeInSec * 1000;
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
"noUnusedLocals": true,
|
||||
"lib": [
|
||||
"es5"
|
||||
]
|
||||
],
|
||||
"strict": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
|
||||
Reference in New Issue
Block a user