Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix : Add syntax highlighting for pascal and clojure languages. #4771

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 29 additions & 27 deletions gui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gui/package.json
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@
"dompurify": "^3.0.6",
"downshift": "^7.6.0",
"lodash": "^4.17.21",
"lowlight": "^3.3.0",
"minisearch": "^7.0.2",
"mustache": "^4.2.0",
"posthog-js": "^1.130.1",
13 changes: 9 additions & 4 deletions gui/src/components/markdown/StyledMarkdownPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { ctxItemToRifWithContents } from "core/commands/util";
import clojure from "highlight.js/lib/languages/clojure";
import Delphi from "highlight.js/lib/languages/Delphi";
import { common } from "lowlight";
import { memo, useEffect, useMemo } from "react";
import { useRemark } from "react-remark";
import rehypeHighlight, { Options } from "rehype-highlight";
@@ -234,14 +237,16 @@ const StyledMarkdownPreview = memo(function StyledMarkdownPreview(
rehypePlugins: [
rehypeKatex as any,
{},
rehypeHighlight as any,
[
rehypeHighlight,
{
languages: { ...common, clojure, Delphi},
} as Options,
],
// Note: An empty obj is the default behavior, but leaving this here for scaffolding to
// add unsupported languages in the future. We will need to install the `lowlight` package
// to use the `common` language set in addition to unsupported languages.
// https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md
{
// languages: {},
} as Options,
() => {
let codeBlockIndex = 0;
return (tree) => {

Unchanged files with check annotations Beta

stopStatusBarLoading,
} from "./statusBar";
import type { IDE } from "core";

Check warning on line 26 in extensions/vscode/src/autocomplete/completionProvider.ts

GitHub Actions / vscode-checks

There should be at least one empty line between import groups
import { handleLLMError } from "../util/errorHandling";

Check warning on line 27 in extensions/vscode/src/autocomplete/completionProvider.ts

GitHub Actions / vscode-checks

`../util/errorHandling` import should occur before import of `../util/messages`
interface VsCodeCompletionInput {
document: vscode.TextDocument;
import * as vscode from "vscode";
import type { IDE, Range, RangeInFile, RangeInFileWithContents } from "core";
import type Parser from "web-tree-sitter";

Check warning on line 11 in extensions/vscode/src/autocomplete/lsp.ts

GitHub Actions / vscode-checks

There should be at least one empty line between import groups
import { GetLspDefinitionsFunction } from "core/autocomplete/types";

Check warning on line 12 in extensions/vscode/src/autocomplete/lsp.ts

GitHub Actions / vscode-checks

`core/autocomplete/types` import should occur before import of `core/autocomplete/util/ast`
import {

Check warning on line 13 in extensions/vscode/src/autocomplete/lsp.ts

GitHub Actions / vscode-checks

`core/autocomplete/snippets/types` import should occur before import of `core/autocomplete/util/ast`
AutocompleteCodeSnippet,
AutocompleteSnippetType,
} from "core/autocomplete/snippets/types";
import * as URI from "uri-js";

Check warning on line 17 in extensions/vscode/src/autocomplete/lsp.ts

GitHub Actions / vscode-checks

`uri-js` import should occur before import of `vscode`
type GotoProviderName =
| "vscode.executeDefinitionProvider"
setupStatusBar,
StatusBarStatus,
} from "./autocomplete/statusBar";
import { ContinueGUIWebviewViewProvider } from "./ContinueGUIWebviewViewProvider";

Check warning on line 30 in extensions/vscode/src/commands.ts

GitHub Actions / vscode-checks

There should be no empty line within import group
import { VerticalDiffManager } from "./diff/vertical/manager";
import EditDecorationManager from "./quickEdit/EditDecorationManager";
import { getMetaKeyLabel } from "./util/util";
import { VsCodeIde } from "./VsCodeIde";
import { LOCAL_DEV_DATA_VERSION } from "core/data/log";

Check warning on line 39 in extensions/vscode/src/commands.ts

GitHub Actions / vscode-checks

`core/data/log` import should occur before import of `core/indexing/walkDir`
import { isModelInstaller } from "core/llm";

Check warning on line 40 in extensions/vscode/src/commands.ts

GitHub Actions / vscode-checks

`core/llm` import should occur before import of `core/util/paths`
import { startLocalOllama } from "core/util/ollamaHelper";

Check warning on line 41 in extensions/vscode/src/commands.ts

GitHub Actions / vscode-checks

There should be at least one empty line between import groups
import type { VsCodeWebviewProtocol } from "./webviewProtocol";
let fullScreenPanel: vscode.WebviewPanel | undefined;