Skip to content

Commit

Permalink
docs: add docs and schema for "OS" provider (#1536)
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick-Erichsen authored Jun 21, 2024
1 parent b402b91 commit 2ed4ff6
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 396 deletions.
13 changes: 5 additions & 8 deletions core/context/providers/OSContextProvider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//os.platform()
//os.arch()

import os from "os";
import {
ContextItem,
Expand All @@ -11,9 +8,9 @@ import { BaseContextProvider } from "../index.js";

class OSContextProvider extends BaseContextProvider {
static description: ContextProviderDescription = {
title: "OS",
displayTitle: "OS",
description: "OS and CPU Information.",
title: "os",
displayTitle: "Operating System",
description: "Operating system and CPU Information.",
type: "normal",
};

Expand All @@ -25,9 +22,9 @@ class OSContextProvider extends BaseContextProvider {
const platform = os.platform();
return [
{
description: "Your OS and CPU",
description: "Your operating system and CPU",
content: `I am running ${platform} on ${cpu}.`,
name: "OS",
name: "os",
},
];
}
Expand Down
8 changes: 8 additions & 0 deletions docs/docs/customization/context-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,14 @@ Type `@locals` to reference the contents of the local variables with top n level
}
```

### Operating System

Type `@os` to reference the architecture and platform of your current operating system.

```json
{ "name": "os" }
```

### Requesting Context Providers

Not seeing what you want? Create an issue [here](https://github.com/continuedev/continue/issues/new?assignees=TyDunn&labels=enhancement&projects=&template=feature-request-%F0%9F%92%AA.md&title=) to request a new ContextProvider.
Expand Down
6 changes: 4 additions & 2 deletions extensions/vscode/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,8 @@
"code",
"currentFile",
"url",
"database"
"database",
"os"
],
"markdownEnumDescriptions": [
"Reference the contents of the current changes as given by `git diff`",
Expand All @@ -1340,7 +1341,8 @@
"Reference specific functions and classes from throughout your codebase",
"Reference the contents of the currently active file",
"Reference the contents of a page at a URL",
"Reference table schemas"
"Reference table schemas",
"Operating system and CPU Information"
],
"type": "string"
},
Expand Down
Loading

0 comments on commit 2ed4ff6

Please sign in to comment.