Browse Source

Merge pull request #2809 from gitpaladin/missing-pb-syntax-directive

Fix token while missing `syntax=` directive
Alexandru Dima 3 years ago
parent
commit
7eee44891f
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/basic-languages/protobuf/protobuf.ts

+ 5 - 0
src/basic-languages/protobuf/protobuf.ts

@@ -132,6 +132,11 @@ export const language = <languages.IMonarchLanguage>{
 			[
 				/(")(proto2)(")/,
 				['string.quote', 'string', { token: 'string.quote', switchTo: '@topLevel.proto2' }]
+			],
+			[
+				// If no `syntax` provided, regarded as proto2
+				/.*?/,
+				{ token: '', switchTo: '@topLevel.proto2' }
 			]
 		],