Templater icon indicating copy to clipboard operation
Templater copied to clipboard

Error message links to the error

Open Saorsa32 opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I am very new to obsidian and coding. It would be so helpful if when the error message it would link to location of the error. When the message comes up I end up wasting so much time just figuring out which one is causing the problem. I know that you can try to fix the problem using the console, but my understanding is so limited I rarely have success in being able to fix the problem.

Describe the solution you'd like A clear and concise description of what you want to happen.

If I could just click on the error message and have it take me to what I need to fix that would be amazing. I am not sure if this is even possible, but it would be such a great help to a newbie like me. Thank you for your wonderful plug-in. I use it in almost everything I do.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

Saorsa32 avatar Jun 18 '22 21:06 Saorsa32

I understand, but it's natural

I identify with you. Debugging sometimes takes hours, and the mistake could be something really minor! I think that is the nature of debugging though. If you goto the programming subreddit, you'll always find memes about how it's like 10% coding and 90% debugging.

existing error in console

Anyways, I recently found that the errors in the in console from Chrome is not that bad.

For example demo

The reason why it is hard to find the location of the problem sometimes is it seems all the code eventually goes into one single app.js file or something.

possible enhancement for Templater

Currently, when codding a template, the Templater plugin does do syntax highlighting, using codeMirror, which helps alot. Perhaps @SilentVoid13 could implement a linter later on as well. CodeMirror does have a js linter addon but idk specifically how that can be implemented.

alternatives

  1. I think the obsidian-codemirror-options does something like that too. It could tell you if your code has errors for example.

  2. You could also consider using an code editor like sublime text and install a linter to help you debug coding issues. You can also use an online one like jsfiddle. Though, in both cases you won't be able to access things like the tp object.

  3. In any case, if you have a problem you can't figure out, you can always feel free to post your problem at Discussions and make a post.

welpdx avatar Jun 18 '22 22:06 welpdx

#724

shabegom avatar Sep 24 '22 01:09 shabegom