Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update API for retrieving theme in monaco-editor version 0.21.2 #16

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Wire `monaco-textmate` with `monaco-editor`

**Note:** *The latest version of this library requires `monaco-editor` version `0.21.2` and up. If you wish to use an older version of `monaco-editor` `0.19.x` or below, you should use an older version `2.2.2` of this library.*

## Install

```sh
Expand Down
6 changes: 3 additions & 3 deletions src/tm-to-monaco-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ export const TMToMonacoToken = (editor: monacoNsps.editor.ICodeEditor, scopes: s
if (char === ".") {
const token = scope.slice(0, i);
if (
editor['_themeService'].getTheme()._tokenTheme._match(token + "." + scopeName)._foreground >
editor['_themeService']._theme._tokenTheme._match(token + "." + scopeName)._foreground >
1
) {
return token + "." + scopeName;
}
if (editor['_themeService'].getTheme()._tokenTheme._match(token)._foreground > 1) {
if (editor['_themeService']._theme._tokenTheme._match(token)._foreground > 1) {
return token;
}
}
}
}

return "";
};
};