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

Server logs to panel #811

Merged
merged 71 commits into from Dec 21, 2019
Merged

Server logs to panel #811

merged 71 commits into from Dec 21, 2019

Conversation

rwols
Copy link
Member

@rwols rwols commented Dec 2, 2019

This works pretty good already.

  • Move forward with OutputPanel from sublime_lib? What to do about the mypy errors?
  • Should the server log panel be a circular buffer? It will append lines indefinitely now.
  • It appears attach_tcp_client was an unused function? I removed it.
  • Moved attachment of stderr to the WindowManager.

Screenshot from 2019-12-02 20-30-35

@rchl
Copy link
Member

rchl commented Dec 2, 2019

So this will split server logs only? Does it means that it will be hard to correlate specific server messages with the protocol communication? I would sometimes do console.error() calls in a server to debug something.

I would love to have to have all LSP-related logs in one single panel and be able to decide what kind of logs should be shown there (protocol / server / etc. - could be done with a bitmask).

@tomv564
Copy link
Contributor

tomv564 commented Dec 3, 2019

Yeah, correlating server output to payloads is nice, we could perhaps always have them in a server log panel?

The main console should then only contain LSP logging about package initialisation, configuration and failures to start servers - things new users would be most interested in.

Another thought - if you are running 2 servers in a given window, it becomes somewhat painful to identify which messages came from which server. We could create an output panel per running configuration?

Copy link
Contributor

@tomv564 tomv564 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work.

Curious about your thoughts about OutputPanel, assuming we solve the import/typing issue, did it save us complexity?

plugin/core/windows.py Outdated Show resolved Hide resolved
plugin/core/windows.py Outdated Show resolved Hide resolved
plugin/core/rpc.py Show resolved Hide resolved
plugin/core/windows.py Outdated Show resolved Hide resolved
plugin/diagnostics.py Outdated Show resolved Hide resolved
plugin/panels.py Outdated Show resolved Hide resolved
plugin/panels.py Outdated Show resolved Hide resolved
So that keybindings with a context keep working if the user's cursor
is in the panel somewhere.
Copy link
Contributor

@tomv564 tomv564 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this became a rather large pull request I looked at some things that jumped out at me. Looking forward to having another look after!

plugin/core/panels.py Show resolved Hide resolved
plugin/panels.py Outdated Show resolved Hide resolved
boot.py Outdated Show resolved Hide resolved
plugin/core/main.py Outdated Show resolved Hide resolved
plugin/core/panels.py Outdated Show resolved Hide resolved
plugin/core/settings.py Outdated Show resolved Hide resolved
plugin/core/windows.py Outdated Show resolved Hide resolved
plugin/core/windows.py Outdated Show resolved Hide resolved
plugin/core/windows.py Outdated Show resolved Hide resolved
plugin/core/windows.py Show resolved Hide resolved
Conflicts:
	plugin/core/process.py
	plugin/core/sessions.py
	plugin/core/test_windows.py
	plugin/core/windows.py
Instead, we have a logger class now with methods such as
outgoing_request, incoming_request.

The WindowManager modifies the eventual log sink of that object so
that it'll log to a panel.

Interestingly, this also makes it easy to log to the console again.
Copy link
Contributor

@tomv564 tomv564 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice changes in the last round!
I'd still like to avoid the deprecation of LspShowDiagnosticsPanelCommand, but otherwise it's ready to merge!

@rwols
Copy link
Member Author

rwols commented Dec 19, 2019

Perhaps we can do an int(payload["id"]) if "id" in payload else None or something?

You're right...

Nice changes in the last round!

Thanks!

I'd still like to avoid the deprecation of LspShowDiagnosticsPanelCommand, but otherwise it's ready to merge!

I was about to write this, hold on for just this evening :)

tomv564
tomv564 previously approved these changes Dec 20, 2019
@tomv564 tomv564 merged commit cdfc434 into master Dec 21, 2019
@rwols rwols deleted the feature/server-logs-to-panel branch December 21, 2019 22:55
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.

None yet

5 participants