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

[ BUG ] Assistant not working when creating local file links in markdown #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ramalingam0431
Copy link
Contributor

Title : Assistant not working when creating local file links in markdown

Introduction: This PR aims to address an issue where the assistant incorrectly handles local file links in Markdown, causing them to malfunction.

Changes Made: I have made modifications to the assistant's behavior when creating local file links. Now, when a local file is selected from the dropdown, the link text will correctly display only the selected filename, without appending any previously typed characters.

Benefits/Impact: Users will experience improved functionality when creating local file links in Markdown documents. The assistant will provide the expected behavior, making the process more intuitive and reliable.

Related Issues: None

@salesforce-cla
Copy link

Thanks for the contribution! It looks like @Ramalingam0431 is an internal user so signing the CLA is not required. However, we need to confirm this.

];

const customPlugins = [
{label: '::include', insertText: new SnippetString(`\n::include{src="$1"}\n`)},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ramalingam0431 I think, there is some prettier setting enable which is formatting all the files.

)
);
//replace the entire previously typed path by setting the range to start from the first text after "("
const replacementStart = text.indexOf("(") + 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you check if text could be "" or null in text.indexOf("(") + 1;

Copy link
Collaborator

@gagandeepSf gagandeepSf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments. Could you please release a vsce file to test your changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants