This pull request enhances the functionality of the activate function in src/extension.ts to provide a better user experience when opening the README file. The most important changes include adding a check to open the README in preview mode if it is a markdown file and handling errors gracefully if the preview mode fails.
Improvements to README auto-open functionality:
Added a check to determine if the README file can be previewed (.md file) and attempt to open it in preview mode. (src/extension.ts)
Implemented error handling to fall back to opening the README in the text editor if the preview mode fails. (src/extension.ts)
Introduced a new helper function openReadmeInEditor to encapsulate the logic for opening the README in the text editor. (src/extension.ts)
This pull request enhances the functionality of the
activate
function insrc/extension.ts
to provide a better user experience when opening the README file. The most important changes include adding a check to open the README in preview mode if it is a markdown file and handling errors gracefully if the preview mode fails.Improvements to README auto-open functionality:
.md
file) and attempt to open it in preview mode. (src/extension.ts
)src/extension.ts
)openReadmeInEditor
to encapsulate the logic for opening the README in the text editor. (src/extension.ts
)Resolves #7