Skip to content

Commit

Permalink
Update extension to support other languages
Browse files Browse the repository at this point in the history
  • Loading branch information
jramcast committed May 29, 2024
1 parent b6817f5 commit 8228f40
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ AI writing assistant (prototype).

3. Install the extension in VSCode

code --install-extension extension/rht-text-generator/rht-text-generator-0.0.1.vsix
code --install-extension extension/rht-text-generator/rht-text-generator-0.0.2.vsix

## Retrain the model

Expand Down
10 changes: 7 additions & 3 deletions extension/rht-text-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
"name": "rht-text-generator",
"displayName": "rht-text-generator",
"publisher": "red-hat-training",
"description": "",
"version": "0.0.1",
"description": "VSCode RHT extension for writting suggestions",
"repository": "https://github.com/RedHatTraining/ai-text-generation",
"version": "0.0.2",
"engines": {
"vscode": "^1.55.0"
},
"categories": [
"Other"
],
"activationEvents": [
"*"
"onLanguage:asciidoc",
"onLanguage:latex",
"onLanguage:markdown",
"onLanguage:plaintext"
],
"main": "./out/extension.js",
"scripts": {
Expand Down
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions extension/rht-text-generator/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function activate(context: vscode.ExtensionContext) {

context.subscriptions.push(
vscode.languages.registerCompletionItemProvider(
[{ language: "asciidoc"}],
[{ language: "asciidoc" }, { language: "latex" }, { language: "markdown" }, { language: "plaintext" }],
provider,
...COMPLETION_TRIGGERS
)
Expand Down Expand Up @@ -60,7 +60,7 @@ async function getCompletionsListItemsFor(
/**
* Get the text from the current position back to a specific number of lines
*/
function getText(document: vscode.TextDocument, position: vscode.Position): string {
function getText(document: vscode.TextDocument, position: vscode.Position): string {
const config = vscode.workspace.getConfiguration("rht-text-generator");
const MAX_LINES: number = config.get("lines") || 3;
const currentLineNumber = position.line;
Expand Down

0 comments on commit 8228f40

Please sign in to comment.