Skip to content

Commit

Permalink
Fix getEmitOutput not honoring compile settings
Browse files Browse the repository at this point in the history
getCompilationSettings needs to return a flat object. getEmitOutput uses
the spread operator, so it won't pick up settings from a prototype.
  • Loading branch information
jeffrey-easyesi committed Jul 25, 2018
1 parent 6272e8e commit a20bda9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion manifest.mf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: true
OpenIDE-Module: netbeanstypescript
OpenIDE-Module-Layer: netbeanstypescript/resources/layer.xml
OpenIDE-Module-Localizing-Bundle: netbeanstypescript/Bundle.properties
OpenIDE-Module-Specification-Version: 3.0.0
OpenIDE-Module-Specification-Version: 3.0.1
17 changes: 9 additions & 8 deletions server/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,14 @@ class HostImpl implements ts.LanguageServiceHost {
parseError: ts.Diagnostic;
pcl: ts.ParsedCommandLine;
raw: any;
settings: ts.CompilerOptions;
} = null;
constructor(public path: string, public isConfig: boolean) {}
log(s: string) {
process.stdout.write('L' + JSON.stringify(s) + '\n');
}
getCompilationSettings() {
var options = this.configUpToDate().pcl.options;
var settings: ts.CompilerOptions = Object.create(options);
if (options.noImplicitAny == null) {
// report implicit-any errors anyway, but only as warnings (see getDiagnostics)
settings.noImplicitAny = true;
}
return settings;
return this.configUpToDate().settings;
}
getNewLine() {
return ts.getNewLineCharacter(this.configUpToDate().pcl.options);
Expand Down Expand Up @@ -112,7 +107,13 @@ class HostImpl implements ts.LanguageServiceHost {
|| <never>(<any>ts).parseConfigFile;
const dir = this.path.substring(0, this.path.lastIndexOf('/') + 1);
const pcl = parse(config || {}, ts.sys, dir);
this.cachedConfig = { parseError: error, pcl: pcl, raw: pcl.raw || config || {} };
this.cachedConfig = {
parseError: error,
pcl: pcl,
raw: pcl.raw || config || {},
// if noImplicitAny unset, report errors anyway, but only as warnings (see getDiagnostics)
settings: { noImplicitAny: true, ...pcl.options }
};
}
return this.cachedConfig;
}
Expand Down

0 comments on commit a20bda9

Please sign in to comment.