Skip to content

Commit

Permalink
Langauges -> Languages
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-xia committed Apr 18, 2019
1 parent a039b79 commit 941b4a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Expand Up @@ -5,7 +5,7 @@

import * as vscode from 'vscode';
import { ResourceMap } from '../utils/resourceMap';
import { DiagnosticLanguage, allDiagnosticLangauges } from '../utils/languageDescription';
import { DiagnosticLanguage, allDiagnosticLanguages } from '../utils/languageDescription';

export const enum DiagnosticKind {
Syntax,
Expand Down Expand Up @@ -71,21 +71,21 @@ class FileDiagnostics {
}
}

interface LangaugeDiagnosticSettings {
interface LanguageDiagnosticSettings {
readonly validate: boolean;
readonly enableSuggestions: boolean;
}

class DiagnosticSettings {
private static readonly defaultSettings: LangaugeDiagnosticSettings = {
private static readonly defaultSettings: LanguageDiagnosticSettings = {
validate: true,
enableSuggestions: true
};

private readonly _languageSettings = new Map<DiagnosticLanguage, LangaugeDiagnosticSettings>();
private readonly _languageSettings = new Map<DiagnosticLanguage, LanguageDiagnosticSettings>();

constructor() {
for (const language of allDiagnosticLangauges) {
for (const language of allDiagnosticLanguages) {
this._languageSettings.set(language, DiagnosticSettings.defaultSettings);
}
}
Expand All @@ -112,11 +112,11 @@ class DiagnosticSettings {
}));
}

private get(language: DiagnosticLanguage): LangaugeDiagnosticSettings {
private get(language: DiagnosticLanguage): LanguageDiagnosticSettings {
return this._languageSettings.get(language) || DiagnosticSettings.defaultSettings;
}

private update(language: DiagnosticLanguage, f: (x: LangaugeDiagnosticSettings) => LangaugeDiagnosticSettings): boolean {
private update(language: DiagnosticLanguage, f: (x: LanguageDiagnosticSettings) => LanguageDiagnosticSettings): boolean {
const currentSettings = this.get(language);
const newSettings = f(currentSettings);
this._languageSettings.set(language, newSettings);
Expand Down
Expand Up @@ -9,7 +9,7 @@ export const enum DiagnosticLanguage {
TypeScript
}

export const allDiagnosticLangauges = [DiagnosticLanguage.JavaScript, DiagnosticLanguage.TypeScript];
export const allDiagnosticLanguages = [DiagnosticLanguage.JavaScript, DiagnosticLanguage.TypeScript];

export interface LanguageDescription {
readonly id: string;
Expand Down

0 comments on commit 941b4a9

Please sign in to comment.