Skip to content

Commit

Permalink
extension fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostboats committed May 19, 2024
1 parent 2c518fe commit 8f6d4b0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function activate(context) {
const config = vscode.workspace.getConfiguration('bg3ModHelper');
config.update('rootModPath', mainFolderPath, vscode.ConfigurationTarget.Workspace
).then(() => {
vscode.window.showInformationMessage(`Workspace set to:
vscode.window.showInformationMessage(`Workspace set to:
${mainFolderPath}.`,
'Open Settings'
).then(selection => {
Expand All @@ -93,6 +93,7 @@ function activate(context) {
}

let config = vscode.workspace.getConfiguration('bg3ModHelper');

setConfig({
maxFilesToShow: config.get('hover.maxFiles'),
hoverEnabled: config.get('hover.enabled'),
Expand All @@ -102,6 +103,7 @@ function activate(context) {
lslibPath: config.get('lslibPath'),
autoLaunchOnPack: config.get('autoLaunchOnPack'),
launchContinueGame: config.get('launchContinueGame'),
addHandlesToAllLocas: config.get('addHandlesToAllLocas'),
excludedFiles: config.get('excludedFiles') || []
});
bg3mh_logger.info('Initial configs set:' + JSON.stringify(config, null, 2))
Expand All @@ -116,7 +118,7 @@ function activate(context) {
// Register the command to open file at a specific line
context.subscriptions.push(vscode.commands.registerCommand('extension.openFileAtLine', ({ relativePath, lineNum }) => {
const fullPath = getFullPath(relativePath)

const uri = vscode.Uri.file(fullPath);
vscode.window.showTextDocument(uri, { preview: false }).then(editor => {
const line = parseInt(lineNum, 10) - 1; // Convert line number to zero-based index
Expand All @@ -128,8 +130,8 @@ function activate(context) {

// Register autocomplete provider for text files within 'Generated' folders
context.subscriptions.push(vscode.languages.registerCompletionItemProvider(
{ scheme: 'file', pattern: '**/Generated/**/*.txt' },
new AutoCompleteProvider(),
{ scheme: 'file', pattern: '**/Generated/**/*.txt' },
new AutoCompleteProvider(),
'"' // Trigger completion when `"` is typed
));

Expand Down Expand Up @@ -207,4 +209,4 @@ function deactivate() {}
module.exports = {
activate,
deactivate
};
};

0 comments on commit 8f6d4b0

Please sign in to comment.