Skip to content

Commit

Permalink
Fix an issue with compound words.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Feb 2, 2017
1 parent cde6b08 commit 011f126
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"dist/**",
".vscode/**"
],
"allowCompoundWords": true,

// flagWords - list of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
Expand Down
18 changes: 9 additions & 9 deletions src/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,21 @@ export class CSpellApplication {
const r = Rx.Observable.combineLatest(
configRx,
filesRx,
(config, fileInfo) => ({ config, text: fileInfo.text, filename: fileInfo.filename })
(configInfo, fileInfo) => ({ configInfo, text: fileInfo.text, filename: fileInfo.filename })
)
.map(({config, filename, text}) => {
.map(({configInfo, filename, text}) => {
const ext = path.extname(filename);
const languageIds = cspell.getLanguagesForExt(ext);
this.debug(`Filename: ${filename}, Extension: ${ext}, LanguageIds: ${languageIds.toString()}`);
const settings = cspell.mergeSettings(cspell.getDefaultSettings(), config);
const fileSettings = cspell.constructSettingsForText(settings, text, languageIds);
return {config: fileSettings, filename, text}
const settings = cspell.mergeSettings(cspell.getDefaultSettings(), configInfo.config);
const config = cspell.constructSettingsForText(settings, text, languageIds);
return {configInfo: {...configInfo, config}, filename, text};
})
.filter(info => info.config.enabled !== false)
.filter(info => info.configInfo.config.enabled !== false)
.do(() => status.files += 1)
.flatMap(({config, filename, text}) => {
this.debug(commentJson.stringify(config, undefined, 2));
return cspell.validateText(text, config)
.flatMap(({configInfo, filename, text}) => {
this.debug(commentJson.stringify(configInfo, undefined, 2));
return cspell.validateText(text, configInfo.config)
.then(wordOffsets => {
return {
filename,
Expand Down

0 comments on commit 011f126

Please sign in to comment.