File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import type {
9
9
SignatureHelpItem ,
10
10
SignatureHelpParameter ,
11
11
TextSpan ,
12
+ UserPreferences ,
12
13
} from "typescript/lib/protocol"
13
14
14
15
// NOTE: using TypeScript internals here. May be brittle!
@@ -56,12 +57,13 @@ export function rangeToLocationRange(range: Atom.Range): LocationRangeQuery {
56
57
}
57
58
}
58
59
59
- export function getProjectConfig (
60
- configFile : string ,
61
- ) : {
60
+ export interface ProjectConfig {
62
61
formatCodeOptions : FormatCodeSettings
63
62
compileOnSave : boolean
64
- } {
63
+ preferences : UserPreferences
64
+ }
65
+
66
+ export function getProjectConfig ( configFile : string ) : ProjectConfig {
65
67
const config = loadConfig ( configFile )
66
68
const options = ( config as { formatCodeOptions ?: FormatCodeSettings } ) . formatCodeOptions
67
69
@@ -72,15 +74,11 @@ export function getProjectConfig(
72
74
...options ,
73
75
} ,
74
76
compileOnSave : ! ! config . compileOnSave ,
77
+ preferences : config . preferences ? config . preferences : { } ,
75
78
}
76
79
}
77
80
78
- function loadConfig (
79
- configFile : string ,
80
- ) : {
81
- formatCodeOptions ?: FormatCodeSettings
82
- compileOnSave ?: boolean
83
- } {
81
+ function loadConfig ( configFile : string ) : Partial < ProjectConfig > {
84
82
if ( path . extname ( configFile ) !== ".json" ) {
85
83
configFile = `${ configFile } .json`
86
84
}
Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ export class TypescriptBuffer {
173
173
"atom-typescript.includeCompletionsForModuleExports" ,
174
174
) ,
175
175
quotePreference : atom . config . get ( "atom-typescript.quotePreference" ) ,
176
+ ...options . preferences ,
176
177
} ,
177
178
} )
178
179
}
You can’t perform that action at this time.
0 commit comments