fix(editor): use the bundled ABAP grammar (#22417)

Co-authored-by: Jonghwa Hong <zzzonghwa@gmail.com>
This commit is contained in:
Neil
2026-09-25 20:42:41 -07:00
committed by GitHub
co-authored by Jonghwa Hong
parent ce2f75e172
commit d1eb64ea41
2 changed files with 20 additions and 0 deletions
@@ -38,6 +38,25 @@ describe('detectLanguage', () => {
expect(detectLanguage('C:\\rtl\\TOP.SV')).toBe('systemverilog')
})
it.each([
'report.abap',
'src/zcor0260.prog.abap',
'src/zcl_demo.clas.abap',
'src/zif_demo.intf.abap',
'C:\\repo\\src\\ZCL_DEMO.CLAS.ABAP',
'\\\\server\\share\\src\\ZREPORT.PROG.ABAP',
'/home/user/folder workspace/src/Report.AbAp'
])('maps ABAP source %s to the Monaco built-in abap language id', (filePath) => {
expect(detectLanguage(filePath)).toBe('abap')
})
it.each(['src.abap/README', 'src\\abap.abap\\README', 'report.abap.bak', 'report.abapx'])(
'keeps non-ABAP file %s on plaintext',
(filePath) => {
expect(detectLanguage(filePath)).toBe('plaintext')
}
)
it('maps .proto files to the Monaco built-in proto language id, not the alias', () => {
expect(detectLanguage('api/v1/service.proto')).toBe('proto')
})
+1
View File
@@ -104,6 +104,7 @@ const EXT_TO_LANGUAGE: Record<string, string> = {
'.nimble': 'nim',
'.tf': 'hcl',
'.hcl': 'hcl',
'.abap': 'abap',
'.prisma': 'graphql',
'.csv': 'csv',
'.tsv': 'tsv'