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

feat: Add supporting for "go to line" #13

Merged
merged 7 commits into from
Jul 29, 2024

Conversation

Moyf
Copy link
Contributor

@Moyf Moyf commented Jul 25, 2024

Hello! I have just added a new feature: "Open in VS Code and Go to the Line"!

Here are the details, I introduced 2 parameters: {{line}} and {{ch}}

As a result, if we set the tepmlate like this:
code -g "{{vaultpath}}" "{{vaultpath}}/{{filepath}}:{{line}}:{{ch}}"
we can directly jump into the specified line!

(VS Code's doc: https://code.visualstudio.com/docs/editor/command-line )


Some things you may pay attention to:
[1] I can't compile with import * as internal from "obsidian-typings"; so I changed it to external, don't know would it affect anything.
image

Do you have any clues? 🤔

[2] I added a new GOTO_LINE_SETTING but I don't want to change the DEFAULT_SETTING, then I have no idea how to deal with it ... you can delete it LOL

image

@Moyf
Copy link
Contributor Author

Moyf commented Jul 25, 2024

(Ooops I forgot to update the manifest.json ... Do I need to? It's merely the first time I submit the PR to a plugin )

@NomarCub
Copy link
Owner

Hey!
Thanks for the feature! I'll take a look at it sometime next week.
As for the manifest file, you don't need to update it.
I suspected the obsidian-typings would cause some issues in the future, but it hasn't for me so far. What is your OS, Node, and npm version?

@Moyf
Copy link
Contributor Author

Moyf commented Jul 25, 2024

Hey! Thanks for the feature! I'll take a look at it sometime next week. As for the manifest file, you don't need to update it. I suspected the obsidian-typings would cause some issues in the future, but it hasn't for me so far. What is your OS, Node, and npm version?

Here is my sys info:

  • system: Windows 11
  • npm: '10.7.0',
  • node: '20.14.0',

@NomarCub
Copy link
Owner

Hi!
Everything looks good, I made some finishing touches. Could you please try if this latest version also works on your end, and the obsidian-typings import is OK too?

@Moyf
Copy link
Contributor Author

Moyf commented Jul 29, 2024

Hi! Everything looks good, I made some finishing touches. Could you please try if this latest version also works on your end, and the obsidian-typings import is OK too?

Just tested, the build has no problem and the function also works well 👍🏻

@NomarCub NomarCub merged commit 95c03b3 into NomarCub:main Jul 29, 2024
@NomarCub
Copy link
Owner

I just made a release with this here: https://github.com/NomarCub/obsidian-open-vscode/releases/tag/1.2.3.
Thank you for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants