more settings
This commit is contained in:
Родитель
91a635b95b
Коммит
ed9b3149ed
|
@ -1,3 +1,4 @@
|
|||
// missing semicolon warning supressed to due ignoreDefinitionFiles setting
|
||||
interface F {
|
||||
f1()
|
||||
f2()
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
// VS Code provided fix for === not supported when using the tslint-language-service
|
||||
let a = 3;
|
||||
|
||||
if (a == 3) {
|
||||
console.log(a);
|
||||
}
|
||||
|
||||
if (a != 3) {
|
||||
console.log(a);
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
"plugins": [
|
||||
{
|
||||
"name": "tslint-language-service",
|
||||
//"configFile": "../tslint.json",
|
||||
"alwaysShowRuleFailuresAsWarnings": false,
|
||||
"ignoreDefinitionFiles": true
|
||||
}
|
||||
|
|
15
src/index.ts
15
src/index.ts
|
@ -5,13 +5,6 @@ import * as path from 'path';
|
|||
let codeFixActions = new Map<string, Map<string, tslint.RuleFailure>>();
|
||||
let registeredCodeFixes = false;
|
||||
|
||||
function computeKey(start: number, end: number): string {
|
||||
return `[${start},${end}]`;
|
||||
}
|
||||
|
||||
let configFile: string = null;
|
||||
let configuration: tslint.Configuration.IConfigurationFile = null;
|
||||
|
||||
let configCache = {
|
||||
filePath: <string>null,
|
||||
configuration: <any>null,
|
||||
|
@ -22,6 +15,7 @@ let configCache = {
|
|||
interface Settings {
|
||||
alwaysShowRuleFailuresAsWarnings?: boolean;
|
||||
ignoreDefinitionFiles?: boolean;
|
||||
configFile?: string;
|
||||
}
|
||||
|
||||
//TODO we "steal"" an error code with a registered code fix. 2515 = implement inherited abstract class
|
||||
|
@ -55,6 +49,7 @@ function init(modules: { typescript: typeof ts_module }) {
|
|||
|
||||
info.project.projectService.logger.info("tslint-language-service loaded");
|
||||
let config:Settings = info.config;
|
||||
let configuration: tslint.Configuration.IConfigurationFile = null;
|
||||
|
||||
// Set up decorator
|
||||
const proxy = Object.create(null) as ts.LanguageService;
|
||||
|
@ -65,6 +60,10 @@ function init(modules: { typescript: typeof ts_module }) {
|
|||
}
|
||||
}
|
||||
|
||||
function computeKey(start: number, end: number): string {
|
||||
return `[${start},${end}]`;
|
||||
}
|
||||
|
||||
function makeDiagnostic(problem: tslint.RuleFailure, file: ts.SourceFile): ts.Diagnostic {
|
||||
let message = (problem.getRuleName() !== null)
|
||||
? `${problem.getFailure()} (${problem.getRuleName()})`
|
||||
|
@ -157,7 +156,7 @@ function init(modules: { typescript: typeof ts_module }) {
|
|||
}
|
||||
|
||||
try {
|
||||
configuration = getConfiguration(fileName, configFile);
|
||||
configuration = getConfiguration(fileName, config.configFile);
|
||||
} catch (err) {
|
||||
// this should not happen since we guard against incorrect configurations
|
||||
// showConfigurationFailure(conn, err);
|
||||
|
|
Загрузка…
Ссылка в новой задаче