Skip to content

Commit f6c2418

Browse files
feat(web): add Basic language support in file viewer (#1054)
* feat(web): add Basic language support in file viewer * chore: update CHANGELOG for #1054
1 parent 5fc21fd commit f6c2418

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111
- Added support for `.gitattributes` `linguist-language` overrides in the file viewer ([#1048](https://github.com/sourcebot-dev/sourcebot/pull/1048))
12+
- Added Basic language syntax highlighting in the file viewer ([#1054](https://github.com/sourcebot-dev/sourcebot/pull/1054))
1213

1314
### Fixed
1415
- Fixed Ask GitHub landing page chat box placement to be centered on the page instead of at the bottom. [#1046](https://github.com/sourcebot-dev/sourcebot/pull/1046)

packages/web/src/lib/codemirrorLanguage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ export const codemirrorLanguageMap = {
169169
"xml": xml(),
170170
"yaml": yaml(),
171171
"zig": zig(),
172+
"basic": StreamLanguage.define(vb),
172173
// Legacy CodeMirror 5 modes
173174
"apl": StreamLanguage.define(apl),
174175
"ceylon": StreamLanguage.define(ceylon),

packages/web/src/lib/languageDetection.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const ambiguousExtensionOverrides: Record<string, string> = {
1616
'.txt': 'Text', // Not Adblock Filter List, Vim Help File
1717
'.yaml': 'YAML', // Not MiniYAML, OASv2-yaml, OASv3-yaml
1818
'.yml': 'YAML',
19+
'.bas': 'BASIC'
1920
};
2021

2122
const extensionToLanguage = new Map<string, string>();

packages/web/src/lib/languageMetadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export const languageMetadataMap: LanguageMetadataMap = {
190190
},
191191
"BASIC": {
192192
"iconify": "devicon:visualbasic",
193-
"codemirrorLanguage": null,
193+
"codemirrorLanguage": 'basic',
194194
},
195195
"BQN": {
196196
"iconify": null,

0 commit comments

Comments
 (0)