File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -71,8 +71,16 @@ export async function getScopes() {
7171}
7272
7373async function loadColorTheme ( uri : vscode . Uri ) {
74- const document = await vscode . workspace . openTextDocument ( uri ) ;
75- const theme = < ColorTheme > JSON . parse ( document . getText ( ) ) ;
74+ const file = await vscode . workspace . fs . readFile ( uri ) ;
75+ const text = file . toString ( ) ;
76+ const theme : ColorTheme = JSON . parse ( text ) ;
77+
78+ const include = theme . include ;
79+ if ( include ) {
80+ const uriInclude = vscode . Uri . joinPath ( uri , '..' , include ) ;
81+ await loadColorTheme ( uriInclude ) ;
82+ }
83+
7684 const tokenColors = theme . tokenColors ;
7785 if ( tokenColors ) {
7886 for ( const tokenColor of tokenColors ) {
@@ -102,9 +110,4 @@ async function loadColorTheme(uri: vscode.Uri) {
102110 }
103111 }
104112 }
105- const include = theme . include ;
106- if ( include ) {
107- const uriInclude = vscode . Uri . joinPath ( uri , '../' , include ) ;
108- await loadColorTheme ( uriInclude ) ;
109- }
110- }
113+ }
You can’t perform that action at this time.
0 commit comments