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

Starting servers inconsistent #30

Open
elextr opened this issue Nov 22, 2023 · 6 comments
Open

Starting servers inconsistent #30

elextr opened this issue Nov 22, 2023 · 6 comments

Comments

@elextr
Copy link
Contributor

elextr commented Nov 22, 2023

If I start Geany with a Python file as the current document pylsp doesn't start, but if I switch from the python file to something else and back pylsp is started.

If I start Geany with a C file as current document clangd does start immediately.

@techee
Copy link
Owner

techee commented Nov 22, 2023

I think it rather happens when you start Geany (or open a project) with the first document's tab selected, isn't it the case?

I try to avoid unnecessary server starting so I try not to start servers for all filetypes of open files but only for the file that is in the current tab. If I started servers in "document-open" signal, I'd get them started all because the signal is delivered for all open documents during session opening. I used "document-activate" which is typically invoked after loading a session but in this case it isn't fired - I'm not sure if it is an intended behavior or a bug in Geany, but it also causes geany/geany#3684.

If this signal cannot be used as an indicator of the end of Geany session loading, I'll probably have to introduce a special signal for that.

@techee
Copy link
Owner

techee commented Nov 30, 2023

I added "session-opening" signal for the purpose of detection of session loading in

geany/geany#3707

and hopefully this issue is fixed now. @elextr can you confirm this?

@elextr
Copy link
Contributor Author

elextr commented Dec 2, 2023

Seems to work for me, having a signal for that seems to be the way to go.

@elextr
Copy link
Contributor Author

elextr commented Dec 2, 2023

Although could this do the job?

Right click "goto definition" here and its even commented :-)

@techee
Copy link
Owner

techee commented Dec 5, 2023

Although could this do the job?

The signal in geany/geany#3707 is implemented using opening_session_files. It's just that opening_session_files isn't public to plugins and also there's no event that would notify you when this value gets larger than 0 or drops back to 0 which the signal does.

@elextr
Copy link
Contributor Author

elextr commented Dec 5, 2023

Ok, maybe add the explanation to the PR that its edge triggered from the flag to provide notification when it changes and that it avoids making geany_status visible to plugins.

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

2 participants