Skip to content

Commit f6e4f41

Browse files
committed
Fix scopeName priority order
1 parent 43de187 commit f6e4f41

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/themeScopeColors.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,16 @@ export async function getScopes() {
7171
}
7272

7373
async 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+
}

0 commit comments

Comments
 (0)