mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 17:25:39 +01:00
Assume identifiers starting with an uppercase letter are types
This commit is contained in:
parent
5557352259
commit
7140444de9
1 changed files with 9 additions and 1 deletions
|
|
@ -211,13 +211,21 @@ export const language = <ILanguage>{
|
|||
tokenizer: {
|
||||
root: [
|
||||
// identifiers and keywords
|
||||
[/[a-zA-Z_$][\w$]*/, {
|
||||
[/[a-z_$][\w$]*/, {
|
||||
cases: {
|
||||
'@keywords': { token: 'keyword.$0' },
|
||||
'@default': 'identifier'
|
||||
}
|
||||
}],
|
||||
|
||||
// assume that identifiers starting with an uppercase letter are types
|
||||
[/[A-Z][\w\$]*/, {
|
||||
cases: {
|
||||
'@keywords': { token: 'keyword.$0' },
|
||||
'@default': 'type.identifier'
|
||||
}
|
||||
}],
|
||||
|
||||
// whitespace
|
||||
{ include: '@whitespace' },
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue