This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"enabledApiProposals": [ | |
"inlineCompletionsAdditions" | |
], | |
"name": "code-helper", | |
"displayName": "Code Helper", | |
"description": "Sample showing how to implement an inline completion provider", | |
"version": "0.0.1", | |
"publisher": "apurer", | |
"repository": "https://github.com/Microsoft/vscode-extension-samples", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async provideInlineCompletionItems(document, position, context, token) { | |
console.log('provideInlineCompletionItems triggered'); | |
// Read the configuration settings | |
const config = vscode.workspace.getConfiguration('codeHelper'); | |
const maxToGenerate = config.get<number>('maxToGenerate') || 128; | |
const temperature = config.get<number>('temperature') || 0.6; | |
const modelName = config.get<string>('modelName') || 'default_model'; | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"codeHelper.username": { | |
"type": "string", | |
"default": "", | |
"description": "Username for API authentication." | |
}, | |
"codeHelper.password": { | |
"type": "string", | |
"default": "", | |
"description": "Password for API authentication." | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async provideInlineCompletionItems(document, position, context, token) { | |
console.log('provideInlineCompletionItems triggered'); | |
// Read the configuration settings | |
const config = vscode.workspace.getConfiguration('codeHelper'); | |
const maxToGenerate = config.get<number>('maxToGenerate') || 128; | |
const temperature = config.get<number>('temperature') || 0.6; | |
const modelName = config.get<string>('modelName') || 'default_model'; | |
const username = config.get<string>('username') || ''; // Read the username setting | |
const password = config.get<string>('password') || ''; // Read the password setting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"flag" | |
"fmt" | |
"os" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"github.com/skratchdot/open-golang/open" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/x509" | |
"fmt" | |
"net/http" | |
"io/ioutil" | |
"encoding/base64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Generate-CodeVerifier { | |
$bytes = New-Object Byte[] 32 | |
[System.Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($bytes) | |
return [System.Convert]::ToBase64String($bytes) -replace '\+', '-' -replace '\/', '_' -replace '=' | |
} | |
function Generate-CodeChallenge($verifier) { | |
$bytes = [System.Text.Encoding]::ASCII.GetBytes($verifier) | |
$hash = [System.Security.Cryptography.SHA256]::Create().ComputeHash($bytes) | |
return [System.Convert]::ToBase64String($hash) -replace '\+', '-' -replace '\/', '_' -replace '=' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"database/sql" | |
_ "github.com/microsoft/go-mssqldb" | |
_ "github.com/microsoft/go-mssqldb/integratedauth/krb5" | |
) | |
func main() { | |
// Replace with actual values | |
connectionString := "authenticator=krb5;server=your_server_name;database=your_database_name;user id=your_username;krb5-realm=comani.com;krb5-configfile=/etc/krb5.conf;" |