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

Startup time slowed by scope source erros #112

Open
maegul opened this issue Oct 3, 2020 · 7 comments
Open

Startup time slowed by scope source erros #112

maegul opened this issue Oct 3, 2020 · 7 comments

Comments

@maegul
Copy link

maegul commented Oct 3, 2020

Start up is slow.

Appears to be caused by following series of errors:

Error loading scope:source.ejs: Unable to find syntax file for scope source.ejs in Packages/sublime_zk/zk-mode/sublime_zk_search.sublime-syntax
Error loading scope:source.julia: Unable to find syntax file for scope source.julia in Packages/sublime_zk/zk-mode/sublime_zk_search.sublime-syntax
Error loading scope:source.swift: Unable to find syntax file for scope source.swift in Packages/sublime_zk/sublime_zk.sublime-syntax
...

Probably an error in the syntax definition??

@chunyunma
Copy link

I have encountered the same error messages.
Sublime Text loaded normally.
As soon as I turned on zk syntax for a note,
received the following error messages

Error loading scope:source.swift: Unable to find syntax file for scope source.swift in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:source.coffee: Unable to find syntax file for scope source.coffee in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:source.pgsql: Unable to find syntax file for scope source.pgsql in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:text.html.handlebars: Unable to find syntax file for scope text.html.handlebars in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:source.stylus: Unable to find syntax file for scope source.stylus in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:source.scss: Unable to find syntax file for scope source.scss in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:text.html.swig: Unable to find syntax file for scope text.html.swig in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:source.ini: Unable to find syntax file for scope source.ini in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:source.livescript: Unable to find syntax file for scope source.livescript in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:source.nginx: Unable to find syntax file for scope source.nginx in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:source.css.less: Unable to find syntax file for scope source.css.less in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:source.sass: Unable to find syntax file for scope source.sass in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:source.graphql: Unable to find syntax file for scope source.graphql in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:source.jade: Unable to find syntax file for scope source.jade in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:source.ejs: Unable to find syntax file for scope source.ejs in Packages/sublime_zk/sublime_zk.sublime-syntax
Error loading scope:source.julia: Unable to find syntax file for scope source.julia in Packages/sublime_zk/sublime_zk.sublime-syntax

Also, tag searching has stopped working for me.
I have the latest ag installed (2.2.0).

I am on mac OS, Catalina 10.15.7. ST Build 3211.

@maegul
Copy link
Author

maegul commented Oct 19, 2020

I've looked into this a little.

The problem comes from using the same syntax as sublime markdown extended.

My comment on the relevant issue here.

It seems that while the syntax could be defined in a better way (though I am not at all sure about that), it isn't too much of an issue. The syntax is simply expecting syntax definitions for all sorts of programming languages for the fenced code blocks. The errors are for whenever one of these expected languages doesn't have a syntax definition in your current sublime text environment. Simply installing or creating one would avoid the error.

As I say in the comment linked above, the errors don't appear to be necessary however, as other advanced markdown syntax definitions avoid the errors by going about it in a different way.

@chunyunma
Copy link

Thank you for the clarification, @maegul
I read the linked discussion.
If I understood it correctly, these error messages do not affect the funtionalities of sublime_zk
and we can safely ignore them?

I also mentioned in my previous post that the tag searching (ctrl + enter)
has stopped working for me.
I turned on console and got the following messages:

cmd: ag --nocolor -l --ackmate --silent -G .*\ #tag /path/to/my/notes
sublime_zk: search unsuccessful:
2
['ag', '--nocolor', '-l', '--ackmate', '--silent', '-G', '.*\\', '#tag', 'path/to/my/notes']
     
Error loading scope:source.swift: Unable to find syntax file for scope source.swift in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:source.coffee: Unable to find syntax file for scope source.coffee in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:source.pgsql: Unable to find syntax file for scope source.pgsql in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:text.html.handlebars: Unable to find syntax file for scope text.html.handlebars in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:source.stylus: Unable to find syntax file for scope source.stylus in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:source.scss: Unable to find syntax file for scope source.scss in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:text.html.swig: Unable to find syntax file for scope text.html.swig in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:source.ini: Unable to find syntax file for scope source.ini in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:source.livescript: Unable to find syntax file for scope source.livescript in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:source.nginx: Unable to find syntax file for scope source.nginx in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:source.css.less: Unable to find syntax file for scope source.css.less in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:source.sass: Unable to find syntax file for scope source.sass in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:source.graphql: Unable to find syntax file for scope source.graphql in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:source.jade: Unable to find syntax file for scope source.jade in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:source.ejs: Unable to find syntax file for scope source.ejs in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax
Error loading scope:source.julia: Unable to find syntax file for scope source.julia in Packages/sublime_zk/zk-mode/sublime_zk_results.sublime-syntax

Not sure if these error messages were related to the error I was getting ...

@maegul
Copy link
Author

maegul commented Oct 25, 2020

I don't see how the Error loading scope:source.julia: errors could be related, so I wouldn't worry about them.

Off the top of my head, I can't tell what problem you are having with ag.
Given what you've printed from the console though, I would guess that generally everything seems fine (as you say, ag is installed, and sublime_zk seems to be using it). sublime_zk: search unsuccessful: indicates this to me.

Maybe there's a problem with the particular search you are running, or sublime_zk doesn't know where to look or which path to use for you notes?

What happens when you type #,? ... this should bring up a list of previous tags.

@chunyunma
Copy link

@maegul Thank you so much for the reply!! I figured out why!!
It turns out that I had broken this feature by changing the extention in the following setting in sublime_zk.sublime-settings:

    // The preferred markdown extension
    "wiki_extension": "",  // originally was ".md"

When I added the ".md" back, tag searching worked as before again!

In case you might wonder why I made that change in the first place.
I was looking for a way to have both .md files and some other types of files such as .tex
in the same zk folder, managed by sublime_zk.
However, I was unsuccessful at first.
Every file created by shift + Enter would automatically get an .md extension.
And if I manually add a file with any extension other than .md,
it would not get a unique ID like other markdown files,
and thus would not benefit from the zk system.
Then I stumbled upon the "wiki_extension"setting,
and by removing ".md", I was able to mix different types of files in the same zk folder.
The only downside is that I would need to manually add the file extension
once created, which is a minor nuisance and I created a macro to take care of that.

Now that I have discovered this conflict,
I might have to reconsider my previous hack.
On a related note, do you know if zk natively allows for mixing different types of files?

@dfeng
Copy link

dfeng commented Dec 23, 2020

If you look at the code logic on sublime_zk.py, it appears that this variable is used in multiple locations, and expects just one extension (as opposed to a list of extensions). I'm not even sure why you would want to mix .tex files with everything in any case, since none of the syntax works. Your best bet is to use something like pandoc to convert your .tex files into markdown.

@chunyunma
Copy link

Thank you for the response!
Mixing .tex files with .md files was
when I tried to have one folder for all my notes,
as part of my attempt to set up zk through trial and error.

I enjoyed my ride with sublime-zk for the first six months
and have migrated to vim since two months ago ;p

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

No branches or pull requests

3 participants