Skip to content

Commit a94ccca

Browse files
authored
Properly type the return value of _languageExtForPath (#5937)
1 parent 99f4176 commit a94ccca

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/components/shared/SourceView-codemirror.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
import { EditorView, lineNumbers } from '@codemirror/view';
2222
import { EditorState, Compartment } from '@codemirror/state';
23-
import { syntaxHighlighting } from '@codemirror/language';
23+
import { type LanguageSupport, syntaxHighlighting } from '@codemirror/language';
2424
import { classHighlighter } from '@lezer/highlight';
2525
import { cpp } from '@codemirror/lang-cpp';
2626
import { rust } from '@codemirror/lang-rust';
@@ -46,9 +46,7 @@ const highlightedLineConf = new Compartment();
4646
const lineNumbersConf = new Compartment();
4747

4848
// Detect the right language based on the file extension.
49-
function _languageExtForPath(
50-
path: string | null
51-
): any /* LanguageSupport | [] */ {
49+
function _languageExtForPath(path: string | null): LanguageSupport | [] {
5250
if (path === null) {
5351
return [];
5452
}

0 commit comments

Comments
 (0)